Community
cancel
Showing results for 
Search instead for 
Did you mean: 
427 Views

Build Python 3.7 with Intel compilers on CentOS 7

Hi.

I'm trying to build Python 3.7 on CentOS 7 with Intel compilers. I'm using version 2018 of the compiler.

To compile I do the following:

export CC=icc
export CXX=icpc
export FC=ifort

./configure --prefix=my_prefix --enable-optimizations --without-gcc
make
make install

In the configure, no error is seen, but when I execute make, the following message is printed:

Running code to generate profile data (this can take a while):
# First, we need to create a clean build with profile generation
# enabled.
make profile-gen-stamp
make[1]: se ingresa al directorio `/home/python/source/Python-3.7.3'
Building with support for profile generation:
make build_all_generate_profile
make[2]: se ingresa al directorio `/home/python/source/Python-3.7.3'
make build_all CFLAGS_NODIST=" -prof-gen" LDFLAGS_NODIST=" -prof-gen" LIBS="-lcrypt -lpthread -ldl  -lutil"
make[3]: se ingresa al directorio `/home/python/source/Python-3.7.3'
icc -pthread -c -Wsign-compare -Wunreachable-code -DNDEBUG -g  -O3 -Wall    -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-cast-function-type -Werror=implicit-function-declaration -fp-model strict -prof-gen  -I. -I./Include    -DPy_BUILD_CORE -o Programs/python.o ./Programs/python.c
icc: command line warning #10006: ignoring unknown option '-Wno-cast-function-type'
In file included from ./Include/Python.h(75),
                 from ./Programs/python.c(3):
./Include/pyatomic.h(39): error: identifier "atomic_uintptr_t" is undefined
      atomic_uintptr_t _value;
      ^

compilation aborted for ./Programs/python.c (code 2)

I have searched but I can not find the solution to the error. Any ideas?

0 Kudos
7 Replies
Viet_H_Intel
Moderator
427 Views

Can you try the 2019 update 4 version?

427 Views

No. I do not know if I can have the version you told me. Still, would a new version fix the error?

JenniferJ
Moderator
427 Views

I don't know if this will help. But give it a try: https://blog.semicolonsoftware.de/compiling-python-numpy-and-scipy-with-intel-compilers-and-intel-mkl/ 

btw. using the latest compiler is always a good idea. you can download an eval copy to start with. 

Thanks,

Jennifer 

Basden__Alastair
Beginner
427 Views

I confirm that the problem exists with 2019 update 4...

And following the blog.semicolonsoftware.de link also leads to the same error.

Viet_H_Intel
Moderator
427 Views

Can you create a preprocessed file for python.c.

Basu__Sourish
Beginner
427 Views

I am having the same problem trying to compile python 3.7.4. Is there a solution? For me the make process fails quite early:

icc -pthread -c -Wsign-compare -Wunreachable-code -DNDEBUG -g  -O3 -Wall    -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-cast-function-type -Werror=implicit-function-declaration -fp-model strict -prof-gen  -I. -I./Include -I/discover/nobackup/projects/tm5var4d/packages/openssl/1.1.0h/include -I/discover/nobackup/projects/tm5var4d/packages/python3_prereqs/include  -fPIC -DPy_BUILD_CORE -o Programs/python.o ./Programs/python.c
icc: command line warning #10006: ignoring unknown option '-Wno-cast-function-type'
In file included from ./Include/Python.h(75),
                 from ./Programs/python.c(3):
./Include/pyatomic.h(39): error: identifier "atomic_uintptr_t" is undefined
      atomic_uintptr_t _value;
      ^

compilation aborted for ./Programs/python.c (code 2)

 

Viet_H_Intel
Moderator
427 Views

Can you provide us preprocessed file (by replacing -c with -E)? Make sure you are still able to compile the preprocessed file and see the same error by replacing python.c with python.i.

Reply