G++ does not recognize -mkl=parallel


I’m trying my first build of PSI4 on my cluster and everything seems to compile ok but at the link phase it errors out with:

Linking CXX executable …/…/…/bin/psi4
g++: error: unrecognized command line option ‘-mkl=parallel’

I’m using g++ version 4.7.2.

any advice would be appreciated,

-Kirk Peterson


the configuration options are usually “–mkl parallel”, with two dashes,

hope this helped


Dear Kirk,
the -mkl=parallel option is only valid for the Intel compilers suite.
You can of course link against MKL also when using the GCC compilers suite.
The link line will be generated accordingly by the CMake macros that handle BLAS/LAPACK discovery.

umm, my setup command was:
setup --cc gcc --cxx g++ --fc ifort --max-am-eri 8 --mkl parallel --chemps2 off --pcmsolver off

I tried not giving the mkl an argument but the script forces a choice. So perhaps I need to massage the automatically generated Makefile before linking? If so, do I have to mess with CMake stuff or just the Makefile?

Hi again,
given that the linker language is C++ the option given to the --mkl flag will not be recognized by the compiler
and hence you will always see a failure.
This setup command should work:

./setup --cc gcc --cxx g++ --fc ifort --chemps2 off --pcmsolver off --max-am-eri 8

This will hopefully discover the right installation of MKL and generate the right link line.

Note that the Fortran compiler will only be used to compile the DKH integrals sources. If you plan not to use that part of the code you can avoid selecting a Fortran compiler altogether.



So is there an internal mechanism in the configure script that will automatically find mkl or is there an environment variable I should perhaps set before running setup?

A little off-topic, but I’m thinking this problem is a bug in setup but perhaps I was supposed to know that I should only use --mkl parallel if I’m using the Intel C compiler and not gcc?

thanks much, -Kirk

Ok, since I already had the environment variable MATH_ROOT set to the location of the mkl libraries from another program’s build requirements (Dirac?), the PSI4 installing found my mkl. Starting the long compile again now…

thanks, -Kirk

Just to close this thread, the automatic mechanism for finding my mkl libraries does work if the MATH_ROOT environment variable is set. The program successfully compiled and linked.