Domanda

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'?

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top