TheTesla/xyzcad

How to compile Open3D library on Fedora

Closed this issue · 4 comments

Hi,
i am not able to run xyzcad because open3d library fails to install on Fedora 34. The following libraries i installed:

sudo dnf install libcxx libcxxabi libtool autoconf SDL2 libGLU libXi llvm nasm
pip install numba
pip install open3d
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement open3d
ERROR: No matching distribution found for open3d

Compiling open3d by hand throws the following (http://www.open3d.org/docs/release/compilation.html):

cd  ~
git clone --recursive https://github.com/intel-isl/Open3D
cd Open3D
mkdir build
cd build
cmake -DPYTHON_EXECUTABLE=/usr/bin/python -DCMAKE_INSTALL_PREFIX=/usr/lib/open3d ..
-- CMAKE_BUILD_TYPE is set to RelWithDebInfo.
-- Downloading 3rdparty dependencies to /home/tomate/Downloads/xyzcad/Open3D/3rdparty_downloads
CMake Deprecation Warning at CMakeLists.txt:130 (cmake_policy):
  The OLD behavior for policy CMP0072 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Open3D 0.13.0+804451a35
-- Using security hardening compiler flags: $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=-fstack-protector-strong,-Wformat,-Wformat-security>;$<$<COMPILE_LANGUAGE:CXX>:-fstack-protector-strong;-Wformat;-Wformat-security>
-- Using security hardening linker flags: $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=-Wl,-z,noexecstack,-Wl,-z,relro,-z,now,$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-pie>,$<$<CONFIG:Release>:LINKER:--strip-debug>>;$<$<COMPILE_LANGUAGE:CXX>:-Wl,-z,noexecstack;-Wl,-z,relro,-z,now;$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-pie>;$<$<CONFIG:Release>:LINKER:--strip-debug>>
-- Using security hardening compiler definitions: _FORTIFY_SOURCE=2
-- Using installed third-party library 3rdparty_threads 
-- Using installed third-party library 3rdparty_openmp 
-- Building with OpenMP
-- Using installed third-party library 3rdparty_x11 
-- Building library 3rdparty_glfw from source
-- Using X11 for window creation
-- Building third-party library JPEG from source
-- NASM assembler not found - libjpeg-turbo performance may suffer
-- libturbojpeg: WITH_CRT_DLL=OFF
-- pybind11 v2.6.2 
-- Using installed third-party library 3rdparty_opengl 
-- Using prebuilt third-party library Filament
-- GLIBC version 2.33 found: Using Open3D Filament binary.
-- Filament is located at /home/tomate/Downloads/xyzcad/Open3D/build/filament/src/ext_filament
CMake Error at 3rdparty/find_dependencies.cmake:1111 (find_library):
  Could not find CPPABI_LIBRARY using the following names: c++abi
Call Stack (most recent call first):
  CMakeLists.txt:371 (include)


-- Configuring incomplete, errors occurred!
See also "/home/tomate/Downloads/xyzcad/Open3D/build/CMakeFiles/CMakeOutput.log".
See also "/home/tomate/Downloads/xyzcad/Open3D/build/CMakeFiles/CMakeError.log".

Output from /home/tomate/Downloads/xyzcad/Open3D/build/CMakeFiles/CMakeError.log :

...
Checking whether the ASM_NASM compiler is IAR using "" did not match "IAR Assembler":
nasm: fatal: no input file specified
Type /usr/bin/nasm -h for help.
Checking whether the ASM_NASM compiler is ARMCC using "" did not match "(ARM Compiler)|(ARM Assembler)":
nasm: fatal: no input file specified
Type /usr/bin/nasm -h for help.

Looking forward to get some tips for compiling that lib :-)

I got it compiled on fedora 34 using these commands:

    1  git clone --recursive https://github.com/intel-isl/Open3D
    2  yum install git
    3  git clone --recursive https://github.com/intel-isl/Open3D
    4  cd Open3D
    5  mkdir build
    6  cd build
    7  ls /usr/bin/
    8  cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.9 -DCMAKE_INSTALL_PREFIX=/usr/lib/open3d ..
    9  yum install cmake
   10  yum install cmake
   11  cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.9 -DCMAKE_INSTALL_PREFIX=/usr/lib/open3d ..
   12  cat /Open3D/build/CMakeFiles/CMakeOutput.log
   13  cat /Open3D/build/CMakeFiles/CMakeError.log
   14  yum install g++
   15  cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.9 -DCMAKE_INSTALL_PREFIX=/usr/lib/open3d ..
   16  cat /Open3D/build/CMakeFiles/CMakeError.log
   17  yum install python3-devel
   18  cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.9 -DCMAKE_INSTALL_PREFIX=/usr/lib/open3d ..
   19  yum search X11
   20  yum search libx11
   21  yum install libx11-devel
   22  yum install libX11-devel
   23  cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.9 -DCMAKE_INSTALL_PREFIX=/usr/lib/open3d ..
   24  yum search xorg-dev
   25  yum search xorg
   26  yum search libglu
   27  yum install mesa-libGLU-devel
   28  cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.9 -DCMAKE_INSTALL_PREFIX=/usr/lib/open3d ..
   29  updatedb
   30  ls /usr/include/X11/extensions
   31  cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.9 -DCMAKE_INSTALL_PREFIX=/usr/lib/open3d ..
   32  yum search xorg
   33  yum install xorg-x11-server-devel
   34  cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.9 -DCMAKE_INSTALL_PREFIX=/usr/lib/open3d ..
   35  yum search libglu
   36  yum install mesa-libGLU-devel
   37  yum install install libcxx-devel
   38  yum install libcxx-devel
   39  cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.9 -DCMAKE_INSTALL_PREFIX=/usr/lib/open3d ..
   40  yum install libcxxabi-devel tbb-devel libXi-devel ninja-build SDL2-devel
   41  yum install libcxxabi-devel tbb-devel libXi-devel ninja-build SDL2-devel
   42  cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.9 -DCMAKE_INSTALL_PREFIX=/usr/lib/open3d ..
   43  yum search xrandr
   44  yum install libXrandr-devel
   45  cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.9 -DCMAKE_INSTALL_PREFIX=/usr/lib/open3d ..
   46  yum install libXrandr
   47  yum install Xrandr
   48  yum search Xinerama
   49  yum search libXinerama-devel
   50  yum install libXinerama-devel
   51  cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.9 -DCMAKE_INSTALL_PREFIX=/usr/lib/open3d ..
   52  yum install libXcursor-devel
   53  cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.9 -DCMAKE_INSTALL_PREFIX=/usr/lib/open3d ..
   54  make -j
   55  cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.9 -DCMAKE_INSTALL_PREFIX=/usr/lib/open3d -DCMAKE_CXX_FLAGS=-O ..
   56  make -j8
   57  make install
   58  python3
   59  ls
   60  histroy
   61  history

I have to clean up the garbage and find out what the important steps are.

During make install I also got:

/Open3D/cpp/apps/Open3DViewer/postinstall-linux.sh: line 5: update-desktop-database: command not found
/Open3D/cpp/apps/Open3DViewer/postinstall-linux.sh: line 6: gtk-update-icon-cache: command not found

I have to solve too. Hopefully the history dump helps a bit.

Hey Tesla,
thanks for adding that script. I was able to compile it by removing -j32 parameter and Open3D was installed into python libs
you could change -j32 to the following by the way

make -j$(grep -c processor /proc/cpuinfo)

running python3 demo.py i get some new error

Traceback (most recent call last):
  File "/home/tomate/Downloads/xyzcad/demo.py", line 15, in <module>
    from xyzcad import render
  File "/home/tomate/Downloads/xyzcad/xyzcad/render.py", line 14, in <module>
    import open3d as o3d
  File "/usr/local/lib64/python3.9/site-packages/open3d/__init__.py", line 75, in <module>
    from open3d.cpu.pybind import (camera, geometry, io, pipelines, utility, t)
ImportError: /usr/local/lib64/python3.9/site-packages/open3d/cpu/pybind.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZN6open3d4core18pybind_core_kernelERN8pybind116moduleE

i guess something is still wrong from compiling process. i am going to remove the build dir and try it again

finally the compilaton was successful. i removed the build dir and tried it again ;-)