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

Error when install master branch in conda with python 2.7 #76

Closed jma7 closed 6 years ago

jma7 commented 6 years ago
running install
running build
running build_py
running build_ext
building 'variant_tools._vt_sqlite3' extension
gcc -fno-strict-aliasing -I/Users/jma7/anaconda/envs/VTools27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DMODULE_NAME="vt_sqlite3" -DHAVE_USLEEP -Isqlite -Isqlite/py3 -I/Users/jma7/anaconda/envs/VTools27/include/python2.7 -c sqlite/py3/cache.c -o build/temp.macosx-10.7-x86_64-2.7/sqlite/py3/cache.o -w
gcc -fno-strict-aliasing -I/Users/jma7/anaconda/envs/VTools27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DMODULE_NAME="vt_sqlite3" -DHAVE_USLEEP -Isqlite -Isqlite/py3 -I/Users/jma7/anaconda/envs/VTools27/include/python2.7 -c sqlite/py3/connection.c -o build/temp.macosx-10.7-x86_64-2.7/sqlite/py3/connection.o -w
gcc -fno-strict-aliasing -I/Users/jma7/anaconda/envs/VTools27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DMODULE_NAME="vt_sqlite3" -DHAVE_USLEEP -Isqlite -Isqlite/py3 -I/Users/jma7/anaconda/envs/VTools27/include/python2.7 -c sqlite/py3/cursor.c -o build/temp.macosx-10.7-x86_64-2.7/sqlite/py3/cursor.o -w
gcc -fno-strict-aliasing -I/Users/jma7/anaconda/envs/VTools27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DMODULE_NAME="vt_sqlite3" -DHAVE_USLEEP -Isqlite -Isqlite/py3 -I/Users/jma7/anaconda/envs/VTools27/include/python2.7 -c sqlite/py3/microprotocols.c -o build/temp.macosx-10.7-x86_64-2.7/sqlite/py3/microprotocols.o -w
gcc -fno-strict-aliasing -I/Users/jma7/anaconda/envs/VTools27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DMODULE_NAME="vt_sqlite3" -DHAVE_USLEEP -Isqlite -Isqlite/py3 -I/Users/jma7/anaconda/envs/VTools27/include/python2.7 -c sqlite/py3/module.c -o build/temp.macosx-10.7-x86_64-2.7/sqlite/py3/module.o -w
gcc -fno-strict-aliasing -I/Users/jma7/anaconda/envs/VTools27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DMODULE_NAME="vt_sqlite3" -DHAVE_USLEEP -Isqlite -Isqlite/py3 -I/Users/jma7/anaconda/envs/VTools27/include/python2.7 -c sqlite/py3/prepare_protocol.c -o build/temp.macosx-10.7-x86_64-2.7/sqlite/py3/prepare_protocol.o -w
gcc -fno-strict-aliasing -I/Users/jma7/anaconda/envs/VTools27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DMODULE_NAME="vt_sqlite3" -DHAVE_USLEEP -Isqlite -Isqlite/py3 -I/Users/jma7/anaconda/envs/VTools27/include/python2.7 -c sqlite/py3/row.c -o build/temp.macosx-10.7-x86_64-2.7/sqlite/py3/row.o -w
gcc -fno-strict-aliasing -I/Users/jma7/anaconda/envs/VTools27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DMODULE_NAME="vt_sqlite3" -DHAVE_USLEEP -Isqlite -Isqlite/py3 -I/Users/jma7/anaconda/envs/VTools27/include/python2.7 -c sqlite/py3/statement.c -o build/temp.macosx-10.7-x86_64-2.7/sqlite/py3/statement.o -w
sqlite/py3/module.c:305:9: error: use of undeclared identifier 'PyModuleDef_HEAD_INIT'
        PyModuleDef_HEAD_INIT,
        ^
sqlite/py3/module.c:304:27: error: variable has incomplete type 'struct PyModuleDef'
static struct PyModuleDef _sqlite3module = {
                          ^
sqlite/py3/module.c:304:15: note: forward declaration of 'struct PyModuleDef'
static struct PyModuleDef _sqlite3module = {
              ^
sqlite/py3/module.c:333:9: error: void function 'PyInit__vt_sqlite3' should not return a value [-Wreturn-type]
        return NULL;
        ^      ~~~~
sqlite/py3/module.c:473:5: error: void function 'PyInit__vt_sqlite3' should not return a value [-Wreturn-type]
    return module;
    ^      ~~~~~~
4 errors generated.
gcc -fno-strict-aliasing -I/Users/jma7/anaconda/envs/VTools27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DMODULE_NAME="vt_sqlite3" -DHAVE_USLEEP -Isqlite -Isqlite/py3 -I/Users/jma7/anaconda/envs/VTools27/include/python2.7 -c sqlite/py3/util.c -o build/temp.macosx-10.7-x86_64-2.7/sqlite/py3/util.o -w
gcc -fno-strict-aliasing -I/Users/jma7/anaconda/envs/VTools27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DMODULE_NAME="vt_sqlite3" -DHAVE_USLEEP -Isqlite -Isqlite/py3 -I/Users/jma7/anaconda/envs/VTools27/include/python2.7 -c sqlite/sqlite3.c -o build/temp.macosx-10.7-x86_64-2.7/sqlite/sqlite3.o -w
error: command 'gcc' failed with exit status 1
sqlite/py3/row.c:169:8: error: unknown type name 'Py_hash_t'
static Py_hash_t pysqlite_row_hash(pysqlite_Row *self)
       ^
1 error generated.

Any suggestions? In the setup.py file, why SQLITE_FOLDER = 'sqlite/py3'? @BoPeng

BoPeng commented 6 years ago
  1. Install pipenv
  2. Create a new directory, run pipenv --python 2.7 to use system python 2.7
  3. pipenv shell to start a shell with python 2.7
  4. Clone the master with command git clone https://github.com/vatlab/VariantTools.git vtools
  5. brew install swig to install swig (mac only)
  6. python setup.py install, got error
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DMODULE_NAME="vt_sqlite3" -DHAVE_USLEEP -Isqlite -Isqlite/py3 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c sqlite/sqlite3.c -o build/temp.macosx-10.13-intel-2.7/sqlite/sqlite3.o -w
sqlite/py3/row.c:169:8: error: unknown type name 'Py_hash_t'
static Py_hash_t pysqlite_row_hash(pysqlite_Row *self)

because the wrong version of sqlite is used (note the py3 subfolder).

BoPeng commented 6 years ago

I can confirm that I have made the master branch python 3 only before we fork to v3 (https://github.com/vatlab/VariantTools/commit/7755a51204204d3628cee55dabe07f74c89cf07a). It is strange that that I could not find a python2.7 branch though.

So the right way to get the python2.7 version is to install it with pip.