求助安装软件时出现cannot find l**错误,大侠该怎么解决啊?

编译安装或者制作Deb包
回复
mengdj
帖子: 4
注册时间: 2011-06-03 14:01
送出感谢: 0
接收感谢: 0

求助安装软件时出现cannot find l**错误,大侠该怎么解决啊?

#1

帖子 mengdj » 2011-06-03 14:18

小弟 在ubuntu10.10安装Madagascar(一款地球物理处理开源包,与su类似)时 出现了以下的错误:
首先执行,/configure后,环境检查结果如下:

checking for Python ... /usr/bin/python
checking Python version ... 2.6.6
checking for RSFROOT ... /home/mengdj/tools/RSF
checking for SCons ... /usr/bin/scons
checking SCons version ... v2.0.0.final.0.r5023
Running RSFROOT=/home/mengdj/tools/RSF /usr/bin/scons API=c++,f90 config ...
------------------------
scons: Reading SConscript files ...
checking platform ... (cached) linux [ubuntu]
checking for C compiler ... (cached) gcc
checking if gcc works ... yes
checking if gcc accepts '-std=gnu99 -Wall -pedantic' ... yes
checking if gcc accepts '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' ... yes
checking for ar ... (cached) ar
checking for libraries ... ['m']
checking complex support ... yes
checking for X11 headers ... /usr/include
checking for X11 libraries ... /usr/lib/X11
checking for OpenGL ... yes
checking for sfpen ... (cached) xtpen
checking for ppm ... yes
checking for tiff ... yes
checking for GD (PNG) ... yes
checking for GD (GIF) ... yes
checking for plplot ... yes
checking for ffmpeg ... yes
checking for cairo (PNG) ... yes
checking for cairo (SVG) ... yes
checking for cairo (PDF) ... yes
checking for jpeg ... yes
checking for BLAS ... yes
checking for LAPACK ... no
checking for MPI ... (cached) no
checking for Posix threads ... yes
checking for OpenMP ... yes
checking for CUDA ... (cached) no
checking API options ... (cached) ['f90', 'c++']
checking for C++ compiler ... (cached) g++
checking if g++ works ... yes
checking if g++ accepts '-Wall -pedantic' ... yes
checking for F90 compiler ... (cached) gfortran
checking if gfortran works ... yes
checking gfortran type ... (cached) NAGf90Fortran
checking F90 module extension ... (cached) .mod
scons: done reading SConscript files.
scons: Building targets ...
shell_script(["env.sh"], [])
shell_script(["env.csh"], [])
scons: done building targets.
------------------------
执行make install 出现如下错误:
Install file: "build/trip/grid/libtripgrid.a" as "/home/mengdj/tools/RSF/lib/libtripgrid.a"
Install file: "build/plot/plplot/plvpl.rc" as "/home/mengdj/tools/RSF/lib/plvpl.rc"
__header(["build/plot/plplot/plvpl.h"], ["build/plot/plplot/plvpl.c"])
gcc -o build/plot/plplot/plvpl.os -c -O2 -std=gnu99 -Wall -pedantic -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fopenmp -fPIC -DRSF_LIB='"/home/mengdj/tools/RSF/lib"' -Ibuild/include -I/usr/include/plplot build/plot/plplot/plvpl.c
gcc -o build/plot/plplot/plvpl.so -pthread -shared build/plot/plplot/plvpl.os -Lbuild/lib -ldrsf -ldrsfplot -lplplotd
/usr/bin/ld: cannot find -ldrsf
/usr/bin/ld: cannot find -ldrsfplot
collect2: ld returned 1 exit status
scons: *** [build/plot/plplot/plvpl.so] Error 1
scons: building terminated because of errors.
make: *** [install] 错误 2

由于编译过程太长,这里只列出了出错的地方,哪位大侠能知道是什么原因吗?这个东西困扰小弟好久了啊
头像
wjchen
帖子: 583
注册时间: 2011-05-02 19:08
系统: ubuntu 12.04
送出感谢: 2 次
接收感谢: 38 次

Re: 求助安装软件时出现cannot find l**错误,大侠该怎么解决啊?

#2

帖子 wjchen » 2011-06-03 16:55

用gedit打开/etc/ld.so.conf,在里面新加入一行/home/mengdj/tools/RSF/lib,保存。之后执行:

代码: 全选

sudo ldconfig
然后make install试试。 :em09
mengdj
帖子: 4
注册时间: 2011-06-03 14:01
送出感谢: 0
接收感谢: 0

Re: 求助安装软件时出现cannot find l**错误,大侠该怎么解决啊?

#3

帖子 mengdj » 2011-06-03 17:31

大侠 ,还是不行啊,同样的错误,对linux也不太熟悉,google 了好久也没找到解决的方法 :em20

gcc -o build/plot/plplot/plvpl.so -pthread -shared build/plot/plplot/plvpl.os -Lbuild/lib -ldrsf -ldrsfplot -lplplotd
/usr/bin/ld: cannot find -ldrsf
/usr/bin/ld: cannot find -ldrsfplot
collect2: ld returned 1 exit status
scons: *** [build/plot/plplot/plvpl.so] Error 1
scons: building terminated because of errors.
make: *** [install] 错误 2
头像
wjchen
帖子: 583
注册时间: 2011-05-02 19:08
系统: ubuntu 12.04
送出感谢: 2 次
接收感谢: 38 次

Re: 求助安装软件时出现cannot find l**错误,大侠该怎么解决啊?

#4

帖子 wjchen » 2011-06-03 19:19

在整个系统中找一找这两个文件:libdrsf.so、libdrsfplot.so,分别用下面的命令:

代码: 全选

sudo find / -name libdrsf.so*

代码: 全选

sudo find / -name libdrsfplot.so*
看看能不能找到。你这个错误就是因为找不到这两个文件而产生的。这两个文件我估计是编译阶段生成的,很可能在源代码的某个文件夹里面。
前面忘了提醒,make install 前面要加上sudo ,可能由于权限的原因没能把这两个库文件复制到系统文件夹里?
找到的文件也有可能叫libdrsf.so.1或libdrsf.so.1.2什么的,把上面两个命令的结果贴上来吧 :em01
mengdj
帖子: 4
注册时间: 2011-06-03 14:01
送出感谢: 0
接收感谢: 0

Re: 求助安装软件时出现cannot find l**错误,大侠该怎么解决啊?

#5

帖子 mengdj » 2011-06-04 8:00

按照大侠的提示,找到的结果如下:

mengdj@MDJ:~/tools/Madagascar$ sudo find / -name libdrsf.so*
[sudo] password for mengdj:
/usr/lib/libdrsf.so

mengdj@MDJ:~/tools/Madagascar$ sudo find / -name libdrsfplot.so*
/usr/lib/libdrsfplot.so

应该怎么才能让它找到呢 :em01

对了 make install 前面加了sudo还是这种错误!
非常感谢啊,大侠!
头像
wjchen
帖子: 583
注册时间: 2011-05-02 19:08
系统: ubuntu 12.04
送出感谢: 2 次
接收感谢: 38 次

Re: 求助安装软件时出现cannot find l**错误,大侠该怎么解决啊?

#6

帖子 wjchen » 2011-06-04 15:51

:em20 很奇怪的问题,在/usr/lib下照理应该是找得到的。你把那俩个文件复制到当前目录的build/lib/文件夹下(应该是~/tools/Madagascar/build/lib/吧):

代码: 全选

sudo cp /usr/lib/libdrsf.so ~/tools/Madagascar/build/lib/

代码: 全选

sudo cp /usr/lib/libdrsfplot.so ~/tools/Madagascar/build/lib/
再试试。
如果还是同样的问题,试试先设置一个环境变量,

代码: 全选

export LD_LIBRARY_PATH=/usr/lib
再不行的话我也不知道怎么回事了,我这里安装Madagascar一切正常,按照官网wiki(http://reproducibility.org/wiki/Install ... requisites)的说法,从sourceforge上下载源码包,安装一切可能的依赖包:

代码: 全选

sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libglew1.5-dev libjpeg62-dev libx11-dev \
libxaw7-dev libnetpbm10-dev swig python-dev python-scipy python-numpy libtiff4-dev scons units libblas-dev \
libcairo2-dev libavcodec-dev libplplot-dev
解压源码包进入目录,然后./configure,sudo make install一切正常,我系统是ubuntu 11.04。你实在不行的话下载最新的Madagascar源码重新编译试试吧,祝你成功! :em01
mengdj
帖子: 4
注册时间: 2011-06-03 14:01
送出感谢: 0
接收感谢: 0

Re: 求助安装软件时出现cannot find l**错误,大侠该怎么解决啊?

#7

帖子 mengdj » 2011-06-04 21:40

是啊,我再试试吧!我给Madagascar开发人员写了一封邮件,他是这样给我回复的:

2011-06-03 13:29:45 UTC
Thank you for reporting this problem. It is a bug, which will get fixed in the next version (1.2), to be released in about a month.

Meanwhile, the easiest way to fix the problem is to disable plplot. Open config.py file and change the line

PLPLOT = 'plplotd'

to

PLPLOT = None

The run "make install" again.
估计是版本的问题,具体我还没试验,今天没在实验室里哈!明天我两种方法都试验一下,看能解决不,不行我就把ubuntu升级到11.04!Madagascar我是用的svn下的,应该是最新版本的!

非常感谢哈 :em11
回复

回到 “编译或打包”