Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
6590 Discussions

Unable to build scipy with mkl on ubuntu 12.04


I am trying to build numpy and scipy on 64-bit Ubuntu 12.04 with Intel MKL.

I have installed all the prerequisites. The INTEL C++ complier and the Fortran compiler verision are all 2011 sp1 10.319 and MKL is the version within it.

I am following the installation instruction fromINTEL's website.

I have successfully build and installed numpy.

When building scipy I encounted the problem as follows:

error: could note create '/usr/local/lib/python2.7/dist-packages/scipy': Permission denied

when I try to put sudo in front of the install line, I got:

numpy.distutils.fcompiler.CompilerNotFound: intelem: f90 nor f77

Could anyone help me?


0 Kudos
7 Replies
Hi Aurora1625,

Do you mean you got the error at the step with the command

Compile and install SciPy with the Intel Compilers: (On 64-bit platforms replace "intel" with "intelem")

sodu $pythonsetup.pyconfig--compiler=intel--fcompiler=intelbuild_clib--compiler=intel--fcompiler=intelbuild_ext--compiler=intel--fcompiler=intelinstall

Best Regards,

Can you also find the Intel Fotran compiler in your PATH?

Hey I have the same issue: I am trying to install Numpy/Scipy with the instructions given on this webpage: . So the site.cfg file and the files have been modified according to the specifications given by the webpage. I encounter the same issue on installing Numpy and Scipy: When installing Numpy with the command given: sudo python config --compiler=intelem build_clib --compiler=intelem build_ext --compiler=intelem install the installation process seams to work well until this error shows up: creating /usr/local/lib/python2.7/dist-packages/numpy error: could not create '/usr/local/lib/python2.7/dist-packages/numpy': Permission denied So I passed the command as a super user: sudo python config --compiler=intelem build_clib --compiler=intelem build_ext --compiler=intelem install but now there is another error: compile options: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/include -I/usr/include/python2.7 -c' icc: _configtest.c sh: 1: icc: not found sh: 1: icc: not found failure. removing: _configtest.c _configtest.o Traceback (most recent call last): File "", line 214, in setup_package() File "", line 207, in setup_package configuration=configuration ) File "/home/pierre/Téléchargements/numpy-1.6.2/numpy/distutils/", line 186, in setup return old_setup(**new_attr) File "/usr/lib/python2.7/distutils/", line 152, in setup dist.run_commands() File "/usr/lib/python2.7/distutils/", line 953, in run_commands self.run_command(cmd) File "/usr/lib/python2.7/distutils/", line 972, in run_command File "/home/pierre/Téléchargements/numpy-1.6.2/numpy/distutils/command/", line 62, in run self.run_command('build_src') File "/usr/lib/python2.7/distutils/", line 326, in run_command self.distribution.run_command(command) File "/usr/lib/python2.7/distutils/", line 972, in run_command File "/home/pierre/Téléchargements/numpy-1.6.2/numpy/distutils/command/", line 152, in run self.build_sources() File "/home/pierre/Téléchargements/numpy-1.6.2/numpy/distutils/command/", line 163, in build_sources self.build_library_sources(*libname_info) File "/home/pierre/Téléchargements/numpy-1.6.2/numpy/distutils/command/", line 298, in build_library_sources sources = self.generate_sources(sources, (lib_name, build_info)) File "/home/pierre/Téléchargements/numpy-1.6.2/numpy/distutils/command/", line 385, in generate_sources source = func(extension, build_dir) File "numpy/core/", line 696, in get_mathlib_info raise RuntimeError("Broken toolchain: cannot link a simple C program") RuntimeError: Broken toolchain: cannot link a simple C program Note that this output indicates that icc cannot be found, but it is well installed on the computer and in the PATH environment variable and without the super user things seems to compile... The same issue comes up with scipy, the files cannot be copied to /usr/local/lib/python2.7/dist-packages/ (I guess this is what the sciprt intend to do) because of denied permission. But when I pass the install command in super user mode I get this error: numpy.distutils.fcompiler.CompilerNotFound: intelem: f90 nor f77 Though icc and ifort is installed, and in use, because when I execute the install command as normal user I can see everything compiling! It seems that everything is compiled and ready to use but when the installed script tries to copy the compiled files to the shared python modules in /usr/local/lib/python2.7/dist-packages/ it needs super user permission. And apparently when running the command as super user the compilers can't be no longer found. System decription: HP Z800 workstation with Intel® Xeon(R) CPU X5675 @ 3.07GHz × 12 Running on Ubuntu 12.04 icc -> composer_xe_2011_sp1.10.319 ifort -> composer_xe_2011_sp1.9.293 MKL -> composer_xe_2011_sp1.11.339 Running the command ifort and icc show that they are indeed installed. I am ready to give you any information you need about the system used if you need it! Thank you for your help! Regards, Pierre
HI Pierre, I saw you have shared some comments under the article is the problem resolved by yourself? Best Regards, Ying

On Xubuntu 12.10, this issue is solved by linking ifort and icc in /usr/bin. Apparently, as @Pierre noticed, these files can't be found by the root account when you do "sudo python config ..." since they're usually installed to /opt. But the root account does look at /usr/bin, so put the links there. 

Black Belt

As your sudo command opens a new shell, you would need to set the same compiler environment in that shell as in your user shell, in order to build normally.



I summarize the issue here so more users may clear about the problem: 

The error "Permission denied" because non-super user.  if use 
>sudo python config --compiler=intelem build_clib --compiler=intelem build_ext --compiler=intelem install

icc/ifort environment can be set up  because sudo don't recognize the 'source source /opt/intel/composer_xe_2013_sp1.2.144/bin/ intel64". 

So user can use root to build the numpy and scipy if possible. 

Or either Pierre's solution 

cipy should be done in two steps:
First to build (with intelem instead of intel for 64 bits processors):
python config --compiler=intel build_clib --compiler=intel build_ext --compiler=intel
Then install:
sudo python install

Same for Scipy.

or Ethan's solution: 

inking ifort and icc in /usr/bin

Best Regards,