Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFails to compile with icc #269
Comments
|
The problem is in the source code If this is python dist source code, your options include
|
|
Apparently, variable-definition-in-loop was a feature added to the C language as part of the C99 standard. Whereas even the most modern version of So it looks like the fix for this will be to set the |
|
Probably will need something in a CMake file like: if(${CMAKE_C_COMPILER_ID} MATCHES "Intel")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
endif(${CMAKE_C_COMPILER_ID} MATCHES "Intel")Edit:Most of the relevant code was already in the main python-cmake-buildsystem/CMakeLists.txt Lines 410 to 428 in a1ce7c2 just had to go looking for it |
The intel C compiler [defaults to `-std=gnu98`](https://software.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-reference/top/compiler-reference/compiler-options/compiler-option-details/language-options/std-qstd.html#std-qstd_GUID-338F4C2A-560C-4338-8ACF-C4B022A7C865), which apparently causes problems with recent cpython source. Judging by the existing code in `CMakeLists.txt` and [this issue on the core cpython repo](python/cpython#568), somewhere around cpy3.6 cpython moved on to C99. This PR ensures that if intel compilers are being used on cpy>=3.6 source, the `-std=C99` flag will be added
I tried to build using Intel icc version 19.1.0.20191121 and the cmake succeeds to run:
But when I run
make, it fails:It looks like the icc compiler does not allow to define variables inside the for loop.
I don't know if icc is supported, but if not, then I would expect cmake to error out sooner. It might also be possible to fix the failures with a patch.