rdkit / rdkit

The official sources for the RDKit library
BSD 3-Clause "New" or "Revised" License
2.59k stars 864 forks source link

rdBase.so: undefined symbol: _ZN5boost6python6detail11init_moduleEPKcPFvvE #4111

Closed rwst closed 3 years ago

rwst commented 3 years ago

After building git master manually on OpenSUSE Linux using cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.6 ..

ralf@ark:~/rdkit> cat t.py 
from rdkit import Chem

ralf@ark:~/rdkit> python3 t.py 
Traceback (most recent call last):
  File "t.py", line 1, in <module>
    from rdkit import Chem
  File "/home/ralf/rdkit/rdkit/__init__.py", line 2, in <module>
    from .rdBase import rdkitVersion as __version__
ImportError: /home/ralf/rdkit/rdkit/rdBase.so: undefined symbol: _ZN5boost6python6detail11init_moduleEPKcPFvvE
ralf@ark:~/rdkit> ldd ./build/rdkit/rdBase.so
    linux-vdso.so.1 (0x00007ffc56498000)
    libRDKitRDBoost.so.1 => /home/ralf/rdkit/lib/libRDKitRDBoost.so.1 (0x00007f053990b000)
    libRDKitRDGeneral.so.1 => /home/ralf/rdkit/lib/libRDKitRDGeneral.so.1 (0x00007f05396e6000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f05394e2000)
    libpython3.6m.so.1.0 => /usr/lib64/libpython3.6m.so.1.0 (0x00007f0539003000)
    libboost_python-py3.so.1.66.0 => /usr/lib64/libboost_python-py3.so.1.66.0 (0x00007f0538d3a000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f0538b1b000)
    libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f0538741000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f0538409000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f05381f0000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f0537e35000)
    libpython2.7.so.1.0 => /usr/lib64/libpython2.7.so.1.0 (0x00007f05379f0000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f0539e37000)
    libutil.so.1 => /lib64/libutil.so.1 (0x00007f05377ed000)

Also

ralf@ark:~/rdkit> echo $LD_LIBRARY_PATH 
/home/ralf/rdkit/lib
ralf@ark:~/rdkit> echo $PYTHONPATH
/home/ralf/rdkit/

I am at a loss. Please help.

rwst commented 3 years ago

I just see all tests pass except the python ones.

DavidACosgrove commented 3 years ago

I would guess that’s missing the boost Python libraries. Did you build them when you installed boost and are they in your LD_LIBRARY_PATH?

Dave

On Thu, 6 May 2021 at 09:30, Ralf Stephan @.***> wrote:

I just see all tests pass except the python ones.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rdkit/rdkit/issues/4111#issuecomment-833338322, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACGF2FRUNHE4D33LMW3H3FDTMJHRHANCNFSM44GRXH7Q .

-- David Cosgrove Freelance computational chemistry and chemoinformatics developer http://cozchemix.co.uk

ptosco commented 3 years ago

Your

ldd ./build/rdkit/rdBase.so

command shows that you are linking against both libpython3.6m.so.1.0 and libpython2.7.so.1.0. Something is wrong in the way you configured your build.

rwst commented 3 years ago

The libboost-python3 and libboost-python-py3 + devel packages were installed. Then I rebuilt with cmake -D PYTHON_LIBRARY=/usr/lib64/libpython3.6m.so -D PYTHON_INCLUDE_DIR=/usr/include/python3.6m/ -D PYTHON_EXECUTABLE=/usr/bin/python3 .. which made the py2 link go away and resolved the issue.

Thanks.