关于lib环境配置的一个流程回顾

hope服务器启动fpga_editor

/tool/edanew/xilinx/ise/14.7/ISE_DS/ISE/bin/lin64/_fpga_editor: error while loading shared libraries: libXm.so.3: cannot open shared object file: No such file or directory

回顾blade启动fpga_editor的环境配置:
souce ~/set_ise
cat ~/set_ise

setenv LM_LICENSE_FILE /home/userlib1/eda_tools/xilinx/ise/14.7/ISE_DS/license/crack/.xilinx/xilinx_ise.lic
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/userlib1/eda_tools/xilinx/ise/14.7/ISE_DS/ISE/lib/lin64
setenv PATH ${PATH}:/home/userlib1/eda_tools/xilinx/ise/14.7/ISE_DS/ISE/bin/lin64

在hope上同样执行上述语句
打开fpga_editor仍报原有问题
因为三个setenv唯有第二个与报错信息有关,license和PATH无影响,怀疑setenv LD_LIBRARY_PATH时ise的路径与blade上的不一致
打开ise,可顺利打开
which ise

/tool/edanew/xilinx/ise/14.7/ISE_DS/ISE/bin/lin64/ise

设置LD_LIBRARY_PATH到对应的ise路径上
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/tool/edanew/xilinx/ise/14.7/ISE_DS/ISE/lib/lin64
仍然不行
echo $LD_LIBRARY_PATH

/home/fpga/lib/tcmalloc/libunwind-0.99-beta/lib:/home/fpga/lib/tcmalloc/gperftools/lib:/home/fpga/tools/capstone-master:/home/fpga/lib/tcmalloc/gperftools/lib:/home/fpga/lib/tcmalloc/libunwind-0.99-beta/lib:/home/fpga/lib/lp_solve_5.5/lib64:/home/fpga/lib/qt-5.8.0/lib:/home/fpga/lib/mpfr-2.4.2/lib:/home/fpga/lib/gmp-4.3.2/lib:/home/fpga/lib/mpc-0.8.1/lib:/home/fpga/lib/gcc-5.4.0/lib64:/home/fpga/lib/tcl8.4.19/lib:/home/fpga/lib/ictime/devpkgs/lib:/home/fpga/lib/ictime/devpkgs/TCL/lib:/home/fpga/lib/rockey_arm/lib64:/home/fpga/opt/si2/oa/lib/linux_rhel50_64/optMT:/home/fpga/lib/boost-1.58/lib:/usr/lib64:/usr/local/gtest-1.6.0/lib/.libs:/home/userlib1/eda_tools/xilinx/ise/14.7/ISE_DS/ISE/lib/lin64:/tool/edanew/xilinx/ise/14.7/ISE_DS/ISE/lib/lin64:/tool/edanew/xilinx/ise/14.7/ISE_DS/ISE/lib/lin64

确认已加入LD_LIBRARY_PATH
反思是否该路径下并没有所报缺少的libXm.so.3文件
ll /tool/edanew/xilinx/ise/14.7/ISE_DS/ISE/lib/lin64 | grep "libxm" -i

-rwxr-xr-x 1 userlib1 cdrom 45936 Oct 13 2013 libXMLManager.so
-rwxr-xr-x 1 userlib1 cdrom 230320 Oct 13 2013 libXml.so

果然没有
去blade上看fpga_editor所依赖的环境文件都在哪
【ldd - print shared library dependencies
可man ldd查看具体介绍及命令使用方式】
ldd /home/userlib1/eda_tools/xilinx/ise/14.7/ISE_DS/ISE/bin/lin64/_fpga_editor | grep -i xm

libXml.so => not found
libXm.so.3 => /usr/lib64/libXm.so.3 (0x00007fc1ce40b000)
libXmu.so.6 => /usr/lib64/libXmu.so.6 (0x0000003d3c000000)

找到
看hope上/usr/lib64/下是否有对应文件
ll /usr/lib64/libXm.so.

libXm.so.4@ libXm.so.4.0.3*
lrwxrwxrwx. 1 root root 14 Jul 22 2020 /usr/lib64/libXm.so.4 -> libXm.so.4.0.3

无所要的libXm.so.3(原因为hope为新服务器,4较新,但仍需要3),故需要将文件从blade拷贝到hope上
将libXm.so.3通过文件传输cp到windows上,发现不行,原因为不能拷贝链接文件,而要拷贝源文件,故cp /usr/lib64/libXm.so.3
在hope上/home/hksun/ld_lib/下建立对应的软链接关系(注意文件先后顺序)
ln -s libXm.so.3.0.2 libXm.so.3
ll

total 2792
lrwxrwxrwx 1 test1 wheel 14 Jan 13 17:00 libXm.so.3 -> libXm.so.3.0.2
-rw-rw-r-- 1 test1 wheel 2857560 Jun 25 2010 libXm.so.3.0.2

成功建立链接关系
将libXm.so.3文件路径加入到LD_LIBRARY_PATH上
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/hksun/ld_lib
再次执行fpga_editor

/tool/edanew/xilinx/ise/14.7/ISE_DS/ISE/bin/lin64/_fpga_editor: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
类似问题,再次操作即可
联想到ldd,执行
ldd /tool/edanew/xilinx/ise/14.7/ISE_DS/ISE/bin/lin64/_fpga_editor | grep -v eda_tools

libstdc++.so.5 => not found
libstdc++.so.5 => not found
libstdc++.so.5 => not found
libstdc++.so.5 => not found
libstdc++.so.5 => not found
libstdc++.so.5 => not found
libstdc++.so.5 => not found

一开始可通过此命令来看缺失哪些.so文件
全部解决后可成功打开fpga_editor
-DONE


ps.最快解决方法:可将hope生成.ncd拷贝到blade用fpga_editor打开即可

posted @ 2022-01-14 10:08  HKSun  阅读(155)  评论(0编辑  收藏  举报