diff --git a/CMakeLists.txt b/CMakeLists.txt index 354125dc01d..4e211d15dc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,6 +62,7 @@ if(BUILD_SHARED_LIBS) else() option(STATIC_WINDOWS_RUNTIME "Use static (MT/MTd) Windows runtime" ON ) endif() +option(BUILD_VISUALIZATION "Package Open3D without Visualization" ON) option(BUILD_SYCL_MODULE "Build SYCL module with Intel oneAPI" OFF) if(BUILD_SYCL_MODULE) set(OPEN3D_SYCL_TARGETS "spir64" CACHE STRING diff --git a/cpp/pybind/make_python_package.cmake b/cpp/pybind/make_python_package.cmake index aa4171414b0..3a21bddbfde 100644 --- a/cpp/pybind/make_python_package.cmake +++ b/cpp/pybind/make_python_package.cmake @@ -122,6 +122,10 @@ if (BUILD_SYCL_MODULE) list(APPEND requirement_files ${PYTHON_PACKAGE_SRC_DIR}/requirements_sycl.txt) endif() +if (BUILD_VISUALIZATION) + list(APPEND requirement_files ${PYTHON_PACKAGE_SRC_DIR}/requirements_viz.txt) +endif() + # These will be installed when the user does `pip install open3d`. execute_process(COMMAND ${CMAKE_COMMAND} -E cat ${requirement_files} OUTPUT_FILE ${PYTHON_PACKAGE_DST_DIR}/requirements.txt diff --git a/docker/Dockerfile.wheel b/docker/Dockerfile.wheel index ef0fc44b955..8460a7996ba 100644 --- a/docker/Dockerfile.wheel +++ b/docker/Dockerfile.wheel @@ -109,6 +109,7 @@ RUN /root/Open3D/util/install_deps_ubuntu.sh assume-yes \ # Open3D Python dependencies COPY ./util/ci_utils.sh /root/Open3D/util/ COPY ./python/requirements.txt /root/Open3D/python/ +COPY ./python/requirements_viz.txt /root/Open3D/python/ COPY ./python/requirements_jupyter_build.txt /root/Open3D/python/ COPY ./python/requirements_jupyter_install.txt /root/Open3D/python/ COPY ./python/requirements_build.txt /root/Open3D/python/ diff --git a/python/requirements_viz.txt b/python/requirements_viz.txt new file mode 100644 index 00000000000..7694cbd6f32 --- /dev/null +++ b/python/requirements_viz.txt @@ -0,0 +1 @@ +dash>=2.6.0 \ No newline at end of file diff --git a/python/setup.py b/python/setup.py index f6aff180437..80801dd7209 100644 --- a/python/setup.py +++ b/python/setup.py @@ -166,6 +166,9 @@ def finalize_options(self): "\n\nThis wheel contains cross-platform GPU support through SYCL.") classifiers.append("Environment :: GPU") +if "@BUILD_VISUALIZATION@" == "OFF": + name += "-headless" + setup_args = dict( name=name, version="@PROJECT_VERSION@", @@ -194,4 +197,7 @@ def finalize_options(self): provides_dist=["open3d", "open3d_cpu", "open3d_xpu"], # For open3d-cpu ) +if "@BUILD_VISUALIZATION@" == "OFF": + setup_args["keywords"] = setup_args["keywords"].replace(" visualization", "") + setup(**setup_args)