主流程参考文章:
1、https://blog.csdn.net/zsssrs/article/details/108492750#commentBox
2、https://zhuanlan.zhihu.com/p/162277657
一句话解决:
使用1的方法成功,不过需要删除对应的VTKlib
使用1中的方法,碰到如下问题:
/usr/bin/ld: cannot find -lvtkNetCDF-6.3
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-g++' failed with exit status 1
如果是在anaconda的环境中,则ld位置会被改变
搜索后发现,解决办法都是定位是否包存在,若存在则软链接,不存在则sudo apt-get install libxxx-dev
可以首先尝试上述办法,以lvtkNetCDF-6.3为例,其lib名应该为:libvtknetcdf.so,对应还有libvtknetcdf-dev
但这并没有用,开始查看python-cpl的github时发现:
以为是安装vtk的问题。但仔细思索1的话,重新在源码的setup.py 752行中发现了:
'vtkNetCDF-' + vtk_version
删掉它,再次尝试
$ python setup.py bdist_wheel
成功,会根据当前编译的系统/架构(linux-x86)以及python版本(cp36-cp36)生成对应whl,使用pip安装即可(conda环境下也编译通过)
使用2中的方法
conda install -c sirokujira python-pcl --channel conda-forge
碰到了conda问题:
$ conda install -c sirokujira python-pcl --channel conda-forge
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64/repodata.json>
Elapsed: -An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
ConnectionError(ReadTimeoutError("HTTPSConnectionPool(host='mirrors.tuna.tsinghua.edu.cn', port=443): Read timed out.",),)A reportable application error has occurred. Conda has prepared the above report.
If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?[y/N]
输入y后再次尝试,安装成功!
python中进行验证
import pcl
报错如下:
ImportError: libboost_system.so.1.54.0: cannot open shared object file: No such file or directory
很好,2中是有记录的,使用locate查找libboost_system.so
$ locate libboost_system.so
/usr/lib/x86_64-linux-gnu/libboost_system.so
/usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1
/usr/local/cuda-10.2/nsight-systems-2019.5.2/host-linux-x64/libboost_system.so.1.64.0
软链接吧:
$ sudo ln -s libboost_system.so.1.65.1 libboost_system.so.1.54.0
还是无效= =