Skip to content

安装meshlab心得

安装meshlab心得 published on No Comments on 安装meshlab心得

Workstation的glibc版本过低,无解。只能往ubuntu装

1. 下载vcglib 1.01,
https://github.com/cnr-isti-vclab/vcglib/releases
这是一个header file only的库,不用安装

2. 选择相应meshlab版本,V2016.12,
http://www.meshlab.net/#download

3. 按照readme里面的提示放置。qt需要5.8版本,设置好路径

4. 安装
cd src/external/
gmake external.pro
make

cd src/
gmake meshlab_full.pro
make

5. 出错
Cannot find file: /home/nicklj/Platform/thirdparty/meshlab/src/plugins_experimental/io_TXT/io_TXT.pro.
make: *** [sub-plugins_experimental-io_TXT-make_first-ordered] Error 2
发现目录里面io_txt.pro是小写,这是在逗我?
mv plugins_experimental/io_TXT/io_txt.pro plugins_experimental/io_TXT/io_TXT.pro

5. 继续出错
/usr/bin/ld: ../../external/lib/linux-g++/libmpir.a(lt4-clear.o): unrecognized relocation (0x2a) in section `.text'
参考:https://github.com/cnr-isti-vclab/meshlab/issues/47

LibMpir is an external library that could be a little tricky to compile (that's particularly true on Windows...a lot easier on Linux), so we provide inside the MeshLab source code an already compile version of the library itself. Obviously that approach could be dangerous, considering the wide range of the compilers existing. If you are interested in the plugin I suggest you to:

download the mpir 2.4.0 source code from the mpir official site http://mpir.org/downloads.html
call ./configure --enable-cxx --enable-static --with-pic in the extracted library folder
call ./make
move the generated mpir.h and mpirxx.h in src\external\inc\linux-g++\mpir-2.4.0
move the static libs libmpir.a and libmpirxx.a in src\external\lib\linux-g+(be careful the files are compiled in a hidden folder if you have the "don't show hidden folders" file browser option set to true you can waste an afternoon, as it happens to me, to find the compiled libs 😀 )
try to compile again the filter_csg plugin in MeshLab

编译后的.a文件在.lib目录下

6. make meshlab, 搞定

qtcreator: /lib64/libc.so.6: version `GLIBC_2.14' not found (最后还是没有比较好的解决办法)

qtcreator: /lib64/libc.so.6: version `GLIBC_2.14' not found (最后还是没有比较好的解决办法) published on No Comments on qtcreator: /lib64/libc.so.6: version `GLIBC_2.14' not found (最后还是没有比较好的解决办法)

https://my.oschina.net/zhangxu0512/blog/262275

Run qtcreator, cannot find GLIBC_2.14

1. Check current glibc
strings /lib64/libc.so.6 |grep GLIBC

2. 从http://www.gnu.org/software/libc/ 下载源代码。我下载的版本是2.14,链接地址是http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
However, 2.14 cannot be compiled by gcc5.2.0, so I download the 2.20

3.
tar xvf glibc-2.14.tar.gz
cd glibc-2.14
mkdir build
cd ./build
../configure --prefix=/opt/glibc-2.14
make -j4
make install

4. There will be
Error: no such instruction: `vinserti128 $1,%xmm0,%ymm0,%ymm0'

5. Install binutils-2.25

6. 运行的时候依然有问题
转自 https://herowong.me/archives/install-and-running-multiple-version-glibc-in-a-single-host-1.html

可以通过ldd命令查看程序依赖的动态库

一般情况下(在没有指定DT_RPATH和DT_RUNPATH的情况下)
1.先查找$LD_LIBRARY_PATH中的目录
2.再查找缓存文件/etc/ld.so.cache
3.再默认的目录/lib,/usr/lib或者是/lib64和/usr/lib64

ld.so.cache缓存文件可以通过ldconfig命令来配置,具体就不多说了
而在用gcc编译一个程序的时候加载动态库文件的顺序又是怎么样的呢?
1.由gcc写死的路径,通过gcc –print-search-dirs看到,这里加载的是一些 libgcc_s.so的库
2.$LIBRARY_PATH变量指定目录或者是编译-L参数指定的目录
3.由ld命令设定的目录,这部分也是在编译ld这个程序时写死的,可以通过“ld –verbose | grep SEARCH”来查看

回到刚才的问题,把新版本的Glibc添加到$LD_LIBRARY_PATH加会导致其它常用的程序如ls会挂掉,那我能不能把编译我想要的工具时指定使用新版的Glibc呢?当然可以,去google一下你可以看到so上的这个问题的答案 在编译的时候加上
-Wl,–rpath=/path/to/newglibc \
-Wl,–dynamic-linker=/path/to/newglibc/ld-linux.so.2