how to build with --enable-shared so that binary knows where libraries are.

d d ded.utility at gmail.com
Wed Mar 31 23:36:56 EDT 2010


The following is on Linux.

I'd like to build python with ./configure --enable-shared.  And
install in a non-standard place (an nfs-mounted directory).

However, the binary is then not usable, since it can't find the
library.  I can fix this by defining LD_LIBRARY_PATH, but I don't want
to do that.  Doing anything system-specific is impractical, since many
systems will point to this directory (LD_LIBRARY_PATH is feasible,
though undesired, because it can be set in a common script that users
call from their .cshrc files.)

Is there a way to configure the build such that the binary will know
where the shared library is?

I found this:
http://koansys.com/tech/building-python-with-enable-shared-in-non-standard-location
It recommends LDFLAGS="-rpath <path to lib>", and mentions that you
get a "compiler cannot create executables" error unless you first
create the empty directory.  But I get that error even when I do
create the empty directory.

Any help would be appreciated.

--Dan



More information about the Python-list mailing list