Closed dxma closed 5 years ago
Is this when using non-conda mingw-w64?
What does this give you
from Cython.Build.Inline import _get_build_extension
_get_build_extension().compiler
Hi,
Cheers,
If _get_build_extension().compiler
gives you mingw32, then it should add the correct extra_compile_args
for setup.
What does this give you platform.platform()
No, sorry, yes it is missing from misc.pyx. Let's fix it.
Thank you!
Final conclusion, for now I will stick with conda python on windows platform. Thanks again for your great work on porting stan to python!
I should take back the 1st point in previous post:
* Unfortunately this doesn't work properly while trying the simpliest logistic regression demo. The gcc command did make the dot o file but still returned -1 on command line. That triggered an endless loop of respawn sub-process.
This isn't true. The endless respawn is triggered from StanModel.sampling call, which executes in parallel using multiprocessing package. The forked child re-initialize the model object again. Passing n_jobs=1 to sampling() method works around this problem.
Did you try to run the code in if __name__ == "__main__"
or in jupyter?
I tried in 2 ways:
Summary:
Hi, the setup.py script needs a small fix in order to build pystan on Windows 7 x64 platform.
Extension("pystan._misc", ["pystan/_misc.pyx"], language='c++', extra_compile_args=extra_compile_args)
Description:
The misc.pyx extension raised an error like below:
D:/msys64/mingw64/include/c++/8.3.0/cmath:1121:11: error: '::hypot' has not been declared using ::hypot; ^~~~~
Reason is quite obvious, setup.py doesn't pass extra_compile_args to this extension building block, which contains intented flags for MingW64 platform.
Reproducible Steps:
D:\msys64\mingw64\bin
Current Output:
compile options: '-DMSVCRT_VERSION__=0x1914 -ID:\pyvenv\crushburn\include -IC: \Program Files\Python37\include -IC:\Program Files\Python37\include -c' gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DMSVCRT_VERSION=0x1 914 -ID:\pyvenv\crushburn\include -IC:\Program Files\Python37\include -IC:\Progr am Files\Python37\include -c pystan/_misc.cpp -o build\temp.win-amd64-3.7\Releas e\pystan_misc.o cc1plus.exe: warning: command line option '-Wstrict-prototypes' is valid for C/O bjC but not for C++ In file included from D:/msys64/mingw64/include/c++/8.3.0/math.h:36, from C:\Program Files\Python37\include/pyport.h:191, from C:\Program Files\Python37\include/Python.h:53, from pystan/_misc.cpp:17: D:/msys64/mingw64/include/c++/8.3.0/cmath:1121:11: error: '::hypot' has not been declared using ::hypot; ^~~~~ error: Command "gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DMSVC RT_VERSION__=0x1914 -ID:\pyvenv\crushburn\include -IC:\Program Files\Python37\in clude -IC:\Program Files\Python37\include -c pystan/_misc.cpp -o build\temp.win- amd64-3.7\Release\pystan_misc.o" failed with exit status 1
Expected Output:
compile options: '-DMSVCRT_VERSION=0x1914 -ID:\pyvenv\crushburn\include -IC: \Program Files\Python37\include -IC:\Program Files\Python37\include -c' extra options: '-Os -ftemplate-depth-256 -Wno-unused-function -Wno-uninitialized -std=c++11 -D_hypot=hypot -pthread -fexceptions' gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DMSVCRT_VERSION=0x1 914 -ID:\pyvenv\crushburn\include -IC:\Program Files\Python37\include -IC:\Progr am Files\Python37\include -c pystan/_misc.cpp -o build\temp.win-amd64-3.7\Releas e\pystan_misc.o -Os -ftemplate-depth-256 -Wno-unused-function -Wno-uninitialize d -std=c++11 -D_hypot=hypot -pthread -fexceptions cc1plus.exe: warning: command line option '-Wstrict-prototypes' is valid for C/O bjC but not for C++ g++ -g -shared build\temp.win-amd64-3.7\Release\pystan_misc.o -LD:\pyvenv\crush burn\libs -LC:\Program Files\Python37\libs -LC:\Program Files\Python37 -LD:\pyve nv\crushburn\PCbuild\amd64 -lpython37 -o build\lib.win-amd64-3.7\pystan_misc.cp 37-win_amd64.pyd
PyStan Version:
Python Version:
Operating System: