This page shows advanced options to customize your Open3D build. For quick start, see Compiling from source.
We use pybind11 to build the Python binding. It tries to automatically detect the installed version of Python and link against that. When this fails, or when there are multiple versions of Python and it finds the wrong one, delete CMakeCache.txt and then invoke CMake as follows:
cmake -DPYTHON_EXECUTABLE:FILEPATH=<path-to-python-executable> ..
Python binding issues can also refer to pybind11 document page.
If you do not want Python binding, you may turn off the following compilation options:
For each dependent library, there is a corresponding CMake build option
BUILD_<LIBRARY_NAME>. If the option is
ON, the dependent library is forced to be compiled from the source code included in
3rdparty folder. If it is
OFF, CMake will try to find system installed libraries and use it. If CMake fails to find the dependent library, it falls back to compiling the library from source code.
On Ubuntu and OSX it is recommended to link Open3D to system installed libraries. The dependencies can be installed via scripts
util/scripts/install-deps-osx.sh. On Windows it is recommended to compile everything from source since Windows lacks a package management software.
The following is an example of forcing building dependencies from source code:
cmake -DBUILD_EIGEN3=ON \ -DBUILD_GLEW=ON \ -DBUILD_GLFW=ON \ -DBUILD_JPEG=ON \ -DBUILD_JSONCPP=ON \ -DBUILD_PNG=ON \ ..
Enabling these build options may increase the compilation time.
We automatically detect if the C++ compiler supports OpenMP and compile Open3D with it if the compilation option
OpenMP can greatly accelerate computation on a multi-core CPU.
The default LLVM compiler on OS X does not support OpenMP. A workaround is to install a C++ compiler with OpenMP support, such as gcc, then use it to compile Open3D. For example, starting from a clean build directory, run
brew install gcc --without-multilib cmake -DCMAKE_C_COMPILER=gcc-6 -DCMAKE_CXX_COMPILER=g++-6 .. make -j
This workaround has some compatibility issues with the source code of GLFW included in
Make sure Open3D is linked against GLFW installed on the OS.
Work in progress!
- Unit test coverage: low.
- Tested on: macOS and Ubuntu.
Unit testing is based on Google Test. By default unit tests are turned off. In order to enable them follow the next steps:
- Download/Build/Install Google Test.
- Set the BUILD_UNIT_TESTS flag to ON.
cd util/scripts ./install-gtest.sh cd <path_to_Open3D> mkdir build cd build cmake -DBUILD_UNIT_TESTS=ON .. make -j
In order to perform the unit tests:
cd util/scripts ./runUnitTests.sh
pip install sphinx sphinx-autobuild sphinx-rtd-theme make html