icc 编译代码无法加载共享对象 (libimf.so) [英] icc compiled code unable to load shared object (libimf.so)

查看:47
本文介绍了icc 编译代码无法加载共享对象 (libimf.so)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用 icc(在 ubuntu 下)编译 cpp 代码:

I'm compiling a cpp code with icc (under ubuntu):

icc -I/usr/share/R/include -I/~/Desktop/work/p1/geqw4/vi3/out/sp/ccode/eigen -fpic -O2 -pipe -c -DEIGEN_NO_DEBUG aha.cpp -o aha.o

icc -shared -o aha.so aha.o -L/usr/local/lib/R/site -Wl,-rpath,/usr/local/lib/R/site -L/usr/lib64/R/lib -lR

它可以编译,但在运行可执行文件时我得到:

it compiles, but upon running the executable i get:

unable to load shared object '~/Desktop/work/p1/geqw4/vi3/out/sp/ccode/simcode/mine2/aha.so':
  libimf.so: cannot open shared object file: No such file or directory

libimf.so 位于/opt/intel/lib/intel64 中.我记得遇到了同样的问题上次我使用 icc (一年前),但我不记得解决方案是什么.

libimf.so is in /opt/intel/lib/intel64. I remember running unto the same problem the last time i used icc (a year ago) but i don't recall what the solution was.

推荐答案

好的解决了;

为了将来的记录(我每年使用 icc 一次,如果很多的话):

for future record (i use icc once a year, if that much):

gedit ~/.bashrc

然后

LD_LIBRARY_PATH=/opt/intel/lib/intel64
export LD_LIBRARY_PATH

然后,从 ~/目录执行:

then, from the ~/ directory do:

source .bashrc

这篇关于icc 编译代码无法加载共享对象 (libimf.so)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆