我想通过使用库编译一个简单的程序来测试我的MKL安装:
#include <iostream>
#include <mkl.h>
int main(void)
{
std::cout << "Hello World\n";
return 0;
}
现在通过使用MKL Link Line Advisor,我得到以下编译行:
g++ -DMKL_ILP64 -m64 -I${MKLROOT}/include test.cpp -L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_intel_ilp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl -o test
使用GCC-6.3.0并将MKLROOT
设置为正确的路径。但是在编译时,我得到了
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so: error: undefined reference to 'fopen'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so: error: undefined reference to 'fflush'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so: error: undefined reference to 'free'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_intel_ilp64.so: error: undefined reference to 'exit'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_intel_ilp64.so: error: undefined reference to 'memset'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so: error: undefined reference to 'strcasecmp'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so: error: undefined reference to 'fclose'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so: error: undefined reference to 'syscall'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so: error: undefined reference to 'strtol'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so: error: undefined reference to 'malloc'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so: error: undefined reference to 'strcmp'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'calloc'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'getenv'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'fwrite'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to '__ctype_b_loc'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'realloc'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'vfprintf'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'ceil'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'gettimeofday'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'strtoul'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'fopen64'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'strtod'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'stdout'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'sched_yield'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'mmap'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'fread'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'stderr'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'mprotect'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'qsort'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'munmap'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'getuid'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'vsnprintf'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'strchr'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'isspace'
/home/rolandar/local_opt/intel/mkl/lib/intel64/libmkl_core.so: error: undefined reference to 'strdup'
我的MKL装置坏了吗?或者我忘记了别的什么?
答案 0 :(得分:0)
答案 1 :(得分:0)
删除选项-ldl
时,它有效,但我没有解释,为什么。