系统相关
首页 > 系统相关> > Pi4 Ubuntu MATE 22.04编译open3d点云库

Pi4 Ubuntu MATE 22.04编译open3d点云库

作者:互联网

一、Raspberry Pi4安装Ubuntu MATE 22.04详细过程

二、Ubuntu 20.04编译安装open3d点云处理库

三、Build on Pi4 with Ubuntu MATE 22.04(流程参照上面PC上的编译流程)

(1) change util/install_deps_ubuntu.sh libc++-7-dev/libc++abi-7-dev to libc++-14-dev/libc++abi-14-dev (2) sudo apt install cmake git python-setuptools python3-wheel pip python3-numpy (3) cmake(使用上面带编译选项的那个,不要编译filament; 由于选项里面关闭了GUI的编译,所以filament就默认不会编译了) (4) install (5) 测试import open3d时出现错误:
 libOpen3D.so: cannot allocate memory in static TLS block

解决方法:

export LD_PRELOAD=/usr/local/lib/libOpen3D.so
可以添加到~/.bashrc里面,source一下一劳永逸。 然后基本的测试功能都可以了。   但是还是不能绘制视图窗口,报错如下(尚未解决):
GLFW Error: GLX: Failed to create context 

 

四、更多探索

尝试打开GUI选项(cmake里面的 DBUILD_GUI=ON,然后就会自动编译filament模块)重新编译:

需要安装更多软件包:sudo apt install clang libclang-cpp-dev libc++-dev libc++1 libc++abi1 libc++abi-dev

否则在编译filament时会报错,如:

Could not find CPP_LIBRARY using the following names: c++
Could not find CPPABI_LIBRARY using the following names: c++abi

然后还会遇到错误:

filament/libs/image/src/ImageSampler.cpp:41:17: error: expected unqualified-id

解决方法:https://github.com/google/filament/issues/5203

index 98073c489..d8bc32f82 100644
--- a/libs/image/src/ImageSampler.cpp
+++ b/libs/image/src/ImageSampler.cpp
@@ -38,7 +38,7 @@ struct FilterFunction {
     bool rejectExternalSamples = true;
 };
 
-constexpr float M_PIf = float(filament::math::F_PI);
+constexpr float M_PI_f = float(filament::math::F_PI);
 
 const FilterFunction Box {
     .fn = [](float t) { return t <= 0.5f ? 1.0f : 0.0f; },
@@ -50,7 +50,7 @@ const FilterFunction Nearest { Box.fn, 0.0f };
 const FilterFunction Gaussian {
     .fn = [](float t) {
         if (t >= 2.0) return 0.0f;
-        const float scale = 1.0f / std::sqrt(0.5f * M_PIf);
+        const float scale = 1.0f / std::sqrt(0.5f * M_PI_f);
         return std::exp(-2.0f * t * t) * scale;
     },
     .boundingRadius = 2
@@ -86,7 +86,7 @@ const FilterFunction Mitchell {
 // Not bothering with a fast approximation since we cache results for each row.
 float sinc(float t) {
     if (t <= 0.00001f) return 1.0f;
-    return std::sin(M_PIf * t) / (M_PIf * t);
+    return std::sin(M_PI_f * t) / (M_PI_f * t);
 }

接着出现一堆类似下面的错误:

undefined reference to `spvtools::val::BasicBlock::immediate_dominator()'

还未找到解决方法。。。

 

 

标签:lib,22.04,float,c++,编译,open3d,dev,Ubuntu,filament
来源: https://www.cnblogs.com/wzc0066/p/16521024.html