I was able to successfully build cython on Ubuntu 14.04 from source as explained in this SE question/answer Compiling cython From source with icc and I downloaded the source code from here - Cython source code download.
The command to compile cython is
CC=icc LINKCC=icc python3.4 setup.py build
I am enclosing the build log. It is STILL using gcc for linking. Here is a sample of build log.
It appears CC=icc LINKCC=icc does NOT seem to change the linker to icc. It is still using x86_64-linux-gnu-gcc. When I set the environmental variable LDFLAGS = -lirc the environmental variable is being passed to gcc and not to icc. Also when I put print statements in BuildExecutable.py they are not getting called.
icc -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /home/aswin/libPython/Cython-0.24/Cython/Plex/Scanners.c -o build/temp.linux-x86_64-3.4/home/aswin/libPython/Cython-0.24/Cython/Plex/Scanners.o
icc: command line warning #10006: ignoring unknown option '-fwrapv'
creating build/lib.linux-x86_64-3.4
creating build/lib.linux-x86_64-3.4/Cython
creating build/lib.linux-x86_64-3.4/Cython/Plex
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -lirc -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.4/home/aswin/libPython/Cython-0.24/Cython/Plex/Scanners.o -o build/lib.linux-x86_64-3.4/Cython/Plex/Scanners.cpython-34m.so
How do I fix it ?
You need to override the linker
by setting export LDSHARED="icc -shared". That generates the icc linker. Here is an example of the build log by typing
CC=icc python3.4 setup.py build_ext
Alternatively you can also do the same by typing
LDSHARED="icc -shared" CC=icc python3.4 setup.py build_ex
icc -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /home/a/libPython/Cython-0.24/Cython/Plex/Scanners.c -o build/temp.linux-x86_64-3.4/home/a/libPython/Cython-0.24/Cython/Plex/Scanners.o
icc: command line warning #10006: ignoring unknown option '-fwrapv'
creating build/lib.linux-x86_64-3.4
creating build/lib.linux-x86_64-3.4/Cython
creating build/lib.linux-x86_64-3.4/Cython/Plex
icc -shared -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.4/home/a/libPython/Cython-0.24/Cython/Plex/Scanners.o -o build/lib.linux-x86_64-3.4/Cython/Plex/Scanners.cpython-34m.so
cythoning /home/a/libPython/Cython-0.24/Cython/Plex/Actions.py to /home/a/libPython/Cython-0.24/Cython/Plex/Actions.c
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With