Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Makefile 与2个图书馆链接_Makefile_Linker_Fortran_Shared Libraries_Intel - Fatal编程技术网

Makefile 与2个图书馆链接

Makefile 与2个图书馆链接,makefile,linker,fortran,shared-libraries,intel,Makefile,Linker,Fortran,Shared Libraries,Intel,我正试图通过以下方式将一个程序与两个库链接: LNOPT = -Wl,-rpath,$(MKLROOT)/lib/intel64 -Wl,-rpath,/opt/intel/compilers_and_libraries_2019.0.117/linux/compiler/lib/intel64_lin 但是,我可能会遇到以下错误之一: ./dftb+: error while loading shared libraries: libmkl_gf_lp64.so: cannot open

我正试图通过以下方式将一个程序与两个库链接:

LNOPT = -Wl,-rpath,$(MKLROOT)/lib/intel64  -Wl,-rpath,/opt/intel/compilers_and_libraries_2019.0.117/linux/compiler/lib/intel64_lin
但是,我可能会遇到以下错误之一:

./dftb+: error while loading shared libraries: libmkl_gf_lp64.so: cannot open shared object file: No such file or directory

./dftb+: error while loading shared libraries: libiomp5.so: cannot open shared object file: No such file or directory
取决于我放在第一位的-rpath。如何解决此问题?

是否在运行时将两条路径(由
分隔)都放在环境变量
LD\u LIBRARY\u PATH
中作为一个选项?(这样,硬编码的rpath就不必工作了。) 例如:

或者将
export LD_LIBRARY_PATH=$(MKLROOT)/lib/intel64:/opt/intel/compilers_和_libraries_2019.0.117/linux/compiler/lib/intel64_lin
放入某个配置文件
rc
中,以便始终设置库路径

在任何一种情况下,如果
LD\u LIBRARY\u PATH
中已经存在需要的其他路径,则通过
LD\u LIBRARY\u PATH=$(MKLROOT)/lib/intel64:/opt/intel/compilers\u and\u libraries\u 2019.0.117/linux/compiler/lib/intel64\u lin:$LD\u LIBRARY\u PATH
将上述路径添加到其中,而不是简单地完全重写
LD\u LIBRARY\u路径

还可以/应该起作用的是
source
ing英特尔编译器和MKL附带的环境变量setup
.sh
文件,其中包括MKLROOT等其他变量,应该设置指向
libiomp5的LD_LIBRARY_路径。因此
和动态MKL链接库。

正在放置这两个路径(由
分隔)在运行时环境变量
LD\u LIBRARY\u PATH
中有一个选项(这样,硬编码的rpath就不必工作) 例如:

或者将
export LD_LIBRARY_PATH=$(MKLROOT)/lib/intel64:/opt/intel/compilers_和_libraries_2019.0.117/linux/compiler/lib/intel64_lin
放入某个配置文件
rc
中,以便始终设置库路径

在任何一种情况下,如果
LD\u LIBRARY\u PATH
中已经存在需要的其他路径,则通过
LD\u LIBRARY\u PATH=$(MKLROOT)/lib/intel64:/opt/intel/compilers\u and\u libraries\u 2019.0.117/linux/compiler/lib/intel64\u lin:$LD\u LIBRARY\u PATH
将上述路径添加到其中,而不是简单地完全重写
LD\u LIBRARY\u路径

还可以/应该起作用的是
source
ing英特尔编译器和MKL附带的环境变量setup
.sh
文件,其中包括MKLROOT等其他变量,应该设置指向
libiomp5.so
和动态MKL链接库的LD_LIBRARY_路径

LD_LIBRARY_PATH=$(MKLROOT)/lib/intel64:/opt/intel/compilers_and_libraries_2019.0.117/linux/compiler/lib/intel64_lin ./dftb+