【发布时间】:2017-08-27 21:49:14
【问题描述】:
我在以下$HOME/tpl/intel 安装了英特尔编译器。当我在启用 openMP 的情况下编译一个简单的 hello_omp.cpp 时
#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.
我想在制作过程中显式链接英特尔编译器和相应的库,而不使用LD_LIBRARY_PATH?
【问题讨论】:
-
我认为您可以使用
ld的-rpath=dir将额外的库搜索路径烘焙到您的可执行文件中。不发布作为答案,因为我不确定。或者你可以添加/etc/ld.so.conf.d/something.conf的路径并运行ldconfig以将icpc 的库目录添加到你的系统库搜索路径,如果你在Linux 系统上或同样使用ldconfig的系统上。跨度>
标签: c++ openmp intel icc scientific-computing