vatlab / varianttools

software tool for the manipulation, annotation, selection, and analysis of variants in the context of next-gen sequencing analysis
https://vatlab.github.io/vat-docs/
GNU General Public License v3.0
31 stars 4 forks source link

Install error on latest version #131

Closed jma7 closed 5 years ago

jma7 commented 5 years ago

Got this error when trying to install the latest updates on mac.

building 'variant_tools._vt_sqlite3_ext' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/jma7/anaconda/envs/VariantTools/include -arch x86_64 -I/Users/jma7/anaconda/envs/VariantTools/include -arch x86_64 -DMODULE_NAME="vt_sqlite3" -DCGA_TOOLS_IS_PIPELINE=0 -DCGA_TOOLS_VERSION="1.6.0.43" -DUSE_TABIX=1 -DUSE_BAM=1 -D_FILE_OFFSET_BITS=64 -D_USE_KNETFILE -DBGZF_CACHE -Isrc/ -Isrc/ucsc/inc -Isrc/ucsc/tabix -Isrc/ucsc/samtools -Isrc/sqlite -Isrc/variant_tools -Isrc/cgatools -I/Users/jma7/anaconda/envs/VariantTools/include -I/Users/jma7/anaconda/envs/VariantTools/include/python3.6m -c src/sqlite/vt_sqlite3_ext.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/sqlite/vt_sqlite3_ext.o -O3 -Wno-unused-local-typedef -Wno-return-type
In file included from src/sqlite/vt_sqlite3_ext.cpp:70:
In file included from src/cgatools/reference/ChromosomeIdField.hpp:20:
src/cgatools/core.hpp:50:10: fatal error: 'boost/cstdint.hpp' file not found
#include <boost/cstdint.hpp>
         ^~~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
BoPeng commented 5 years ago

boost (and zeromq and gsl) are no longer embedded (#122 ). To fix this error, you will need to install boost C++ library, either from system, or in conda. The conda include path for libboost will be automatically detected and added. If you are not using conda, you can specify the path in environment variable LD_INCLUDE_PATH.

jma7 commented 5 years ago

Need to update the installation documents to include:

conda install -c anaconda boost
conda install gsl
jma7 commented 5 years ago

I got this error after installation of current master:

(VariantTools) BSTMC07TP062G1J:VariantTools jma7$ vtools -h
Traceback (most recent call last):
  File "/Users/jma7/anaconda/envs/VariantTools/bin/vtools", line 11, in <module>
    load_entry_point('variant-tools==3.1.0', 'console_scripts', 'vtools')()
  File "/Users/jma7/anaconda/envs/VariantTools/lib/python3.6/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Users/jma7/anaconda/envs/VariantTools/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2843, in load_entry_point
    return ep.load()
  File "/Users/jma7/anaconda/envs/VariantTools/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2434, in load
    return self.resolve()
  File "/Users/jma7/anaconda/envs/VariantTools/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2440, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ImportError: bad magic number in 'variant_tools': b'\x03\xf3\r\n'

I have tried remove dist, build and folder in the site-packages, then reinstall, still get this error. There is no error message during installation.

BoPeng commented 5 years ago

According to https://github.com/Miserlou/Zappa/issues/854

I was able to fix this too, by doing find . -name \*.pyc -delete. Mine definitely wasn't caused by PY2 -> PY3 upgrade, but seemed to happen spontaneously overnight.

jma7 commented 5 years ago

After find . -name \*.pyc -delete, I reinstalled variantTools. Then I got Failed to import module (No module named '_cgatools'). Followed steps in https://github.com/vatlab/varianttools/issues/121 to reinstall, still have the same error.

boost                     1.67.0                   py36_4    anaconda
gsl                       2.2.1                         0
blas                      1.0                         mkl
BoPeng commented 5 years ago

If you are on a mac, please debug as follows:

  1. Go to the installed library directory or src/variant_tools if you used in-place installation
  2. Use otool to check linked libraries
    otool -L _cgatools.cpython-37m-darwin.so 
    _cgatools.cpython-37m-darwin.so:
    @rpath/libboost_iostreams.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
  3. python -c 'import _cgatools' and check the error message, you should see something like symbol not found.
jma7 commented 5 years ago
(VariantTools) :variant_tools jma7$ otool -L _cgatools.cpython-36m-darwin.so 
_cgatools.cpython-36m-darwin.so:
    @rpath/libboost_iostreams.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libboost_regex.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libboost_filesystem.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
    @rpath/libbz2.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/./libstdc++.6.dylib (compatibility version 7.0.0, current version 7.19.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
(VariantTools) :variant_tools jma7$ python -c 'import _cgatools'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: dlopen(/Users/jma7/anaconda/envs/VariantTools/lib/python3.6/site-packages/variant_tools-3.1.0-py3.6-macosx-10.7-x86_64.egg/variant_tools/_cgatools.cpython-36m-darwin.so, 2): Symbol not found: __ZN5boost13match_resultsIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS5_EEEE12maybe_assignERKS9_
  Referenced from: /Users/jma7/anaconda/envs/VariantTools/lib/python3.6/site-packages/variant_tools-3.1.0-py3.6-macosx-10.7-x86_64.egg/variant_tools/_cgatools.cpython-36m-darwin.so
  Expected in: flat namespace
 in /Users/jma7/anaconda/envs/VariantTools/lib/python3.6/site-packages/variant_tools-3.1.0-py3.6-macosx-10.7-x86_64.egg/variant_tools/_cgatools.cpython-36m-darwin.so
BoPeng commented 5 years ago

It looks like you have multiple versions of boost, maybe a system one and a conda one, and the build process uses the conda include file, which is not compatible with the system boost library... Can you try to identify the boost libraries you have on your system?

jma7 commented 5 years ago

Remove old boost_1_49_0, clear build, dist and site-packages/variant*, then reinstall. It is working now.