bcm-uga / Loter

A software package for local ancestry inference and haplotype phasing
Other
38 stars 7 forks source link

OSError: #10

Closed mano1988 closed 4 years ago

mano1988 commented 5 years ago

Hi,

I tried loter python module version. I am getting following error could you please help.

Python 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:09:58) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux Type "help", "copyright", "credits" or "license" for more information.

import os import numpy as np

H_ceu = np.load(os.path.join(os.pardir, "data", "H_ceu.npy")) H_yri = np.load(os.path.join(os.pardir, "data", "H_yri.npy")) H_mex = np.load(os.path.join(os.pardir, "data", "H_mex.npy"))

import loter.locanc.local_ancestry as lc Traceback (most recent call last): File "", line 1, in File "/home/mano/programs/Loter/python-package/loter/locanc/local_ancestry.py", line 5, in import loter.pipeline as lt File "/home/mano/programs/Loter/python-package/loter/pipeline.py", line 6, in import loter.opti as opti File "/home/mano/programs/Loter/python-package/loter/opti.py", line 1, in import loter.estimatea as esta File "/home/mano/programs/Loter/python-package/loter/estimatea.py", line 5, in import loter.datastruct.parameter as parameter File "/home/mano/programs/Loter/python-package/loter/datastruct/parameter.py", line 4, in from loter.find_lib import _LIB File "/home/mano/programs/Loter/python-package/loter/find_lib.py", line 35, in _LIB = _get_lib() File "/home/mano/programs/Loter/python-package/loter/find_lib.py", line 31, in _get_lib lib = C.cdll.LoadLibrary(selected_lib) File "/home/mano/anaconda3/lib/python3.6/ctypes/init.py", line 426, in LoadLibrary return self._dlltype(name) File "/home/mano/anaconda3/lib/python3.6/ctypes/init.py", line 348, in init self._handle = _dlopen(self._name, mode) OSError: /home/mano/anaconda3/lib/python3.6/site-packages/loter/_loter_wrap.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZTVNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEEE

Thanks, Manoharan

gdurif commented 5 years ago

Hi, thanks for reporting this issue. Apparently there is an issue with an element of the C++ STL.

If that is possible on your system, could you try install Loter (i.e. repeat python setup.py install) with a more recent version of gcc?

Thanks

mano1988 commented 5 years ago

Hi,

I have upgraded from ubuntu 16.04 to 18.04. I tried with latest version, still getting the following error:

import loter.locanc.local_ancestry as lc Traceback (most recent call last): File "", line 1, in File "/home/mano/programs/Loter/python-package/loter/locanc/local_ancestry.py", line 5, in import loter.pipeline as lt File "/home/mano/programs/Loter/python-package/loter/pipeline.py", line 6, in import loter.opti as opti File "/home/mano/programs/Loter/python-package/loter/opti.py", line 1, in import loter.estimatea as esta File "/home/mano/programs/Loter/python-package/loter/estimatea.py", line 5, in import loter.datastruct.parameter as parameter File "/home/mano/programs/Loter/python-package/loter/datastruct/parameter.py", line 4, in from loter.find_lib import _LIB File "/home/mano/programs/Loter/python-package/loter/find_lib.py", line 35, in _LIB = _get_lib() File "/home/mano/programs/Loter/python-package/loter/find_lib.py", line 31, in _get_lib lib = C.cdll.LoadLibrary(selected_lib) File "/home/mano/anaconda3/lib/python3.6/ctypes/init.py", line 426, in LoadLibrary return self._dlltype(name) File "/home/mano/anaconda3/lib/python3.6/ctypes/init.py", line 348, in init self._handle = _dlopen(self._name, mode) OSError: /home/mano/anaconda3/lib/python3.6/site-packages/loter/_loter_wrap.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZTVNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEEE

I could not find the command line version "loter_cli". Could you please help.

Thanks, Manoharan

gdurif commented 5 years ago

Hi, I am not able to reproduce the issue, could you tell me which version of gcc or any other compiler you are using? e.g. by running the command gcc --version. There seems to be an issue with gcc 5 (c.f. https://stackoverflow.com/questions/33394934/converting-std-cxx11string-to-stdstring).

gdurif commented 5 years ago

Regarding the command line tools, it is installed with the python package, thus it requires for the installation to work.

mano1988 commented 5 years ago

HI,

I am using following version. gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

while installing Loter installed with few warning. please find the log file. log.txt

gdurif commented 5 years ago

Hi, I try with the latest version of anaconda, still not able to replicate the bug and the CLI tool works:

loter_cli --help

I have the same gcc. I am still investigating. I think some packages/libraries are missing on your system, I juste have to figure which ones.

gdurif commented 5 years ago

Could you run ldd on the shared library compiled at installation, i.e:

ldd /home/mano/anaconda3/lib/python3.6/site-packages/loter/_loter_wrap.cpython-36m-x86_64-linux-gnu.so

On my system, I get the following results:

linux-vdso.so.1 (0x00007fff077f1000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f929cb19000)
libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f929c8ea000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f929c6d2000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f929c2e1000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f929bf43000)
/lib64/ld-linux-x86-64.so.2 (0x00007f929d0c3000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f929bd3f000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f929bb20000)

Then you can check with which Ubuntu package are shipped each library with dpkg -S <file>, e.g.:

dpkg -S /usr/lib/x86_64-linux-gnu/libstdc++.so.6

If some libraries are missing i.e. without related files, it should be the problem.

mano1988 commented 5 years ago

Hi, I got following results:

ldd /home/mano/anaconda3/lib/python3.6/site-packages/loter/_loter_wrap.cpython-36m-x86_64-linux-gnu.so linux-vdso.so.1 (0x00007ffd691e2000) libstdc++.so.6 => /home/mano/anaconda3/lib/libstdc++.so.6 (0x00007fc9b2736000) libblas.so.3 => /usr/lib/x86_64-linux-gnu/libblas.so.3 (0x00007fc9b24c9000) liblapack.so.3 => /usr/lib/x86_64-linux-gnu/liblapack.so.3 (0x00007fc9b1c2b000) libgomp.so.1 => /home/mano/anaconda3/lib/libgomp.so.1 (0x00007fc9b1a1c000) libpython3.6m.so.1.0 => /home/mano/anaconda3/lib/libpython3.6m.so.1.0 (0x00007fc9b1515000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc9b1177000) libgcc_s.so.1 => /home/mano/anaconda3/lib/libgcc_s.so.1 (0x00007fc9b0f61000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc9b0d42000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc9b0951000) /lib64/ld-linux-x86-64.so.2 (0x00007fc9b2c6e000) libgfortran.so.4 => /usr/lib/x86_64-linux-gnu/libgfortran.so.4 (0x00007fc9b0572000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fc9b036a000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc9b0166000) libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fc9aff63000) libquadmath.so.0 => /home/mano/anaconda3/lib/libquadmath.so.0 (0x00007fc9afd27000) mano@mano-Lenovo-G50-70:~$ dpkg -S /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++6:amd64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6

gdurif commented 5 years ago

To be sure, could you try outside of Anaconda with Ubuntu default Python 3 (in a virtualenv to avoid messing with your system, which require apt-get install python3 virtualenv):

# create a virtualenv based on Python3 from the system (edit path to python3 if required)
virtualenv -p /usr/bin/python3 test_loter
# activate virtualenv
source test_loter/bin/activate
# install Loter (edit path)
cd /path/to/Loter/python-package
python setup.py install
# test Loter
python script_test_locanc.py
# deactivate virtualenv
deactivate
mano1988 commented 4 years ago

Hi, Here is the result of python script_test_locanc.py sript: /home/mano/test_loter/lib/python3.6/site-packages/scikit_learn-0.21.3-py3.6-linux-x86_64.egg/sklearn/utils/linearassignment.py:21: DeprecationWarning: The linearassignment module is deprecated in 0.21 and will be removed from 0.23. Use scipy.optimize.linear_sum_assignment instead. DeprecationWarning) [[1 1 1 1 1] [0 0 0 0 0]]

gdurif commented 4 years ago

Ok, great, thanks. So it is working outside Anaconda (is it possible that you use Loter outside of Anaconda for the moment?).

I guess the problem would be with the libstdc++ shipped with Anaconda. Did you try to reinstall the latest Anaconda? (https://www.anaconda.com/distribution/)

mano1988 commented 4 years ago

thanks for all your help, It is working now.