Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
7779 Discussions

Can't link MKL with -static-intel after update to 2013update1

kangshiyin
Beginner
222 Views

Hi,

I can compile and link my program correctly with version 2011_sp1_update3, but failed with version 2013_update1.

My program contains only 2 .cpp files, and generated by following 3 commands.

icpc -O3 -inline-level=2 -parallel -ipp=common -mkl=parallel -I/opt/intel/ipp/include -ansi-alias -Wcheck -openmp-report2 -par_report1 -vec-report1 -Wstrict-aliasing -MMD -MP -MF"src/KTiming.d" -MT"src/KTiming.d" -c -o "src/KTiming.o" "../src/KTiming.cpp"

icpc -O3 -inline-level=2 -parallel -ipp=common -mkl=parallel -I/opt/intel/ipp/include -ansi-alias -Wcheck -openmp-report2 -par_report1 -vec-report1 -Wstrict-aliasing -MMD -MP -MF"src/smlab-bbrbm-sp.d" -MT"src/smlab-bbrbm-sp.d" -c -o "src/smlab-bbrbm-sp.o" "../src/smlab-bbrbm-sp.cpp"

icpc -parallel -ipp=common -mkl=parallel -O3 -static-intel -o "smlab-bbrbm-sp"  ./src/KTiming.o ./src/smlab-bbrbm-sp.o

When using 2011_sp1_up3, everything is fine. When using 2013, the last link command fails unless I remove the option '-static-intel'.

I use non-commercial license. The OS is CentOS 6.3.

Is this a bug? Is there a way I can link MKL statically?

Thanks!

0 Kudos
3 Replies
TimP
Black Belt
222 Views
The link advisor posted on the MKL forum accepts requests for command line usage including static linking (except for libiomp5). As far as I know, it was never controlled by -static-intel. The -mkl option, as far as I know, supports only dynamic linking, so you need to use the link advisor for the static linking advice. If you wish more expert confirmation, the MKL forum is the place.
kangshiyin
Beginner
222 Views
Thanks! I thought -mkl will do everything for me automatically, just as the old version. I will try mkl link advisor then.
Martyn_C_Intel
Employee
222 Views

You should be able to link statically by moving the -mkl switch after your source and object files.

See http://software.intel.com/en-us/articles/static-linking-with-mkl-ipp-or-tbb-may-give-unresolved-references

We'll look into making this unnecessary.

Reply