From fb041fe844074d2556cfc350b52f5742bfb866b3 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Sun, 12 Apr 2020 15:26:37 +0100 Subject: Configure (numpy): added --std=c99 to CFLAGS to fix error Elham Saremi recently reported the following errors when building Numpy in numpy/core/src/npysort/radixsort.c.src: "error: 'for' loop initial declarations are only allowed in C99 or C11 mode". After some searching, I found Issue 14147[1] on Numpy's main repository about the same problem. As described there, apparently Numpy needs C99 compiler, but doesn't check for it or set it manually (for some strange reason, leaving it to the packagers to check if they want!!!). Any way, after a check with Elham, we were able to fix it by adding the `--std=c99' to CFLAGS of Numpy's build and with this commit, it is now being implemented in the core Maneage to not cause a problem in any other project. [1] https://github.com/numpy/numpy/issues/14147 --- reproduce/software/make/python.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/reproduce/software/make/python.mk b/reproduce/software/make/python.mk index 9c79abc..a15841c 100644 --- a/reproduce/software/make/python.mk +++ b/reproduce/software/make/python.mk @@ -599,6 +599,7 @@ $(ipydir)/numpy: $(ibidir)/unzip \ else \ export LDFLAGS="$(LDFLAGS) -shared"; \ fi; \ + export CFLAGS="--std=c99 $$CFLAGS"; \ conf="$$(pwd)/reproduce/software/config/installation/numpy-scipy.cfg"; \ $(call pybuild, unzip, numpy-$(numpy-version),$$conf, \ Numpy $(numpy-version)) \ -- cgit v1.2.1