Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support to build debian package #7178

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ubuntu-cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,23 +149,23 @@ jobs:
--command="sudo Open3D/docker/docker_build.sh ${CI_CONFIG}${RELEASE_TAG:-}"
if [ "${BUILD_PACKAGE}" == 'true' ]; then
gcloud compute scp --zone="${GCE_ZONE}" \
"${INSTANCE_NAME}":open3d-devel-linux*.tar.xz "$PWD"
"${INSTANCE_NAME}":open3d-devel-linux* "$PWD"
fi

- name: Upload package
if: ${{ env.BUILD_PACKAGE == 'true' }}
uses: actions/upload-artifact@v4
with:
name: open3d-devel-linux-x86_64-cuda-${{ matrix.CI_CONFIG }}
path: open3d-devel-linux*.tar.xz
path: open3d-devel-linux*
if-no-files-found: error

- name: Update devel release
if: ${{ github.ref == 'refs/heads/main' && env.BUILD_PACKAGE == 'true' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload main-devel open3d-devel-linux-*.tar.xz --clobber
gh release upload main-devel open3d-devel-linux-* --clobber
gh release view main-devel

- name: VM run docker
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu-sycl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
name: open3d-sycl-linux-wheel-and-binary
path: |
open3d-*.whl
open3d-devel-*.tar.xz
open3d-devel-*
if-no-files-found: error
- name: Update devel release
if: ${{ github.ref == 'refs/heads/main' && matrix.BUILD_SHARED_LIBS == 'ON' }}
Expand All @@ -71,7 +71,7 @@ jobs:
run: |
if [ ${{ matrix.BUILD_SHARED_LIBS }} == 'ON' ] ; then
gh release upload main-devel open3d-*.whl --clobber
gh release upload main-devel open3d-devel-*.tar.xz --clobber
gh release upload main-devel open3d-devel-* --clobber
fi
gh release view main-devel
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: open3d-devel-linux-x86_64-ML_${{ matrix.MLOPS }}
path: open3d-devel-*.tar.xz
path: open3d-devel-*
if-no-files-found: error
- name: Upload viewer to GitHub artifacts
if: ${{ env.BUILD_SHARED_LIBS == 'OFF' }}
Expand All @@ -96,7 +96,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
if [ ${BUILD_SHARED_LIBS} == 'ON' ] ; then
gh release upload main-devel open3d-devel-*.tar.xz --clobber
gh release upload main-devel open3d-devel-* --clobber
else
gh release upload main-devel open3d-viewer-*-Linux.deb --clobber
fi
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ else()
set(Open3D_INSTALL_RESOURCE_DIR bin)
set(Open3D_INSTALL_CMAKE_DIR CMake)
endif()
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "dev")

# Put build results in some predictable places
# The $<CONFIG> generator expression makes sure that XCode or Visual Studio do not
Expand Down
18 changes: 18 additions & 0 deletions cmake/Open3DPackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,22 @@ set(CPACK_PACKAGE_FILE_NAME
"open3d-devel-${_sys}-${OPEN3D_VERSION_FULL}")
set(CPACK_THREADS 0) # Use all cores for compressing package

find_program(DPKG_PROGRAM dpkg)
if (EXISTS ${DPKG_PROGRAM})
list(APPEND CPACK_GENERATOR DEB)
set(CPACK_SET_DESTDIR ON)
set(CPACK_INSTALL_PREFIX /usr/local)
set(CPACK_COMPONENTS_ALL "dev")
set(CPACK_DEBIAN_DEV_PACKAGE_NAME "open3d-devel-${_sys}")
set(CPACK_DEBIAN_PACKAGE_VERSION ${OPEN3D_VERSION_FULL})
execute_process(COMMAND ${DPKG_PROGRAM} --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEB_COMPONENT_INSTALL ON)
endif()


include(CPack)
2 changes: 1 addition & 1 deletion cpp/open3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
install(FILES
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Open3DConfig.cmake"
"${PROJECT_BINARY_DIR}/Open3DConfigVersion.cmake"
DESTINATION "${Open3D_INSTALL_CMAKE_DIR}" COMPONENT dev)
DESTINATION "${Open3D_INSTALL_CMAKE_DIR}")

# Install GUI resources
if (BUILD_GUI)
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ RUN ccache -s \
&& CCACHE_DIR_PARENT=$(dirname ${CCACHE_DIR}) \
&& cd ${CCACHE_DIR_PARENT} \
&& tar -caf /${CCACHE_TAR_NAME}.tar.xz ${CCACHE_DIR_NAME} \
&& if [[ "${PACKAGE}" = "ON" ]]; then mv /root/Open3D/build/package/open3d-devel*.tar.xz /; fi \
&& if [[ "${PACKAGE}" = "ON" ]]; then mv /root/Open3D/build/package/open3d-devel* /; fi \
&& if [[ "${PACKAGE}" = "VIEWER" ]]; then mv /root/Open3D/build/package-Open3DViewer-deb/open3d-viewer-*-Linux.deb /; fi \
&& if [[ "${BUILD_SYCL_MODULE}" = "ON" && "${BUILD_SHARED_LIBS}" = "ON" ]]; then mv /root/Open3D/build/lib/python_package/pip_package/open3d*.whl /; fi \
&& ls -alh /
Expand Down