ubuntu20.04配置open3D(C++常用API安装)

切记cmake版本最好是3.20及以上,我原来就是3.16的版本,后面看到有博客说,cmake版本不够高,最后换成3.24才行。

就是正常的操作流程:


1.获取源码

git clone https://github.com/isl-org/Open3D.git
cd Open3D

2.依赖安装和Cmake

util/install_deps_ubuntu.sh

安装依赖这里,我出现下面提示:

The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libosmesa6-dev : Depends: libosmesa6 (= 20.0.4-2ubuntu1) but it is not going to be installed
 libsdl2-dev : Depends: libibus-1.0-dev but it is not going to be installed
               Depends: libpulse-dev but it is not going to be installed
 libudev-dev : Depends: libudev1 (= 245.4-4ubuntu3) but 245.4-4ubuntu3.23 is to be installed
 xorg-dev : Depends: libxaw7-dev but it is not going to be installed
            Depends: libxpm-dev but it is not going to be installed
            Depends: xserver-xorg-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

所以这里我一直想着单个包安装,但疯狂出现版本对应不上的问题,后面经过多次尝试其他办法。我发现了,ubuntu的aptitude 提供了更多的控制和灵活性,特别是在遇到依赖问题时,用户可以更轻松地找到解决问题的办法。因此,在处理复杂的依赖问题时,建议使用 aptitude 作为 apt-get 的替代方案。
具体代码实现也很简单:

sudo apt-get install aptitude
sudo aptitude install xorg-dev  libosmesa6-dev libsdl2-dev libudev-dev


然后可能会遇到python版本不对的情况,-DPython3_EXECUTABLE=/usr/bin/python3.8  ,改这个就好了,或者通过修改-DBUILD_PYTHON_MODULE=OFF不配置。

mkdir build && cd build

cmake -DPython3_EXECUTABLE=/usr/bin/python3.8  -DCMAKE_INSTALL_PREFIX=/usr/local/open3d   -DBUILD_EIGEN3=ON -DBUILD_GLEW=ON -DBUILD_GLFW=ON -DBUILD_JSONCPP=ON -DBUILD_PNG=ON -DENABLE_GUI=ON -DBUILD_FILAMENT=ON -DBUILD_PYTHON_MODULE=ON .. 

===
-- Configuring done (7.5s)
-- Generating done (0.7s)

CMake Warning:
  Manually-specified variables were not used by the project:

    BUILD_EIGEN3
    BUILD_FILAMENT
    BUILD_GLEW
    BUILD_GLFW
    BUILD_JSONCPP
    BUILD_PNG
    ENABLE_GUI

3.编译和安装

make过程会有点久,请耐心等待!

make -j8

make install


 

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

running鸿

感谢感谢各位,祝各位学习进步

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值