How to tell what python version libboost_python.so is using?
Question: I'd like to know what version of python boost_python.so is expecting. This is
on a computer with multiple python versions and I did not build/install boost
myself (nor do i have root access).

How can i tell what version of python boost_python.so is compiled for?

I didn't find anything useful in the output from ldd but include it here
incase someone else sees something.

    
    
    -bash-3.2$ ldd -v libboost_python.so.1.46.1 
    libutil.so.1 => /lib64/libutil.so.1 (0x00002ad65582d000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ad655a30000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00002ad655c4b000)
    librt.so.1 => /lib64/librt.so.1 (0x00002ad655e50000)
    libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002ad656059000)
    libm.so.6 => /lib64/libm.so.6 (0x00002ad656359000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002ad6565dd000)
    libc.so.6 => /lib64/libc.so.6 (0x00002ad6567eb000)
    /lib64/ld-linux-x86-64.so.2 (0x000000374c600000)
    
    Version information:
    ./libboost_python.so.1.46.1:
        libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1
        libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so.0
        libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
        libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        libstdc++.so.6 (CXXABI_1.3) => /usr/lib64/libstdc++.so.6
        libstdc++.so.6 (GLIBCXX_3.4) => /usr/lib64/libstdc++.so.6
    /lib64/libutil.so.1:
        libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
    /lib64/libpthread.so.0:
        ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
        ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /lib64/ld-linux-x86-64.so.2
        ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
        libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
        libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
        libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
    /lib64/libdl.so.2:
        ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
        libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
        libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
    /lib64/librt.so.1:
        ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
        libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so.0
        libpthread.so.0 (GLIBC_PRIVATE) => /lib64/libpthread.so.0
        libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
        libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
    /usr/lib64/libstdc++.so.6:
        ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
        libgcc_s.so.1 (GCC_4.2.0) => /lib64/libgcc_s.so.1
        libgcc_s.so.1 (GCC_3.3) => /lib64/libgcc_s.so.1
        libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1
        libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
        libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
        libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
        libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
    /lib64/libm.so.6:
        libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
    /lib64/libgcc_s.so.1:
        libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
        libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
    /lib64/libc.so.6:
        ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
        ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
    


Answer: From: <https://github.com/mapnik/mapnik/wiki/InstallationTroubleshooting>

"And sometimes even that does not work. HINT: pass the -d2 flag to see all the
compile commands sent to gcc by bjam and you will likely see something like
-I/usr/include/python24 in the compile arguments when it should be
-I/usr/include/python26 (or some older version of python headers). If this
happens then you can craft a full config file (with all possible python info)
and pass a reference to that on the bjam command line. Docs on this are here:
<http://www.boost.org/doc/libs/1_42_0/libs/python/doc/building.html#configuring-
boost-build>, and an example follows:

Create a file called 'user-config.jam' (but change the python versions to be
appropriate):

    
    
    import option ;
    import feature ;
    if ! gcc in [ feature.values <toolset> ]
    {
        using gcc ;
    }
    project : default-build <toolset>gcc ;
    using python
         : 2.5 # version
         : /usr/bin/python2.5 # cmd-or-prefix
         : /usr/include/python2.5/ # includes
         : /usr/lib/python2.5/config/ # a lib actually symlink
         : <toolset>gcc # condition
         ;
    libraries = --with-python ;
    

"

Look for a .jam config file. If it exists check for the 'using python'
command. If it doesn't exist, run the -d2 flag against bjam to determine the
default location of python that it uses. This obviously isn't a direct method
and would simply leave you with a likely answer given the inputs (but maybe
that's good enough).

