isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.23k stars 2.28k forks source link

Compilation nightmares on RaspiOS-64 #5680

Open manbehindthemadness opened 1 year ago

manbehindthemadness commented 1 year ago

Checklist

Steps to reproduce the issue

I first cloned Open3D by:

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

Then, I build Open3D (on Debian 11 Bullseye) with:

mkdir build
cd build
ccmake ..

BUILD_AZURE_KINECT               OFF
 BUILD_BENCHMARKS                 OFF
 BUILD_COMMON_CUDA_ARCHS          ON
 BUILD_COMMON_ISPC_ISAS           OFF
 BUILD_CUDA_MODULE                OFF
 BUILD_EXAMPLES                   OFF
 BUILD_FILAMENT_FROM_SOURCE       OFF
 BUILD_GUI                        OFF
 BUILD_ISPC_MODULE                OFF
 BUILD_JUPYTER_EXTENSION          OFF
 BUILD_LIBREALSENSE               OFF
 BUILD_PYTHON_MODULE              OFF
 BUILD_PYTORCH_OPS                OFF
 BUILD_SHARED_LIBS                OFF
 BUILD_SYCL_MODULE                OFF
 BUILD_TENSORFLOW_OPS             OFF
 BUILD_UNIT_TESTS                 OFF
 BUILD_VTK_FROM_SOURCE            OFF
 BUILD_WEBRTC                     OFF
 BUNDLE_OPEN3D_ML                 OFF
 CCACHE                           /usr/bin/ccache
 CMAKE_BUILD_TYPE                 Release
 CMAKE_INSTALL_PREFIX             /usr/local
 DEVELOPER_BUILD                  OFF
 ENABLE_CACHED_CUDA_MANAGER       OFF
 ENABLE_HEADLESS_RENDERING        OFF
 ENABLE_SYCL_UNIFIED_SHARED_MEM   OFF
 Eigen3_DIR                       /usr/share/eigen3/cmake
 FETCHCONTENT_BASE_DIR            /usr/src/Open3D/build/_deps
 FETCHCONTENT_FULLY_DISCONNECTE   OFF
 FETCHCONTENT_QUIET               OFF
 FETCHCONTENT_SOURCE_DIR_EXT_IS
 FETCHCONTENT_SOURCE_DIR_EXT_OP
 FETCHCONTENT_UPDATES_DISCONNEC   OFF
 FETCHCONTENT_UPDATES_DISCONNEC   OFF
 FETCHCONTENT_UPDATES_DISCONNEC   OFF
 FILAMENT_PRECOMPILED_ROOT
 GLFW_USE_MIR                     OFF
 GLFW_USE_WAYLAND                 OFF
 GLFW_VULKAN_STATIC               OFF
 GLIBCXX_USE_CXX11_ABI            OFF
 ISPC_ISAS_EXECUTABLE             ISPC_ISAS_EXECUTABLE-NOTFOUND
 LIB_SUFFIX
 OPEN3D_THIRD_PARTY_DOWNLOAD_DI   /usr/src/Open3D/3rdparty_downloads
 PREFER_OSX_HOMEBREW              OFF
 PYTHON_EXECUTABLE                /opt/venv/bin/python3.10
 STATIC_WINDOWS_RUNTIME           OFF
 TBB_DIR                          /usr/lib/aarch64-linux-gnu/cmake/TBB
 USE_BLAS                         OFF
 USE_LINUX_MKL_FROM_CONDA_REPO    ON
 USE_SYSTEM_ASSIMP                ON
 USE_SYSTEM_BLAS                  ON
 USE_SYSTEM_EIGEN3                ON
 USE_SYSTEM_FILAMENT              OFF
 USE_SYSTEM_FMT                   OFF
 USE_SYSTEM_GLEW                  OFF
 USE_SYSTEM_GLFW                  OFF
 USE_SYSTEM_GOOGLETEST            OFF
 USE_SYSTEM_IMGUI                 OFF
 USE_SYSTEM_JPEG                  OFF
 USE_SYSTEM_JSONCPP               OFF
 USE_SYSTEM_LIBLZF                OFF
 USE_SYSTEM_LIBREALSENSE          OFF
 USE_SYSTEM_MSGPACK               OFF
 USE_SYSTEM_NANOFLANN             OFF
 USE_SYSTEM_PNG                   OFF
 USE_SYSTEM_PYBIND11              OFF
 USE_SYSTEM_QHULLCPP              OFF
 USE_SYSTEM_TBB                   ON
 USE_SYSTEM_TINYGLTF              OFF
 USE_SYSTEM_TINYOBJLOADER         OFF
 USE_SYSTEM_ZEROMQ                OFF
 WITH_IPPICV                      ON
 WITH_OPENMP                      ON
 WITH_SIMD                        OFF
 assimp_DIR                       /usr/lib/aarch64-linux-gnu/cmake/assimp-5.0

make -j$(nproc)

Issue 1: Every flags.cmake file is created using unrecognized -m64

Issue 2: c++: error: unrecognized command-line option ‘-mf16c’ c++: error: unrecognized command-line option ‘-mavx2’ c++: error: unrecognized command-line option ‘-mfma’ c++: error: unrecognized command-line option ‘-mlzcnt’ c++: error: unrecognized command-line option ‘-mbmi’ c++: error: unrecognized command-line option ‘-mbmi2’

Issue 3: [ 98%] Linking CXX executable ../../bin/ConvertPointCloud /usr/bin/ld: ../../assimp/lib/libassimp.a(ImporterRegistry.cpp.o): in function Assimp::GetImporterInstanceList(std::vector<Assimp::BaseImporter*, std::allocator<Assimp::BaseImporter*> >&)': ImporterRegistry.cpp:(.text+0x8b0): undefined reference toAssimp::XGLImporter::XGLImporter()' /usr/bin/ld: ImporterRegistry.cpp:(.text+0x8e0): undefined reference to `Assimp::FBXImporter::FBXImporter()' collect2: error: ld returned 1 exit status make[2]: [cpp/tools/CMakeFiles/ConvertPointCloud.dir/build.make:139: bin/ConvertPointCloud] Error 1 make[1]: [CMakeFiles/Makefile2:2436: cpp/tools/CMakeFiles/ConvertPointCloud.dir/all] Error 2 make: *** [Makefile:156: all] Error 2

Issue 4: undefined reference to aiMaterial::GetName() const

Error message

[ 98%] Linking CXX executable ../../bin/ConvertPointCloud
/usr/bin/ld: ../../lib/Release/libOpen3D.a(FileASSIMP.cpp.o): in function `open3d::io::ReadTriangleMeshUsingASSIMP(std::string const&, open3d::geometry::TriangleMesh&, open3d::io::ReadTriangleMeshOptions const&)':
FileASSIMP.cpp:(.text+0x1040): undefined reference to `aiMaterial::GetName() const'
/usr/bin/ld: ../../lib/Release/libOpen3D.a(FileASSIMP.cpp.o): in function `open3d::io::ReadModelUsingAssimp(std::string const&, open3d::visualization::rendering::TriangleMeshModel&, open3d::io::ReadTriangleModelOptions const&)':
FileASSIMP.cpp:(.text+0x2368): undefined reference to `aiMaterial::GetName() const'
collect2: error: ld returned 1 exit status
make[2]: *** [cpp/tools/CMakeFiles/ConvertPointCloud.dir/build.make:139: bin/ConvertPointCloud] Error 1
make[1]: *** [CMakeFiles/Makefile2:2392: cpp/tools/CMakeFiles/ConvertPointCloud.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Open3D, Python and System information

- Operating system: Debian 11 Bullseye (RasPiOS)
- Python version: Python 3.10
- Open3D version: Cloned master
- System architecture: arm64 / Rpi
- Is this a remote workstation?: No
- How did you install Open3D?: build from source
- Compiler version(s)
GCC:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/10/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20210110 (Debian 10.2.1-6)

CLANG:
Debian clang version 11.0.1-2
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/aarch64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/aarch64-linux-gnu/10
Selected GCC installation: /usr/bin/../lib/gcc/aarch64-linux-gnu/10
Candidate multilib: .;@m64
Selected multilib: .;@m64

Additional information

I have inspected the Libassimp header files and I can clearly see that aiMaterial::GetName() is defined. I am at a loss as to why the build fails.

yxlao commented 1 year ago

We have only tested the ARM build on Ubuntu, the dependencies may be different for Debian.

Depending on your use case, one thing you may try is to build using Docker (https://github.com/isl-org/Open3D/tree/master/docker). The Docker ARM build is tested on our CI regularly. For example,

./docker_build.sh openblas-arm64-py38-dev

By default, it will create a wheel file in the host folder. You may also change the docker_build.sh script to extract the compiled C++ library as well.

manbehindthemadness commented 1 year ago

Thanks, I'll give it a spin and see what happens I'm just trying to compile rtabmap against it

manbehindthemadness commented 1 year ago

No dice unfortunatly.

Setting up libhx509-5-heimdal:arm64 (7.5.0+dfsg-1ubuntu0.1) ... Setting up libgcc-7-dev:arm64 (7.5.0-3ubuntu1~18.04) ... Setting up cpp-7 (7.5.0-3ubuntu1~18.04) ... Setting up libstdc++-7-dev:arm64 (7.5.0-3ubuntu1~18.04) ... Setting up libperl5.26:arm64 (5.26.1-6ubuntu0.6) ... Setting up binutils-aarch64-linux-gnu (2.30-21ubuntu1~18.04.7) ... Setting up gpgsm (2.2.4-1ubuntu1.6) ... Setting up gnupg-utils (2.2.4-1ubuntu1.6) ... Setting up pinentry-curses (1.1.0-1) ... Setting up libkrb5-3:arm64 (1.16-2ubuntu0.2) ... Setting up binutils (2.30-21ubuntu1~18.04.7) ... Setting up libkrb5-26-heimdal:arm64 (7.5.0+dfsg-1ubuntu0.1) ... Setting up libheimntlm0-heimdal:arm64 (7.5.0+dfsg-1ubuntu0.1) ... Setting up gpg (2.2.4-1ubuntu1.6) ... Setting up cpp (4:7.4.0-1ubuntu2.3) ... Setting up gcc-7 (7.5.0-3ubuntu1~18.04) ... Setting up g++-7 (7.5.0-3ubuntu1~18.04) ... Setting up gpg-agent (2.2.4-1ubuntu1.6) ... Setting up gcc (4:7.4.0-1ubuntu2.3) ... Setting up gpg-wks-server (2.2.4-1ubuntu1.6) ... Setting up libgssapi-krb5-2:arm64 (1.16-2ubuntu0.2) ... Setting up perl (5.26.1-6ubuntu0.6) ... Setting up libfile-fcntllock-perl (0.22-3build2) ... Setting up libalgorithm-diff-perl (1.19.03-1) ... Setting up g++ (4:7.4.0-1ubuntu2.3) ... update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode update-alternatives: warning: skip creation of /usr/share/man/man1/c++.1.gz because associated file /usr/share/man/man1/g++.1.gz (of link group c++) doesn't exist Setting up libgssapi3-heimdal:arm64 (7.5.0+dfsg-1ubuntu0.1) ... Setting up openssh-client (1:7.6p1-4ubuntu0.7) ... Setting up liberror-perl (0.17025-1) ... Setting up libdpkg-perl (1.19.0.5ubuntu2.4) ... Setting up libalgorithm-merge-perl (0.08-3) ... Setting up dpkg-dev (1.19.0.5ubuntu2.4) ... Setting up libalgorithm-diff-xs-perl (0.04-5) ... Setting up libldap-2.4-2:arm64 (2.4.45+dfsg-1ubuntu1.11) ... Setting up dirmngr (2.2.4-1ubuntu1.6) ... Setting up build-essential (12.4ubuntu1) ... Setting up libcurl3-gnutls:arm64 (7.58.0-2ubuntu3.21) ... Setting up gpg-wks-client (2.2.4-1ubuntu1.6) ... Setting up git (1:2.17.1-1ubuntu0.13) ... Setting up gnupg (2.2.4-1ubuntu1.6) ... Processing triggers for libc-bin (2.27-3ubuntu1.6) ... Removing intermediate container 5d110c2a1174 ---> 8543d208759e Step 14/29 : ENV PATH="/root/miniconda3/bin:${PATH}" ---> Running in f39eac8abf91 Removing intermediate container f39eac8abf91 ---> f316a92a83d4 Step 15/29 : RUN wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-${CONDA_SUFFIX}.sh && bash Miniconda3-latest-Linux-${CONDA_SUFFIX}.sh -b && rm Miniconda3-latest-Linux-${CONDA_SUFFIX}.sh && conda --version ---> Running in 9fc1ca132fbf PREFIX=/root/miniconda3 Unpacking payload ... Miniconda3-latest-Linux-aarch64.sh: line 413: 35 Illegal instruction (core dumped) "$CONDA_EXEC" constructor --prefix "$PREFIX" --extract-conda-pkgs The command '/bin/bash -c wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-${CONDA_SUFFIX}.sh && bash Miniconda3-latest-Linux-${CONDA_SUFFIX}.sh -b && rm Miniconda3-latest-Linux-${CONDA_SUFFIX}.sh && conda --version' returned a non-zero code: 1

manbehindthemadness commented 1 year ago

could this be a result of miniconda not having a python 3.10 release?