[Numpy-discussion] NumPy distutils limitation?

Francesc Alted faltet@pytables....
Fri Jan 30 14:30:59 CST 2009


Gregor and I are trying to give support for Intel's VML (Vector
Mathematical Library) in numexpr.  For this, we are trying to make use
of the weaponery in NumPy's distutils so as to be able to discover
where the MKL (the package that contains VML) is located.  The
libraries that we need to link with are: mkl_gf_lp64, mkl_gnu_thread,
mkl_core *and* iomp5 (Intel's OpenMP library).

The problem is that I have installed MKL as part as the Intel compiler
for Unix.  In this setup, most of the libraries are in one place,


However, the OpenMP library is in another directory:


So, I need to specify *two* directories to get the complete set of
libraries.  My first attempt was setting a site.cfg like:

#libraries = gfortran

library_dirs= /opt/intel/Compiler/11.0/074/mkl/lib/em64t/:/opt/intel/Compiler/11.0/074/lib/intel64
include_dirs =  /opt/intel/Compiler/11.0/074/mkl/include/
mkl_libs = mkl_gf_lp64, mkl_gnu_thread, mkl_core, iomp5

Unfortunately, distutils complains and says that it cannot find the
complete set of libraries:

  libraries mkl_gf_lp64,mkl_gnu_thread,mkl_core,iomp5 not found 
in /opt/intel/Compiler/11.0/074/mkl/lib/em64t/
  libraries mkl_gf_lp64,mkl_gnu_thread,mkl_core,iomp5 not found 
in /opt/intel/Compiler/11.0/074/lib/intel64

After some debugging of the problem, it seems that distutils needs to
find *all* the required libraries in *one* single directory.  As iomp5
is on a different directory, distutils thinks that the requisites
are not fulfilled.

I've solved this by requering the iomp5 to be find in the DEFAULT
section.  Something like:

library_dirs = /opt/intel/Compiler/11.0/074/lib/intel64
#libraries = gfortran, iomp5
libraries = iomp5

library_dirs = /opt/intel/Compiler/11.0/074/mkl/lib/em64t/
include_dirs =  /opt/intel/Compiler/11.0/074/mkl/include/
mkl_libs = mkl_gf_lp64, mkl_gnu_thread, mkl_core

However, in case one would need to specify several other directories
in the DEFAULT section for finding other hypothetical necessary
libraries (like gfortran or others), we may run into the same problem 
than above.

My question is, is there an elegant way to handle this problem, or it
is a limitation of the current distutils?  If the later, it would be
nice it that could be solved in a future version, and several libraries 
can be found in *several* directories.


Francesc Alted

More information about the Numpy-discussion mailing list