c++中未定义的MKL傅立叶变换的引用
c++ undefined reference to MKL fourier Transform
我是数学内核库的新手,我在对矩阵的一维编译非常简单的FFT操作时遇到了问题。我知道这个问题是关于链接的,它不是mkl所特有的。
MKL_Complex16 a[4];
MKL_Complex16 a_fft[4];
DFTI_DESCRIPTOR_HANDLE dft_descriptor_handle_kx;
MKL_LONG status_kx, l;
l=4;
status_kx = DftiCreateDescriptor(&dft_descriptor_handle_kx, DFTI_DOUBLE, DFTI_COMPLEX, 1, l);
status_kx = DftiSetValue(dft_descriptor_handle_kx, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
status_kx = DftiCommitDescriptor(dft_descriptor_handle_kx);
status_kx = DftiComputeBackward(dft_descriptor_handle_kx, a, a_fft);
status_kx = DftiFreeDescriptor(&dft_descriptor_handle_kx);
和我收到这个错误消息:
/tmp/icpcxXraKo.o: In function `main':
testing.cpp:(.text+0x47): undefined reference to `DftiCreateDescriptor_d_1d'
testing.cpp:(.text+0x60): undefined reference to `DftiSetValue'
testing.cpp:(.text+0x6d): undefined reference to `DftiCommitDescriptor'
testing.cpp:(.text+0x85): undefined reference to `DftiComputeBackward'
testing.cpp:(.text+0x92): undefined reference to `DftiFreeDescriptor'
如果你能帮我解决这个问题,我将非常高兴。
您的构建命令应该看起来像这样:
g++ -v -m64
-I/opt/intel/mkl/include -I/home/…/include -g -O2 -O2 -o exp_1.exe exp_1.cc
-L/opt/intel/composerxe/lib/intel64
-L/opt/intel/mkl/lib/intel64
-lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -liomp5 -ldl -lpthread -Wl,--verbose
具体来说,"-L"应该指向你的MKL库目录,你需要一个"-L"来指向你需要链接的每个库。
语法将根据您的a)应用程序,b)操作系统和c)编译器而有所不同。
您可以在这里找到您的平台的文档:
- https://software.intel.com/en-us/intel-mkl
相关文章:
- 将对象数组的引用传递给函数
- 什么时候在C++中返回常量引用是个好主意
- 我想将一个对T类型的非常量左值引用绑定到一个T类型的临时值
- 何时在引用或唯一指针上使用移动语义
- 如何在c++中使用引用实现类似python的行为
- 编译C++时未定义的引用
- Ctypes wstring通过引用传递
- c++r值引用应用于函数指针
- 理解c++中的引用
- C++取消引用指针.为什么会发生变化
- 如何修复此错误:未定义对"距离(浮点数,浮点数,浮点数,浮点数,浮点数)"的引用
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- C++Boost Asio Pool线程,带有lambda函数和传递引用变量
- 强制转换为引用类型
- 引用一个已擦除类型(void*)的指针
- 向量元素的引用地址与它所指向的向量元素的地址不同.为什么
- 具有默认值的引用获取函数
- 如何使用基类指针引用派生类成员
- 使用取消引用的指针的多态性会产生意外的结果.为什么?
- c++中未定义的MKL傅立叶变换的引用