Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6879 Discussions

Setting environmental variables for MKL in Ubuntu

Zichao_P_
Beginner
269 Views

I am now studying to use Intel Fortran compiler in Linux. My operation system is Ubuntu 12.04.

I followed the install procedures in the documents. Now, the command "ifort" runs well. However, when I attempt to link the source file with MKL, errors can be found.

According to the documents, I've already added the following in the ~/.profile

./opt/intel/composer_xe_2013_sp1.1.106/mkl/bin/intel64/mklvars_intel64.sh intel64 mod lp64

After that, I tried to link the examples with MKL. For example, the source file "zgemvx.f" in the examples_core/blas/source. I used the following command

ifort zgemvx.f -mkl

However, it says "undefined reference to 'printvectorz_'"

So I think I still have not yet configured the MKL well.

What can I do now?

Thanks!

0 Kudos
1 Solution
mecej4
Black Belt
269 Views

The undefined reference is not to be found in the MKL libraries, but is contained (along with other service routines) in the file common_func.f, which is either in the .../mkl/examples/blas/source directory (if you have extracted the tar/zip file with the examples), or is contained in the zip/tgz file with all the MKL examples. Try

[bash]ifort -mkl zgemvx.f common_func.f[/bash]

or use the provided makefile.

View solution in original post

0 Kudos
2 Replies
TimP
Black Belt
269 Views

You may not have set the command correctly in your .profile.  ". space" is synonymous with "source ".  If you use the . notation, the space is mandatory.

If you source the corresponding compilervars.sh intel64 script, it will take care of setting up the MKL if it is installed by the compiler install script.

0 Kudos
mecej4
Black Belt
270 Views

The undefined reference is not to be found in the MKL libraries, but is contained (along with other service routines) in the file common_func.f, which is either in the .../mkl/examples/blas/source directory (if you have extracted the tar/zip file with the examples), or is contained in the zip/tgz file with all the MKL examples. Try

[bash]ifort -mkl zgemvx.f common_func.f[/bash]

or use the provided makefile.

0 Kudos
Reply