mattjj / pyhsmm

MIT License
548 stars 173 forks source link

gcc failed with exit status 1 #106

Closed Krozard closed 4 years ago

Krozard commented 4 years ago

Seems my system environment settigng have some problem that the gcc failed.. I was trying to run command 'python setup.py build_ext --inplace' as the interface module failed to load.

building 'pyhsmm.internals.hmm_messages_interface' extension C:\MinGW\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -Ideps/ -Ipyhsmm\internals -IC:\Users\ziyuanc\AppData\Local\Continuum\anaconda3\envs\bayes_course\include -IC:\Users\ziyuanc\AppData\Local\Continuum\anaconda3\envs\bayes_course\include -IC:\Users\ziyuanc\AppData\Roaming\Python\Python37\site-packages\numpy\core\include -c pyhsmm\internals\hmm_messages_interface.cpp -o build\temp.win-amd64-3.7\Release\pyhsmm\internals\hmm_messages_interface.o -std=c++11 -O3 -w -DNDEBUG -DHMM_TEMPS_ON_HEAP pyhsmm\internals\hmm_messages_interface.cpp:228:79: error: division by zero is not a constant expression 228 | enum { pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void)) }; | ^ pyhsmm\internals\hmm_messages_interface.cpp:228:41: error: '(1 / 0)' is not a constant expression 228 | enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void)) }; | ^~~~~~~~~ pyhsmm\internals\hmm_messages_interface.cpp:228:79: error: enumerator value for 'pyx_check_sizeof_voidp' is not an integer constant 228 | enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };

setup.py:40: UserWarning: Failed to build extension modules warn('Failed to build extension modules')

Krozard commented 4 years ago

for anyone might have similar problem, this is how I fixed it, first I uninstall mingw32 then I run conda install

conda install libpython conda install -c msys2 m2w64-toolchain

then I go to the pyhsmm folder and run pip install -e .

that works..