diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ae6f134..28778215 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,12 +17,14 @@ jobs: strategy: matrix: DISTRO: [ + { "ubuntu": "noble", "suffix": "gcc" }, + { "ubuntu": "noble", "suffix": "llvm" }, { "ubuntu": "jammy", "suffix": "gcc" }, { "ubuntu": "jammy", "suffix": "llvm" }, { "ubuntu": "jammy_cuda12.2", "suffix": "gcc.cuda" }, { "ubuntu": "jammy_cuda12.2", "suffix": "llvm.cuda" }, - { "ubuntu": "noble", "suffix": "gcc" }, - { "ubuntu": "noble", "suffix": "llvm" } + { "ubuntu": "focal", "suffix": "focal" }, + { "ubuntu": "focal_cuda12.2", "suffix": "focal.cuda" }, ] steps: diff --git a/CMakeLists.txt b/CMakeLists.txt index c86f6dda..2b8b6621 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ find_package(GTSAM REQUIRED) find_package(OpenMP REQUIRED) find_package(Eigen3 REQUIRED) -if(${BUILD_WITH_CUDA} AND ${EIGEN3_VERSION_STRING} VERSION_LESS "3.3.90") +if(${BUILD_WITH_CUDA} AND ${EIGEN3_VERSION_STRING} AND ${EIGEN3_VERSION_STRING} VERSION_LESS "3.3.90") message(WARNING "Detected Eigen ${EIGEN3_VERSION_STRING} is not compatible with CUDA") message(WARNING "Use Eigen 3.3.90 or later (3.4.0 is recommended)") endif() diff --git a/docker/ubuntu/Dockerfile.focal b/docker/ubuntu/Dockerfile.focal new file mode 100644 index 00000000..1b92be9b --- /dev/null +++ b/docker/ubuntu/Dockerfile.focal @@ -0,0 +1,28 @@ +ARG BASE_IMAGE=koide3/gtsam_docker:focal + +FROM ${BASE_IMAGE} + +RUN test -f /usr/share/doc/kitware-archive-keyring/copyright || wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null +RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null +RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal-rc main' | tee -a /etc/apt/sources.list.d/kitware.list >/dev/null + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-fast clean \ + && rm -rf /var/lib/apt/lists/* + +COPY . /root/gtsam_points +WORKDIR /root/gtsam_points/build +RUN rm -rf * +RUN cmake .. \ + -DBUILD_DEMO=ON \ + -DBUILD_TESTS=ON \ + -DBUILD_EXAMPLE=ON \ + -DBUILD_WITH_CUDA=OFF \ + -DCMAKE_BUILD_TYPE=Release && \ + make -j$(nproc) && \ + make test && \ + make install && \ + rm -rf /root/gtsam_points/build + +CMD ["bash"] diff --git a/docker/ubuntu/Dockerfile.focal.cuda b/docker/ubuntu/Dockerfile.focal.cuda new file mode 100644 index 00000000..90acd3af --- /dev/null +++ b/docker/ubuntu/Dockerfile.focal.cuda @@ -0,0 +1,36 @@ +ARG BASE_IMAGE=koide3/gtsam_docker:focal_cuda12.2 + +FROM ${BASE_IMAGE} + +RUN test -f /usr/share/doc/kitware-archive-keyring/copyright || wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null +RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null +RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal-rc main' | tee -a /etc/apt/sources.list.d/kitware.list >/dev/null + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-fast clean \ + && rm -rf /var/lib/apt/lists/* + +# System eigen on focal is too old. +# Install Eigen that is newer but compatible with 3.3.7 used by GTSAM. +RUN git clone https://gitlab.com/libeigen/eigen.git +WORKDIR /root/eigen +RUN git checkout 1fd5ce1 +WORKDIR /root/eigen/build +RUN cmake .. && make install + +COPY . /root/gtsam_points +WORKDIR /root/gtsam_points/build +RUN rm -rf * +RUN cmake .. \ + -DBUILD_DEMO=ON \ + -DBUILD_TESTS=ON \ + -DBUILD_EXAMPLE=ON \ + -DBUILD_WITH_CUDA=ON \ + -DBUILD_WITH_CUDA_MULTIARCH=ON \ + -DCMAKE_BUILD_TYPE=Release && \ + make -j$(nproc) && \ + make install && \ + rm -rf /root/gtsam_points/build + +CMD ["bash"] diff --git a/docker/ubuntu/Dockerfile.gcc.cuda b/docker/ubuntu/Dockerfile.gcc.cuda index c7d099e5..0bdc587d 100644 --- a/docker/ubuntu/Dockerfile.gcc.cuda +++ b/docker/ubuntu/Dockerfile.gcc.cuda @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=koide3/gtsam_docker:jammy +ARG BASE_IMAGE=koide3/gtsam_docker:jammy_cuda12.2 FROM ${BASE_IMAGE} diff --git a/docker/ubuntu/Dockerfile.llvm.cuda b/docker/ubuntu/Dockerfile.llvm.cuda index 5d4b8f16..1e220754 100644 --- a/docker/ubuntu/Dockerfile.llvm.cuda +++ b/docker/ubuntu/Dockerfile.llvm.cuda @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=koide3/gtsam_docker:jammy +ARG BASE_IMAGE=koide3/gtsam_docker:jammy_cuda12.2 FROM ${BASE_IMAGE} diff --git a/include/gtsam_points/ann/small_kdtree.hpp b/include/gtsam_points/ann/small_kdtree.hpp index 8fa409da..55d46990 100644 --- a/include/gtsam_points/ann/small_kdtree.hpp +++ b/include/gtsam_points/ann/small_kdtree.hpp @@ -39,6 +39,7 @@ *************************************************************************/ #pragma once +#include #include #include #include