From 9d470e87a570f055653e70c44169d62ddb15578b Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Wed, 1 Mar 2023 16:44:13 -0500 Subject: [PATCH 1/8] install boost for Ubuntu with apt --- .github/scripts/boost.sh | 18 ------------------ .github/workflows/build-linux.yml | 3 +-- .github/workflows/build-special.yml | 3 +-- 3 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 .github/scripts/boost.sh diff --git a/.github/scripts/boost.sh b/.github/scripts/boost.sh deleted file mode 100644 index 3c7e01274..000000000 --- a/.github/scripts/boost.sh +++ /dev/null @@ -1,18 +0,0 @@ -### Script to install Boost -BOOST_FOLDER=boost_${BOOST_VERSION//./_} - -# Download Boost -wget https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/${BOOST_FOLDER}.tar.gz - -# Unzip -tar -zxf ${BOOST_FOLDER}.tar.gz - -# Bootstrap -cd ${BOOST_FOLDER}/ -./bootstrap.sh --with-libraries=serialization,filesystem,thread,system,atomic,date_time,timer,chrono,program_options,regex - -# Build and install -sudo ./b2 -j$(nproc) install - -# Rebuild ld cache -sudo ldconfig diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index b678a71db..c801bb275 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -12,7 +12,6 @@ jobs: CTEST_PARALLEL_LEVEL: 2 CMAKE_BUILD_TYPE: ${{ matrix.build_type }} GTSAM_BUILD_UNSTABLE: ${{ matrix.build_unstable }} - BOOST_VERSION: 1.67.0 strategy: fail-fast: true @@ -82,7 +81,7 @@ jobs: - name: Install Boost run: | - bash .github/scripts/boost.sh + sudo apt-get -y install libboost-all-dev - name: Build and Test run: bash .github/scripts/unix.sh -t diff --git a/.github/workflows/build-special.yml b/.github/workflows/build-special.yml index 7582bf41c..02d19668c 100644 --- a/.github/workflows/build-special.yml +++ b/.github/workflows/build-special.yml @@ -12,7 +12,6 @@ jobs: CTEST_PARALLEL_LEVEL: 2 CMAKE_BUILD_TYPE: ${{ matrix.build_type }} GTSAM_BUILD_UNSTABLE: ON - BOOST_VERSION: 1.67.0 strategy: fail-fast: false @@ -100,7 +99,7 @@ jobs: - name: Install Boost if: runner.os == 'Linux' run: | - bash .github/scripts/boost.sh + sudo apt-get -y install libboost-all-dev - name: Install (macOS) if: runner.os == 'macOS' From d66b8b4fee56a70b94450afb6a4ac5e22b90f71a Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Wed, 1 Mar 2023 17:18:04 -0500 Subject: [PATCH 2/8] remove old boost specific flags --- .github/scripts/unix.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/scripts/unix.sh b/.github/scripts/unix.sh index 1676ad537..e497d4764 100644 --- a/.github/scripts/unix.sh +++ b/.github/scripts/unix.sh @@ -72,8 +72,6 @@ function configure() -DGTSAM_USE_SYSTEM_METIS=${GTSAM_USE_SYSTEM_METIS:-OFF} \ -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \ -DGTSAM_SINGLE_TEST_EXE=OFF \ - -DBOOST_ROOT=$BOOST_ROOT \ - -DBoost_NO_SYSTEM_PATHS=ON \ -DBoost_ARCHITECTURE=-x64 } From 32e266d5ab1cc56481743f5412cc6f84261453b5 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Wed, 1 Mar 2023 18:01:37 -0500 Subject: [PATCH 3/8] remove redundant cmake flag in unix.sh and set max processes for linux to 4 --- .github/scripts/unix.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/scripts/unix.sh b/.github/scripts/unix.sh index e497d4764..67881921c 100644 --- a/.github/scripts/unix.sh +++ b/.github/scripts/unix.sh @@ -71,8 +71,7 @@ function configure() -DGTSAM_USE_SYSTEM_EIGEN=${GTSAM_USE_SYSTEM_EIGEN:-OFF} \ -DGTSAM_USE_SYSTEM_METIS=${GTSAM_USE_SYSTEM_METIS:-OFF} \ -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \ - -DGTSAM_SINGLE_TEST_EXE=OFF \ - -DBoost_ARCHITECTURE=-x64 + -DGTSAM_SINGLE_TEST_EXE=OFF } @@ -95,7 +94,7 @@ function build () if [ "$(uname)" == "Linux" ]; then if (($(nproc) > 2)); then - make -j$(nproc) + make -j4 else make -j2 fi From e0ac295ebfa79da5c577f7cbeca1b439d64e04f2 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Wed, 1 Mar 2023 18:01:44 -0500 Subject: [PATCH 4/8] format Python CI yaml file --- .github/workflows/build-python.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build-python.yml b/.github/workflows/build-python.yml index 442e26e47..f09d589dc 100644 --- a/.github/workflows/build-python.yml +++ b/.github/workflows/build-python.yml @@ -53,6 +53,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - name: Install (Linux) if: runner.os == 'Linux' run: | @@ -79,6 +80,7 @@ jobs: echo "CC=clang-${{ matrix.version }}" >> $GITHUB_ENV echo "CXX=clang++-${{ matrix.version }}" >> $GITHUB_ENV fi + - name: Install (macOS) if: runner.os == 'macOS' run: | @@ -88,22 +90,27 @@ jobs: sudo xcode-select -switch /Applications/Xcode.app echo "CC=clang" >> $GITHUB_ENV echo "CXX=clang++" >> $GITHUB_ENV + - name: Set GTSAM_WITH_TBB Flag if: matrix.flag == 'tbb' run: | echo "GTSAM_WITH_TBB=ON" >> $GITHUB_ENV echo "GTSAM Uses TBB" + - name: Set Swap Space if: runner.os == 'Linux' uses: pierotofy/set-swap-space@master with: swap-size-gb: 6 + - name: Install Dependencies run: | bash .github/scripts/python.sh -d + - name: Build run: | bash .github/scripts/python.sh -b + - name: Test run: | bash .github/scripts/python.sh -t From 62cf5bff97286f4137b5996dcf236dbaaf748bfa Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Fri, 3 Mar 2023 12:46:59 -0500 Subject: [PATCH 5/8] don't print warnings to CI --- .github/scripts/unix.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/scripts/unix.sh b/.github/scripts/unix.sh index 67881921c..af9ac8991 100644 --- a/.github/scripts/unix.sh +++ b/.github/scripts/unix.sh @@ -58,8 +58,10 @@ function configure() fi # GTSAM_BUILD_WITH_MARCH_NATIVE=OFF: to avoid crashes in builder VMs + # CMAKE_CXX_FLAGS="-w": Suppress warnings to avoid IO latency in CI logs cmake $SOURCE_DIR \ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Debug} \ + -DCMAKE_CXX_FLAGS="-w" \ -DGTSAM_BUILD_TESTS=${GTSAM_BUILD_TESTS:-OFF} \ -DGTSAM_BUILD_UNSTABLE=${GTSAM_BUILD_UNSTABLE:-ON} \ -DGTSAM_WITH_TBB=${GTSAM_WITH_TBB:-OFF} \ From c42ea14ce1273f3749e573bd3922728557e3e468 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Fri, 3 Mar 2023 12:48:04 -0500 Subject: [PATCH 6/8] increase swap space for special builds --- .github/workflows/build-special.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-special.yml b/.github/workflows/build-special.yml index 02d19668c..fda1c2b91 100644 --- a/.github/workflows/build-special.yml +++ b/.github/workflows/build-special.yml @@ -92,9 +92,15 @@ jobs: sudo apt-get -y install cmake build-essential pkg-config libpython3-dev python3-numpy libicu-dev - sudo apt-get install -y clang-${{ matrix.version }} g++-multilib - echo "CC=clang-${{ matrix.version }}" >> $GITHUB_ENV - echo "CXX=clang++-${{ matrix.version }}" >> $GITHUB_ENV + if [ "${{ matrix.compiler }}" = "gcc" ]; then + sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib + echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV + echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV + else + sudo apt-get install -y clang-${{ matrix.version }} g++-multilib + echo "CC=clang-${{ matrix.version }}" >> $GITHUB_ENV + echo "CXX=clang++-${{ matrix.version }}" >> $GITHUB_ENV + fi - name: Install Boost if: runner.os == 'Linux' @@ -150,6 +156,12 @@ jobs: echo "GTSAM_USE_BOOST_FEATURES=OFF" >> $GITHUB_ENV echo "GTSAM will not use BOOST" + - name: Set Swap Space + if: runner.os == 'Linux' + uses: pierotofy/set-swap-space@master + with: + swap-size-gb: 12 + - name: Build & Test run: | bash .github/scripts/unix.sh -t From 0e6be7393b090e841811d27eb43adc2f70acf11e Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Fri, 3 Mar 2023 12:48:28 -0500 Subject: [PATCH 7/8] remove redundant push action from build-linux --- .github/workflows/build-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index c801bb275..129b5aaaf 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -1,6 +1,6 @@ name: Linux CI -on: [push, pull_request] +on: [pull_request] jobs: build: From a8aac45fd6dfa53c11301ec32ebb56f0601a91fd Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Fri, 3 Mar 2023 12:48:52 -0500 Subject: [PATCH 8/8] create shared library for special builds to save memory --- .github/scripts/unix.sh | 1 + .github/workflows/build-special.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/scripts/unix.sh b/.github/scripts/unix.sh index af9ac8991..c48921504 100644 --- a/.github/scripts/unix.sh +++ b/.github/scripts/unix.sh @@ -72,6 +72,7 @@ function configure() -DGTSAM_POSE3_EXPMAP=${GTSAM_POSE3_EXPMAP:-ON} \ -DGTSAM_USE_SYSTEM_EIGEN=${GTSAM_USE_SYSTEM_EIGEN:-OFF} \ -DGTSAM_USE_SYSTEM_METIS=${GTSAM_USE_SYSTEM_METIS:-OFF} \ + -DGTSAM_FORCE_SHARED_LIB=${GTSAM_FORCE_SHARED_LIB:-OFF} \ -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \ -DGTSAM_SINGLE_TEST_EXE=OFF } diff --git a/.github/workflows/build-special.yml b/.github/workflows/build-special.yml index fda1c2b91..0d1cd5bdd 100644 --- a/.github/workflows/build-special.yml +++ b/.github/workflows/build-special.yml @@ -12,6 +12,7 @@ jobs: CTEST_PARALLEL_LEVEL: 2 CMAKE_BUILD_TYPE: ${{ matrix.build_type }} GTSAM_BUILD_UNSTABLE: ON + GTSAM_FORCE_SHARED_LIB: ON # Make shared library to save memory on CI strategy: fail-fast: false