natan
natan

Reputation: 31

Cygwin install scipy error on compilation

I am trying to install scipy under cygwin with pip, unfortunately I have some compilation errors! I attach log files. I have searched on web but have found nothing.

thanks

2023-02-11T17:48:15,190 [250/1620] Compiling C++ object scipy/special/_ufuncs_cxx.cpython-39-x86_64-cygwin.dll.p/_faddeeva.cxx.o

2023-02-11T17:48:15,191 FAILED: scipy/special/_ufuncs_cxx.cpython-39-x86_64-cygwin.dll.p/_faddeeva.cxx.o

2023-02-11T17:48:15,192 c++ -Iscipy/special/_ufuncs_cxx.cpython-39-x86_64-cygwin.dll.p -Iscipy/special -I../../scipy/special -I/tmp/pip-build-env-m1hcjhav/overlay/lib/python3.9/site-packages/numpy/core/include -I../../scipy/_lib/boost -Iscipy/_lib -I../../scipy/_lib -I../../scipy/_build_utils/src -I/usr/include/python3.9 -fvisibility=hidden -fvisibility-inlines-hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++14 -O2 -Wno-cpp -MD -MQ scipy/special/_ufuncs_cxx.cpython-39-x86_64-cygwin.dll.p/_faddeeva.cxx.o -MF scipy/special/_ufuncs_cxx.cpython-39-x86_64-cygwin.dll.p/_faddeeva.cxx.o.d -o scipy/special/_ufuncs_cxx.cpython-39-x86_64-cygwin.dll.p/_faddeeva.cxx.o -c ../../scipy/special/_faddeeva.cxx

2023-02-11T17:48:15,193 ../../scipy/special/_faddeeva.cxx: In function ‘npy_cdouble faddeeva_ndtr(npy_cdouble)’:

2023-02-11T17:48:15,194 ../../scipy/special/_faddeeva.cxx:79:10: error: ‘M_SQRT1_2’ was not declared in this scope; did you mean ‘NPY_SQRT1_2’?

2023-02-11T17:48:15,196 79 | z *= M_SQRT1_2;

2023-02-11T17:48:15,199 | ^~~~~~~~~

2023-02-11T17:48:15,200 | NPY_SQRT1_2

2023-02-11T17:48:15,201 ../../scipy/special/_faddeeva.cxx: In function ‘double faddeeva_log_ndtr(double)’:

2023-02-11T17:48:15,202 ../../scipy/special/_faddeeva.cxx:108:18: error: ‘M_SQRT1_2’ was not declared in this scope; did you mean ‘NPY_SQRT1_2’?

2023-02-11T17:48:15,203 108 | double t = x*M_SQRT1_2;

2023-02-11T17:48:15,204 | ^~~~~~~~~

2023-02-11T17:48:15,205 | NPY_SQRT1_2

2023-02-11T17:48:15,206 ../../scipy/special/_faddeeva.cxx: In function ‘npy_cdouble faddeeva_log_ndtr_complex(npy_cdouble)’:

2023-02-11T17:48:15,207 ../../scipy/special/_faddeeva.cxx:130:53: error: ‘M_SQRT1_2’ was not declared in this scope; did you mean ‘NPY_SQRT1_2’?

2023-02-11T17:48:15,208 130 | complex<double> w = -0.5 * Faddeeva::erfc(z*M_SQRT1_2);

2023-02-11T17:48:15,209 | ^~~~~~~~~

2023-02-11T17:48:15,210 | NPY_SQRT1_2

2023-02-11T17:48:15,211 ../../scipy/special/_faddeeva.cxx:136:11: error: ‘M_SQRT1_2’ was not declared in this scope; did you mean ‘NPY_SQRT1_2’?

2023-02-11T17:48:15,212 136 | z *= -M_SQRT1_2;

2023-02-11T17:48:15,218 | ^~~~~~~~~

2023-02-11T17:48:15,219 | NPY_SQRT1_2

2023-02-11T17:48:15,220 ../../scipy/special/_faddeeva.cxx:146:34: error: ‘M_PI’ was not declared in this scope

2023-02-11T17:48:15,221 146 | double im = fmod(mIm_z2, 2.0*M_PI);

2023-02-11T17:48:15,223 | ^~~~

2023-02-11T17:48:15,224 ../../scipy/special/_faddeeva.cxx: In function ‘double faddeeva_voigt_profile(double, double, double)’:

2023-02-11T17:48:15,225 ../../scipy/special/_faddeeva.cxx:177:24: error: ‘M_PI’ was not declared in this scope

2023-02-11T17:48:15,226 177 | return gamma / M_PI / (x*x + gamma*gamma);

2023-02-11T17:48:15,227 | ^~~~

I expect to find a solution to this compilation problem! Since I cannot intervene in the code, I don't have much room for action.

Upvotes: 0

Views: 170

Answers (1)

natan
natan

Reputation: 31

I spent a lot of time on install scipy but now I managed!

My configuration on Cygwin : python 3.9.16 python3-devel 3.9.10.1

from github install OpenBLAS git clone https://github.com/xianyi/OpenBLAS.git make; make install

then pip install scipy==1.9.3 (the last version 1.10.1 doesn't work! strange error: M_PI not definded in some step of cc compilation!?!?!)

and finally I installed Scipy!!!!

Another way (more clean): install python for windows, change PATH in .bashrc, put first the path /cygdrive/c/Users/myusername/AppData/Local/Programs/Python/Python311 in PATH variable)

Upvotes: 1

Related Questions