Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manylinux1 builds are failing because of C99 usage in special/_cosine.c #13840

Closed
rgommers opened this issue Apr 11, 2021 · 0 comments · Fixed by #13841
Closed

manylinux1 builds are failing because of C99 usage in special/_cosine.c #13840

rgommers opened this issue Apr 11, 2021 · 0 comments · Fixed by #13841
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.special
Milestone

Comments

@rgommers
Copy link
Member

Example build log from scipy-wheels CI: link

Should be fixed either by passing in the -std=c99 flag correctly, using the _c99compat.h include, or dropping manylinux1. Will have a look at that now.

error: Command "gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wl,-strip-all -I/usr/local/include -fPIC -DHAVE_CBLAS -I/io/scipy/scipy/special -I/opt/python/cp37-cp37m/lib/python3.7/site-packages/numpy/core/include -I/opt/python/cp37-cp37m/include/python3.7m -Iscipy/_lib -Iscipy/_build_utils/src -I/opt/python/cp37-cp37m/lib/python3.7/site-packages/numpy/core/include -I/opt/python/cp37-cp37m/lib/python3.7/site-packages/numpy/core/include -I/opt/python/cp37-cp37m/lib/python3.7/site-packages/numpy/core/include -I/opt/python/cp37-cp37m/include/python3.7m -c scipy/special/_cosine.c -o build/temp.linux-x86_64-3.7/scipy/special/_cosine.o -MMD -MF build/temp.linux-x86_64-3.7/scipy/special/_cosine.o.d" failed with exit status 1
In file included from /opt/python/cp37-cp37m/include/python3.7m/Python.h:8:0,
                 from /opt/python/cp37-cp37m/lib/python3.7/site-packages/numpy/core/include/numpy/npy_common.h:11,
                 from scipy/special/cephes/polevl.h:65,
                 from scipy/special/_cosine.c:20:
/opt/python/cp37-cp37m/include/python3.7m/pyconfig.h:1526:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
 #define _POSIX_C_SOURCE 200809L
 ^
In file included from /usr/include/stdio.h:28:0,
                 from scipy/special/_cosine.c:17:
/usr/include/features.h:198:0: note: this is the location of the previous definition
 #  define _POSIX_C_SOURCE 200112L
 ^
scipy/special/_cosine.c: In function ‘_poly_approx’:
scipy/special/_cosine.c:207:12: warning: unused variable ‘px’ [-Wunused-variable]
     double px;
            ^
scipy/special/_cosine.c: In function ‘cosine_invcdf’:
scipy/special/_cosine.c:237:16: error: ‘NAN’ undeclared (first use in this function)
         return NAN;
                ^
scipy/special/_cosine.c:237:16: note: each undeclared identifier is reported only once for each function it appears in
In file included from /opt/python/cp37-cp37m/include/python3.7m/Python.h:8:0,
                 from /opt/python/cp37-cp37m/lib/python3.7/site-packages/numpy/core/include/numpy/npy_common.h:11,
                 from scipy/special/cephes/polevl.h:65,
                 from scipy/special/_cosine.c:20:
/opt/python/cp37-cp37m/include/python3.7m/pyconfig.h:1526:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
 #define _POSIX_C_SOURCE 200809L
 ^
In file included from /usr/include/stdio.h:28:0,
                 from scipy/special/_cosine.c:17:
/usr/include/features.h:198:0: note: this is the location of the previous definition
 #  define _POSIX_C_SOURCE 200112L
 ^
scipy/special/_cosine.c: In function ‘_poly_approx’:
scipy/special/_cosine.c:207:12: warning: unused variable ‘px’ [-Wunused-variable]
     double px;
            ^
scipy/special/_cosine.c: In function ‘cosine_invcdf’:
scipy/special/_cosine.c:237:16: error: ‘NAN’ undeclared (first use in this function)
         return NAN;
                ^
scipy/special/_cosine.c:237:16: note: each undeclared identifier is reported only once for each function it appears in
@rgommers rgommers added defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.special labels Apr 11, 2021
rgommers added a commit to rgommers/scipy that referenced this issue Apr 11, 2021
This fixes the manylinux1 builds. Closes scipygh-13840

Also clean up an outdated try-catch.
rgommers added a commit that referenced this issue Apr 12, 2021
…13841)

* BLD: add `-std=c99` flag to scipy.special extension using cosine.c

This fixes the manylinux1 builds. Closes gh-13840

Also clean up an outdated try-catch.

* MAINT: another `special/_cosine.c` fix: define M_PI

`M_PI` is not defined in C, but available by default in GCC.
However, compiling with `-std=c99` makes the symbol unavailable.
@tylerjereddy tylerjereddy added this to the 1.7.0 milestone Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.special
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants