我在以下的$HOME/tpl/intel
安装intel编译器。当我编译一个简单的hello_omp.cpp
使用OpenMP启用明确链接intel icp openmp
#include <omp.h>
#include <iostream>
int main()
{
#pragma omp parallel
{
std::cout << "Hello World" << std::endl;
}
return 0;
}
我编译~/tpl/intel/bin/icpc -O3 -qopenmp hello_omp.cpp
但是当我跑我得到以下错误: ./a.out: error while loading shared libraries: libiomp5.so: cannot open shared object file: No such file or directory
。
我想在制作过程中明确链接intel编译器和相应的库,而不使用LD_LIBRARY_PATH
?
我想你可以用'ld'的'-rpath = dir'将一个额外的库搜索路径烧入你的可执行文件中。不张贴作为答案,因为我不确定。或者你可以添加路径到'/etc/ld.so.conf.d/thing.conf'并运行'ldconfig'来将icpc的库目录添加到你的系统库搜索路径中,如果你在Linux系统上或者那种也使用'ldconfig'的方式。 –