Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > install python to custom prefix with custom library directories

Reply
Thread Tools

install python to custom prefix with custom library directories

 
 
=?utf-8?Q?Poor=20Yorick?=
Guest
Posts: n/a
 
      07-17-2007
Today I needed to install python from source on linux to a custom path. /usr/lib/libtk8.3.so existed, but I wanted python to link to /my/custom/path/lib/libtk8.4.so.

I had LDFLAGS set:

LDFLAGS="-L/my/custom/path/lib -Wl,-rpath,$base/lib -Wl,--enable-new-dtags"

configure looked like this:

../configure --prefix=/my/custom/path/python-2.5.1 --enable-shared

but python always linked against /usr/lib/libtk8.3.so instead of libtk8.4.so

I ended up modifying setup.py (see below) but there must be a more user-friendly way to do this. Right? Thank you for your time!

BTW, I don't have root access on this machine

--- setup.py.original 2007-07-17 12:51:27 -04:00
+++ setup.py 2007-07-17 13:21:57 -04:00
@@ -293,10 +293,14 @@
# lib_dirs and inc_dirs are used to search for files;
# if a file is found in one of those directories, it can
# be assumed that no additional -I,-L directives are needed.
+ self.compiler.library_dirs.insert(0,
+ '/my/custom/path/lib')
lib_dirs = self.compiler.library_dirs + [
'/lib64', '/usr/lib64',
'/lib', '/usr/lib',
]
+ self.compiler.include_dirs.insert(0,
+ '/my/custom/path/include')
inc_dirs = self.compiler.include_dirs + ['/usr/include']
exts = []

--
Poor Yorick
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
removing a namespace prefix and removing all attributes not in that same prefix Chris Chiasson XML 6 11-14-2006 05:08 PM
"static" prefix - to parallel "this" prefix Tim Tyler Java 36 12-10-2004 01:02 AM
Multiple bin-directories with virtual directories? =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?= ASP .Net 0 11-09-2004 05:49 PM
How to map Project directories to Production sub-directories Joel Finkel ASP .Net 0 09-12-2003 06:47 PM
Using virtual directories for common directories (scripts, images, styles, etc.) Jeffry van de Vuurst ASP .Net 2 07-30-2003 07:00 PM



Advertisments