pytorch_structure2vec icon indicating copy to clipboard operation
pytorch_structure2vec copied to clipboard

error message when running python mol_lib.py

Open hjhung opened this issue 6 years ago • 13 comments
trafficstars

When I run

cd harvard_cep
python mol_lib.py

I got the following error:

Traceback (most recent call last): File "mol_lib.py", line 115, in MOLLIB = _mol_lib() File "mol_lib.py", line 12, in init self.lib = ctypes.CDLL('%s/build/dll/libmol.so' % dir_path) File "/home/account/anaconda3/lib/python3.7/ctypes/init.py", line 356, in init self._handle = _dlopen(self._name, mode) OSError: /home/account/pytorch_structure2vec-master/harvard_cep/build/dll/libmol.so: undefined symbol: _ZN5RDKit17SmilesMolSupplierC1ERKSsS2_iibb

I think this issue is related with #2, but I can not solve this problem with the suggestion. I have tried to rebuilt rdkit and boost severl times, but the same error still incurs.

Thanks for help!

hjhung avatar Jan 07 '19 08:01 hjhung

Hi,

Have you properly defined the LD_LIBRARY_PATH to include your rdkit lib?

Hanjun-Dai avatar Jan 08 '19 19:01 Hanjun-Dai

Hi,

Yes, I set LD_LIBRARY_PATH as /home/account/boost/lib/:/home/account/rdkit/lib. Did I missing something needed?

hjhung avatar Jan 10 '19 06:01 hjhung

If you built the rdkit by your own, did you do make install ?

Hanjun-Dai avatar Jan 11 '19 03:01 Hanjun-Dai

Hi,

Yes, I did make install but still got the error.

I was wondering whether this is because of the boost library. I can not install the boost.python successfully in my home directory (1.65.1) successfully and thus another version of boost (in /usr/include/boost, 1.69.0) is also used in the process.

Thanks!

hjhung avatar Jan 11 '19 07:01 hjhung

which version of rdkit are you using?

Hanjun-Dai avatar Jan 11 '19 16:01 Hanjun-Dai

I am using Release_2019.03.1.

hjhung avatar Jan 11 '19 18:01 hjhung

can you try Release_2017_09_2? that was the version I've tested.

I'll also try with new versions of rdkit later

Hanjun-Dai avatar Jan 11 '19 18:01 Hanjun-Dai

Of course, will try and let you know later. Thanks a lot!

Another question: did you use miniconda or anaconda?

hjhung avatar Jan 11 '19 18:01 hjhung

Hi,

I tried to install Release_2017_09_2 in the same cluster but it incurs an error during

cmake .. -DPy_ENABLE_SHARED=1 \
	-DRDK_INSTALL_INTREE=ON \
	-DRDK_INSTALL_STATIC_LIBS=OFF \
	-DRDK_BUILD_CPP_TESTS=ON \
	-DPYTHON_INCLUDE_DIR=$PYROOT/include/python3.7m \
	-DBOOST_ROOT="/home/account/boost"

The error is

/home/account/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lboost_thread-mt
/home/account/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lboost_system-mt
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libRDKitRDGeneral.so.1.2017.09.1] Error 1
make[1]: *** [Code/RDGeneral/CMakeFiles/RDGeneral.dir/all] Error 2

hjhung avatar Jan 13 '19 15:01 hjhung

It seems you don't have c++ boost installed?

Hanjun-Dai avatar Jan 13 '19 22:01 Hanjun-Dai

I installed boost 1.65.1. With the same environment and the latest rdkit, I could install rdkit successfully but could not run mol_lib.py as mentioned in the top of this issue.

hjhung avatar Jan 14 '19 03:01 hjhung

you need to make sure you have included boost libs in LD_LIBRARY_PATH

Hanjun-Dai avatar Jan 14 '19 03:01 Hanjun-Dai

Yes, I have included the boost libs in LD_LIBRARY_PATH.

$ echo $LD_LIBRARY_PATH
/home/account/boost/lib/:/home/account/rdkit/lib:/usr/lib64

hjhung avatar Jan 14 '19 14:01 hjhung