0

This is the configuration of QT project:

    unix {
    INCLUDEPATH += /opt/intel/mkl/include
    LIBS += -L/opt/intel/mkl/lib/intel64 \
    -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_def \
    -liomp5 -lpthread -ldl -lm
    }

And the errors is intel-mkl-link-error

I hve linked the -lm flag, why?

UPDATED:

   ubuntu@ubuntu-desktop:/opt/intel/mkl/tools$ ./mkl_link_tool -check_mkl_presence

   Intel(R) Math Kernel Library (Intel(R) MKL) Link Tool v4.0
   ==========================================================

   Unknown mode. Specify -libs, -opts, -env or compilation line

   Configuration
   =============

   MKL version:            11.1
   OS:                     lnx
   Architecture:           intel64
   Compiler:               intel_f
   Linking:                dynamic
   Interface layer:        lp64
   Parallel:               yes
   OpenMP library:         iomp5

   ubuntu@ubuntu-desktop:/opt/intel/mkl/tools$ ./mkl_link_tool -check_mkl_presence -libs -opts -env

   Intel(R) Math Kernel Library (Intel(R) MKL) Link Tool v4.0
   ==========================================================

   Output
   ======

   Compiler option(s):
   -I/opt/intel/composer_xe_2013_sp1.0.080/mkl/include

   Linking line:
   -L/opt/intel/composer_xe_2013_sp1.0.080/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -openmp -lpthread -lm

   Environment variable(s):
   export LD_LIBRARY_PATH=/opt/intel/composer_xe_2013_sp1.0.080/mkl/../compiler/lib/intel64:/opt/intel/composer_xe_2013_sp1.0.080/mkl/lib/intel64:$LD_LIBRARY_PATH;

   ubuntu@ubuntu-desktop:/opt/intel/mkl/tools$ 

UPDATED2:

    ubuntu@ubuntu-desktop:/opt/intel/mkl/lib/intel64$ ldd libmkl_core.so 
    linux-vdso.so.1 =>  (0x00007fff2b589000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe268d8d000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe2689ce000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fe26a50c000)
    ubuntu@ubuntu-desktop:/opt/intel/mkl/lib/intel64$ 

I have used the ldd command to see what libraries are needed by libmkl_core.so, it doesn't show the libm.so or math library. Why In the Qt creator, it shows undefined reference to 'logf'?

mining
  • 3,557
  • 5
  • 39
  • 66
  • You could add more related and popular tags like `c++` `qt`. Otherwise no one except for who follows `intel-mkl` will see your questions. That's how StackOverflow works. – kangshiyin Oct 05 '13 at 07:04
  • Another suggestion is try to provide the low level `gcc` compile and link command line generated by your IDE. That will give more info. – kangshiyin Oct 05 '13 at 07:07

1 Answers1

1

Besides the Intel MKL link line advisor which helps you generate the correct compile and link options for gcc/icc compiler, there's another pre-request you may have to pay attention to -- setting the environment variables.

In order to use MKL, you need to set some environment variables properly. Intel has provided a script to easy this setup. You could add one line to your shell profile like .bash_profile. Please read through the getting started section of MKL doc for more details.

http://software.intel.com/en-us/node/438542

kangshiyin
  • 9,681
  • 1
  • 17
  • 29
  • Thanks, Eric. I have updated my question, and it shows some more useful information about how to link the MKL libraries. Please check it. It still have some errors although I have linked as it says. – mining Oct 05 '13 at 08:01
  • Have you checked if you have libm.so or libm.a installed in your system? – kangshiyin Oct 05 '13 at 08:11
  • Eric, I have updated the question by `UPDATED2`, please check it. Thanks. – mining Oct 05 '13 at 08:11
  • I think you could ask QT people the question about how to build program with custom libraries in your IDE qt creator, instead of asking MKL people about how to link MKL. – kangshiyin Oct 05 '13 at 08:21
  • Hi, Eric, I have solved the problem. I change the QT Project to use Intel icc compiler instead of gcc. It works. – mining Oct 05 '13 at 12:11
  • Cong. My project usually use MKL with gcc. – kangshiyin Oct 05 '13 at 12:14