install python to custom prefix with custom library directories

Discussion in 'Python' started by =?utf-8?Q?Poor=20Yorick?=, Jul 17, 2007.

  1. 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
    =?utf-8?Q?Poor=20Yorick?=, Jul 17, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joel Finkel
    Replies:
    0
    Views:
    483
    Joel Finkel
    Sep 12, 2003
  2. Jeffry van de Vuurst
    Replies:
    2
    Views:
    514
    Jeffry van de Vuurst
    Jul 30, 2003
  3. =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=

    Multiple bin-directories with virtual directories?

    =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=, Nov 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    814
    =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=
    Nov 9, 2004
  4. Tim Tyler
    Replies:
    36
    Views:
    1,448
    Darryl L. Pierce
    Dec 10, 2004
  5. Chris  Chiasson
    Replies:
    6
    Views:
    607
    Richard Tobin
    Nov 14, 2006
Loading...

Share This Page