爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 9056|回复: 10

安装WPS无法生成ungrib.exe,说找不到lpng12

[复制链接]
发表于 2017-7-4 15:50:15 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
make[1]: Entering directory '/usr/local/WPS/ungrib/src'
Makefile:90: warning: overriding recipe for target '.F.o'
../../configure.wps:103: warning: ignoring old recipe for target '.F.o'
Makefile:95: warning: overriding recipe for target '.c.o'
../../configure.wps:95: warning: ignoring old recipe for target '.c.o'
/bin/rm -f ungrib.exe
if [ -z  ] ; then \
          gfortran -o ungrib.exe  misc_definitions_module.o debug_cio.o module_debug.o module_stringutil.o table.o module_datarray.o gridinfo.o new_storage.o filelist.o ungrib.o output.o rrpr.o rd_grib1.o file_delete.o datint.o rd_grib2.o  \
            -L./ngl -lw3 -lg2_4 \
            -L/usr/local/wpslib -ljasper -lpng12 -lpng -lz \
            -L. -lpgu ; \
                        else \
          gfortran -o ungrib.exe  misc_definitions_module.o debug_cio.o module_debug.o module_stringutil.o table.o module_datarray.o gridinfo.o new_storage.o filelist.o ungrib.o output.o rrpr.o rd_grib1.o file_delete.o datint.o rd_grib2.o  \
            ./ngl/w3/libw3.a ./ngl/g2/libg2_4.a \
            -L/usr/local/wpslib -ljasper -lpng12 -lpng -lz \
            libpgu.a ; \
                        fi
/usr/bin/ld: 找不到 -lpng12
collect2: error: ld returned 1 exit status
Makefile:18: recipe for target 'ungrib.exe' failed
make[1]: [ungrib.exe] Error 1 (ignored)
make[1]: Leaving directory '/usr/local/WPS/ungrib/src'
if [ -h ungrib.exe ] ; then \
        /bin/rm -f ungrib.exe ; \
fi ; \
if [ -h ../ungrib.exe ] ; then \
    /bin/rm -f ../ungrib.exe ; \
fi ; \
if [ -e src/ungrib.exe ] ; then \
    ln -sf src/ungrib.exe . ; \
.
.
.
make[1]: Entering directory '/usr/local/WPS/ungrib/src'
Makefile:90: warning: overriding recipe for target '.F.o'
../../configure.wps:103: warning: ignoring old recipe for target '.F.o'
Makefile:95: warning: overriding recipe for target '.c.o'
../../configure.wps:95: warning: ignoring old recipe for target '.c.o'
if [ -z  ] ; then \
          gfortran -o g2print.exe  g2print.o \
            filelist.o gridinfo.o \
            -L. -lpgu \
            -L./ngl -lw3 -lg2_4 \
            -L/usr/local/wpslib -ljasper -lpng12 -lpng -lz ; \
                        else \
          gfortran -o g2print.exe  g2print.o \
            filelist.o gridinfo.o \
            libpgu.a  \
            ./ngl/w3/libw3.a ./ngl/g2/libg2_4.a \
            -L/usr/local/wpslib -ljasper -lpng12 -lpng -lz ; \
                        fi
/usr/bin/ld: 找不到 -lpng12
collect2: error: ld returned 1 exit status
Makefile:41: recipe for target 'g2print.exe' failed
make[1]: [g2print.exe] Error 1 (ignored)
make[1]: Leaving directory '/usr/local/WPS/ungrib/src'
if [ -h g2print.exe ] ; then \
....
第一次装wps,尝试自己百度解决问题,还是能力不够。
麻烦各路大神!!!

密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-11-17 11:20:29 | 显示全部楼层
在linux环境编译应用程式或lib的source code时常常会出现如下的错误讯息:
/usr/bin/ld: cannot find -lxxx
这些讯息会随着编译不同类型的source code 而有不同的结果出来如:
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find -lltdl
/usr/bin/ld: cannot find -lXtst
其中xxx即表示函式库文件名称,如上例的:libc.so、libltdl.so、libXtst.so。
其命名规则是:lib+库名(即xxx)+.so。
会发生这样的原因有以下三种情形:
1 系统没有安装相对应的lib
2 相对应的lib版本不对
3 lib(.so档)的symbolic link 不正确,没有连结到正确的函式库文件(.so)
解决方法:
(1)先判断在/usr/lib 下的相对应的函式库文件(.so) 的symbolic link 是否正确,若不正确改成正确的连结目标即可解决问题。
(2)若不是symbolic link 的问题引起,而是系统缺少相对应的lib安装lib即可解决。
(3)如何安装缺少的lib:
以上面三个错误讯息为例:
错误1缺少libc的LIB
错误2缺少libltdl的LIB
错误3缺少libXtst的LIB
以Ubuntu为例:
先搜寻相对应的LIB再进行安装的作业如:
apt-cache search libc-dev
apt-cache search libltdl-dev
apt-cache search libXtst-dev
实例:
在进行输入法gcin的Source Code的编译时出现以下的错误讯息:
/usr/bin/ld: cannot find -lXtst
经检查后发现是:
lib(.so档)的symbolic link 不正确
解决方法如下:
cd /usr/lib
ln -s libXtst.so.6 libXtst.so
如果在/usr/lib的目录下找不到libXtst.so 档,那么就表示系统没有安装libXtst的函式库。
解法如下:
apt-get install libxtst-dev
       如果是库文件路径引发的问题,可以到/etc/ld.so.conf.d目录下,修改其中任意一份conf文件,(可以自建conf,以方便识别)将lib所在目录写进去,然后在终端输入 ldconfig 更新缓存。
(http://www.th7.cn/system/lin/201610/185458.shtml)
然后在自己的/usr/local/wpslib的文件夹下发现只有libpng15.so,而在vi configure.wps的修改中,将lpng12改成lpng15,在重试,即可
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

发表于 2017-7-4 17:29:44 | 显示全部楼层
安装上libpng就好了。
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-7-4 18:08:30 | 显示全部楼层
一开始就把三个库装了,现在不知道哪里出问题了?
密码修改失败请联系微信:mofangbao
 成长值: 0
发表于 2017-7-4 18:09:22 | 显示全部楼层
zhangkf_7 发表于 2017-7-4 18:08
一开始就把三个库装了,现在不知道哪里出问题了?

安装之后有没有写到profile里面呢?或者bashrc里面?
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-7-4 18:40:08 | 显示全部楼层
言深深 发表于 2017-7-4 18:09
安装之后有没有写到profile里面呢?或者bashrc里面?

E嗯嗯,都是按教程来安装的。
密码修改失败请联系微信:mofangbao
发表于 2017-11-11 17:11:55 | 显示全部楼层
解决了吗,和你一样的问题
密码修改失败请联系微信:mofangbao
发表于 2017-11-11 17:28:00 | 显示全部楼层
zhangkf_7 发表于 2017-7-4 18:08
一开始就把三个库装了,现在不知道哪里出问题了?

你还是重新弄下你的库
密码修改失败请联系微信:mofangbao
发表于 2017-11-18 21:46:04 | 显示全部楼层
zhangkf_7 发表于 2017-11-17 11:20
在linux环境编译应用程式或lib的source code时常常会出现如下的错误讯息:
/usr/bin/ld: cannot find -lxx ...

您好,我在安装wps的时候ungride.exe 无法生成,报错如下:
/usr/bin/ld: cannot find -lg2_4
make[1]: [g2print.exe] 错误 2 (忽略)
make[1]: Leaving directory `/home/a/wrf/WPS/ungrib/src'

按照您说的“先检查函式库文件(.so) 的symbolic link 是否正确”,请问怎么检查呢?
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-11-22 23:02:48 | 显示全部楼层
我的问题是显示找不到lpng12,然后我在我自己的/usr/local/wpslib的文件夹下发现只有libpng15.so,没有libpng12.so,所以我在vi configure.wps的修改中,将lpng12改成lpng15。你按照这个思路试试
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表