Install from source on a x86_64 machine

Discussion in 'Python' started by Christopher Taylor, Oct 18, 2006.

  1. Hello all,

    Being relatively new to linux I'm a little confused about what options
    I need to use to build python from source.

    Currently, I have python installed as part of the inital RHEL4 load
    located at /usr/bin/Python and /usr/bin/Python2.3 . Some of the files
    are located in /usr/lib64/Python2.3 and in /usr/lib/Python2.3 .
    Please let me know if you need dir lsitings.

    I'm trying to compile from source and plan on using the
    --enable-unicode=ucs4 option for the configure script due to some RHEL
    messing around with Tcl/Tk.

    *** How do I get make altinstall to put the appropriate files in
    /usr/lib64/Python2.4 and /usr/lib/Python2.4 respectively ? ***

    Respectfully,
    Christopher Taylor
     
    Christopher Taylor, Oct 18, 2006
    #1
    1. Advertising

  2. Christopher Taylor

    Paul Boddie Guest

    Christopher Taylor wrote:
    >
    > Being relatively new to linux I'm a little confused about what options
    > I need to use to build python from source.


    The README should provide sufficient information, although if you want
    to install Python into /usr rather than /usr/local (as I believe is the
    default), you need to run configure as follows:

    ../configure --prefix=/usr

    > Currently, I have python installed as part of the inital RHEL4 load
    > located at /usr/bin/Python and /usr/bin/Python2.3 . Some of the files
    > are located in /usr/lib64/Python2.3 and in /usr/lib/Python2.3 .
    > Please let me know if you need dir lsitings.


    In fact, it's /usr/bin/python, /usr/bin/python2.3, /usr/lib64/python2.3
    and /usr/lib/python, since Red Hat hasn't decided to capitalise the
    name of the software. ;-)

    > I'm trying to compile from source and plan on using the
    > --enable-unicode=ucs4 option for the configure script due to some RHEL
    > messing around with Tcl/Tk.
    >
    > *** How do I get make altinstall to put the appropriate files in
    > /usr/lib64/Python2.4 and /usr/lib/Python2.4 respectively ? ***


    The configured Makefile together with the various other tools should
    work out where to put the libraries. I'm a newcomer to x86-64, although
    I've had some relatively recent experience with sparc64, and whilst I'm
    not really familiar with the way the various tools choose the install
    directory of libraries, I've noticed that sometimes 64-bit libraries
    end up in lib rather than lib64. Meanwhile, I notice that the Red Hat
    libraries do adhere correctly to the expectation that 32-bit libraries
    are found under /usr/lib/python2.3 and 64-bit libraries are found under
    /usr/lib64/python2.3.

    Perhaps you should configure and make Python, then run the install
    process in "pretend" mode:

    make -n altinstall

    You'll get a huge amount of output, but this should at least tell you
    what the installation process is thinking of doing, and it won't be
    overwriting anything important while it does so.

    Paul
     
    Paul Boddie, Oct 19, 2006
    #2
    1. Advertising

  3. > The README should provide sufficient information, although if you want
    > to install Python into /usr rather than /usr/local (as I believe is the
    > default), you need to run configure as follows:
    >
    > ./configure --prefix=/usr
    >


    Yeah, I saw that in the readme.

    >
    > In fact, it's /usr/bin/python, /usr/bin/python2.3, /usr/lib64/python2.3
    > and /usr/lib/python, since Red Hat hasn't decided to capitalise the
    > name of the software. ;-)
    >


    ok you got me, type-o ....

    > The configured Makefile together with the various other tools should
    > work out where to put the libraries. I'm a newcomer to x86-64, although
    > I've had some relatively recent experience with sparc64, and whilst I'm
    > not really familiar with the way the various tools choose the install
    > directory of libraries, I've noticed that sometimes 64-bit libraries
    > end up in lib rather than lib64. Meanwhile, I notice that the Red Hat
    > libraries do adhere correctly to the expectation that 32-bit libraries
    > are found under /usr/lib/python2.3 and 64-bit libraries are found under
    > /usr/lib64/python2.3.
    >
    > Perhaps you should configure and make Python, then run the install
    > process in "pretend" mode:
    >
    > make -n altinstall
    >
    > You'll get a huge amount of output, but this should at least tell you
    > what the installation process is thinking of doing, and it won't be
    > overwriting anything important while it does so.
    >



    ok, so where does that leave me. I'm not even sure which files
    *should* be put in /lib64 vs lib.
    >>> I guess what I'm expecting is a congifure option to specify where

    architecture dependent files should be put. <<<

    Has anyone else mentioned this before?

    Respectfully,
    Christopher Taylor
     
    Christopher Taylor, Oct 19, 2006
    #3
  4. Christopher Taylor

    Paul Boddie Guest

    Christopher Taylor wrote:
    >
    > ok, so where does that leave me. I'm not even sure which files
    > *should* be put in /lib64 vs lib.


    I'd imagine that anything which is a .so file (plus the modules which
    depend on it, I suppose) should be put in the appropriate library
    directory. Thus, 32-bit libraries should go into
    /usr/lib/python2.4/site-packages and 64-bit libraries should go into
    /usr/lib64/python2.4/site-packages. That said, I can see things that
    I've installed via distutils (and various make; make install
    combinations) that are in the "wrong" directory.

    > >>> I guess what I'm expecting is a congifure option to specify where

    > architecture dependent files should be put. <<<


    Generally, the install process should respect the prefix (ie. /usr in
    your case, /usr/local in the default case) and then choose the
    appropriate library directories below that (ie. /usr/lib, /usr/lib64 in
    your case), but I can't find anything obvious in the README about
    specifying architecture-dependent install directories.

    > Has anyone else mentioned this before?


    I'd be interested to hear more about this as well.

    Paul
     
    Paul Boddie, Oct 19, 2006
    #4
  5. > Generally, the install process should respect the prefix (ie. /usr in
    > your case, /usr/local in the default case) and then choose the
    > appropriate library directories below that (ie. /usr/lib, /usr/lib64 in
    > your case), but I can't find anything obvious in the README about
    > specifying architecture-dependent install directories.



    Well that's pretty much what's happening ... either the 64bit libs
    aren't being put in /usr/lib64 ... they're all being put in /usr/lib
    or they were never compiled up in 64bit mode. The only think I can
    think of is that the configure script doesn't check the mode the OS is
    running in and take appropriate steps, ie.e compile the libs in both
    32 and 64 bit mode and place them accordingly.

    I know this is a problem because when I try and compile up mod_python
    it's telling I'm getting the following error when it tries to link
    libpython2.4.a :
    /usr/bin/ld: /usr/lib/python2.4/config/libpython2.4.a(abstract.o):
    relocation R_X86_64_32 against `a local symbol' can not be used when
    making a shared object; recompile with -fPIC
    /usr/lib/python2.4/config/libpython2.4.a: could not read symbols: Bad value

    Which basically means to me that for whatever reason, when python
    compiled up, the ./configure script didn't see that the os was running
    in 64bit mode and compile the libraries in PIC mode, something I think
    that is required for libraries on a 64bit OS.


    Respectfully,
    Christopher Taylor
     
    Christopher Taylor, Oct 19, 2006
    #5
    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. UJ
    Replies:
    2
    Views:
    438
  2. Sérgio Monteiro Basto

    python setup.py build 32-bits on x86_64 machine

    Sérgio Monteiro Basto, Nov 22, 2009, in forum: Python
    Replies:
    1
    Views:
    746
  3. Sérgio Monteiro Basto
    Replies:
    4
    Views:
    1,316
    Sérgio Monteiro Basto
    Nov 24, 2009
  4. William S.
    Replies:
    1
    Views:
    465
    J.O. Aho
    Mar 8, 2011
  5. Costas
    Replies:
    6
    Views:
    196
    Costas
    May 28, 2007
Loading...

Share This Page