From f32e74b26134aff92f7ca5ca3d17e25712c15c2d Mon Sep 17 00:00:00 2001 From: John Wason Date: Sun, 28 Jul 2024 23:04:05 -0400 Subject: [PATCH 1/7] Add macos github action --- .github/workflows/mac.yml | 108 ++++++++++++++++++ .../arm64-osx-dynamic-release.cmake | 9 ++ .../x64-osx-dynamic-release.cmake | 9 ++ 3 files changed, 126 insertions(+) create mode 100644 .github/workflows/mac.yml create mode 100644 .github/workflows/vcpkg_triplets/arm64-osx-dynamic-release.cmake create mode 100644 .github/workflows/vcpkg_triplets/x64-osx-dynamic-release.cmake diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml new file mode 100644 index 00000000..7fafa96d --- /dev/null +++ b/.github/workflows/mac.yml @@ -0,0 +1,108 @@ +name: Mac OSX + +on: + push: + branches: + - master + - 'dev**' + pull_request: + paths: + - 'trajopt**' + - '.github/workflows/mac.yml' + - '**.repos' + schedule: + - cron: '0 5 * * *' + release: + types: + - released + +env: + VCPKG_PKGS: >- + boost-dll boost-program-options boost-stacktrace + boost-serialization boost-filesystem + tinyxml2 console-bridge assimp + urdfdom octomap orocos-kdl pcl + gtest benchmark flann jsoncpp + yaml-cpp eigen3 + openblas + fcl ompl taskflow + bullet3[multithreading,double-precision,rtti] + ccd[double-precision] gperftools + +jobs: + build-macos: + strategy: + fail-fast: false + matrix: + config: + - runner: macos-12 + vcpkg_triplet: x64-osx-dynamic-release + arch: x64 + homebrew_root: /usr/local + - runner: macos-14 + vcpkg_triplet: arm64-osx-dynamic-release + arch: arm64 + homebrew_root: /opt/homebrew + runs-on: ${{ matrix.config.runner }} + steps: + - uses: actions/checkout@v2 + with: + path: ws/src/trajopt + - uses: actions/setup-python@v4 + id: setup-python + with: + python-version: '3.12' + - name: brew + run: | + brew install libomp cmake automake autoconf libtool gcc ninja + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: '3.28.x' + - name: vcpkg build + uses: johnwason/vcpkg-action@v6 + with: + pkgs: >- + ${{ env.VCPKG_PKGS }} + triplet: ${{ matrix.config.vcpkg_triplet }} + extra-args: --clean-after-build --overlay-triplets=${{ github.workspace }}/ws/src/trajopt/.github/workflows/vcpkg_triplets + token: ${{ github.token }} + cache-key: osx-${{ matrix.config.arch }}-vcpkg + revision: master + github-binarycache: true + - name: pip3 + run: | + python3 -m pip install numpy setuptools wheel pytest delvewheel colcon-common-extensions vcstool + - name: vcs import + working-directory: ws/src + run: vcs import --input trajopt/.github/workflows/windows_dependencies.repos + - name: colcon build + working-directory: ws + run: | + export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GITHUB_WORKSPACE/vcpkg/installed/${{ matrix.config.vcpkg_triplet }}/lib + export CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/vcpkg/installed/${{ matrix.config.vcpkg_triplet }} + + colcon build --merge-install \ + --packages-ignore tesseract_examples trajopt_ifopt trajopt_sqp ifopt vhacd tesseract_python \ + --event-handlers console_cohesion+ \ + --cmake-force-configure \ + --cmake-args -GNinja -DCMAKE_BUILD_TYPE=Release \ + -DINSTALL_OMPL=OFF -DINSTALL_OMPL_TAG=master -DBUILD_IPOPT=OFF -DBUILD_SNOPT=OFF \ + -DBUILD_SHARED_LIBS=ON -DTESSERACT_ENABLE_EXAMPLES=OFF \ + -DVCPKG_APPLOCAL_DEPS=OFF -DTRAJOPT_ENABLE_TESTING=ON \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \ + -DOpenMP_CXX_INCLUDE_DIR=${{ matrix.config.homebrew_root }}/opt/libomp/include \ + -DOpenMP_C_INCLUDE_DIR=${{ matrix.config.homebrew_root }}/opt/libomp/include \ + -DOpenMP_CXX_LIB_NAMES=libomp -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp" \ + -DOpenMP_C_LIB_NAMES=libomp -DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp" \ + -DOpenMP_libomp_LIBRARY=${{ matrix.config.homebrew_root }}/opt/libomp/lib/libomp.dylib + - name: colcon test + working-directory: ws + run: | + export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GITHUB_WORKSPACE/vcpkg/installed/${{ matrix.config.vcpkg_triplet }}/lib + export CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/vcpkg/installed/${{ matrix.config.vcpkg_triplet }} + + colcon test --merge-install \ + --packages-ignore tesseract_examples trajopt_ifopt trajopt_sqp ifopt vhacd tesseract_python \ + --event-handlers console_cohesion+ + diff --git a/.github/workflows/vcpkg_triplets/arm64-osx-dynamic-release.cmake b/.github/workflows/vcpkg_triplets/arm64-osx-dynamic-release.cmake new file mode 100644 index 00000000..9ff5889f --- /dev/null +++ b/.github/workflows/vcpkg_triplets/arm64-osx-dynamic-release.cmake @@ -0,0 +1,9 @@ +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) + +set(VCPKG_CMAKE_SYSTEM_NAME Darwin) +set(VCPKG_OSX_ARCHITECTURES arm64) + +set(VCPKG_BUILD_TYPE release) +set(VCPKG_OSX_DEPLOYMENT_TARGET 14.0) diff --git a/.github/workflows/vcpkg_triplets/x64-osx-dynamic-release.cmake b/.github/workflows/vcpkg_triplets/x64-osx-dynamic-release.cmake new file mode 100644 index 00000000..1e296987 --- /dev/null +++ b/.github/workflows/vcpkg_triplets/x64-osx-dynamic-release.cmake @@ -0,0 +1,9 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) + +set(VCPKG_CMAKE_SYSTEM_NAME Darwin) +set(VCPKG_OSX_ARCHITECTURES x86_64) + +set(VCPKG_BUILD_TYPE release) +set(VCPKG_OSX_DEPLOYMENT_TARGET 12.0) From f5f16231fb6c477c2d3650c40d19cd1dc70dc81f Mon Sep 17 00:00:00 2001 From: John Wason Date: Mon, 29 Jul 2024 00:19:17 -0400 Subject: [PATCH 2/7] Include boost-format vcpkg package in mac github action --- .github/workflows/mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 7fafa96d..8cd717c0 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -19,7 +19,7 @@ on: env: VCPKG_PKGS: >- boost-dll boost-program-options boost-stacktrace - boost-serialization boost-filesystem + boost-serialization boost-filesystem boost-format tinyxml2 console-bridge assimp urdfdom octomap orocos-kdl pcl gtest benchmark flann jsoncpp From 692196f21c326e462fbfdfb4586764038f79df55 Mon Sep 17 00:00:00 2001 From: John Wason Date: Mon, 29 Jul 2024 00:38:27 -0400 Subject: [PATCH 3/7] Fix libqpOASES.3.2.dylib rpath nightmare on mac os --- trajopt_ext/qpoases/patch_qpoases.cmake | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/trajopt_ext/qpoases/patch_qpoases.cmake b/trajopt_ext/qpoases/patch_qpoases.cmake index 733f197b..026a78d9 100644 --- a/trajopt_ext/qpoases/patch_qpoases.cmake +++ b/trajopt_ext/qpoases/patch_qpoases.cmake @@ -1,12 +1,12 @@ file(READ CMakeLists.txt ROOT_FILE) string( REPLACE "MESSAGE(FATAL_ERROR \"Compiling qpOASES as a shared library in Windows is not supported.\")" - "set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)\ninclude(GNUInstallDirs)" + "set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)\nENDIF()\ninclude(GNUInstallDirs)\nIF(0)\n" ROOT_FILE2 ${ROOT_FILE}) -string( - REPLACE "SET(CMAKE_INSTALL_BINDIR \${CMAKE_INSTALL_LIBDIR})" - "" - ROOT_FILE3 - ${ROOT_FILE2}) -file(WRITE CMakeLists.txt ${ROOT_FILE3}) +string(REGEX REPLACE "SET\\(CMAKE_INSTALL[^\r\n]*\\)" "" ROOT_FILE3 ${ROOT_FILE2}) +string(REGEX REPLACE "set\\([^\r\n]*RPATH[^\r\n]*\\)" "" ROOT_FILE4 ${ROOT_FILE3}) +string(REGEX REPLACE "SET\\([^\r\n]*OUTPUT_PATH[^\r\n]*\\)" "" ROOT_FILE5 ${ROOT_FILE4}) +string(REPLACE "cmake_minimum_required(VERSION 2.6)" "cmake_minimum_required(VERSION 3.10.0)" ROOT_FILE6 ${ROOT_FILE5}) + +file(WRITE CMakeLists.txt ${ROOT_FILE6}) From a94a12bf6efa060f96b06fd0269d0af5c1c1b709 Mon Sep 17 00:00:00 2001 From: John Wason Date: Mon, 29 Jul 2024 00:45:35 -0400 Subject: [PATCH 4/7] Include in trajopt/typedefs.hpp --- trajopt/include/trajopt/typedefs.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/trajopt/include/trajopt/typedefs.hpp b/trajopt/include/trajopt/typedefs.hpp index d42da492..ad262d50 100644 --- a/trajopt/include/trajopt/typedefs.hpp +++ b/trajopt/include/trajopt/typedefs.hpp @@ -4,6 +4,7 @@ TRAJOPT_IGNORE_WARNINGS_PUSH #include #include #include +#include TRAJOPT_IGNORE_WARNINGS_POP #include From 835d1bcc9157f083cd4cada85287d6e0022d31ce Mon Sep 17 00:00:00 2001 From: John Wason Date: Mon, 29 Jul 2024 00:56:45 -0400 Subject: [PATCH 5/7] Disable warnings as errors for mac os github action --- .github/workflows/mac.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 8cd717c0..7f5f1d4e 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -95,7 +95,8 @@ jobs: -DOpenMP_C_INCLUDE_DIR=${{ matrix.config.homebrew_root }}/opt/libomp/include \ -DOpenMP_CXX_LIB_NAMES=libomp -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp" \ -DOpenMP_C_LIB_NAMES=libomp -DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp" \ - -DOpenMP_libomp_LIBRARY=${{ matrix.config.homebrew_root }}/opt/libomp/lib/libomp.dylib + -DOpenMP_libomp_LIBRARY=${{ matrix.config.homebrew_root }}/opt/libomp/lib/libomp.dylib \ + -DTESSERACT_WARNINGS_AS_ERRORS=OFF - name: colcon test working-directory: ws run: | From 4c8b0be5998e9ee1c963490e54d6bf4908a422bc Mon Sep 17 00:00:00 2001 From: John Wason Date: Mon, 29 Jul 2024 14:26:20 -0400 Subject: [PATCH 6/7] Remove TESSERACT_WARNINGS_AS_ERRORS=OFF in action --- .github/workflows/mac.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 7f5f1d4e..8cd717c0 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -95,8 +95,7 @@ jobs: -DOpenMP_C_INCLUDE_DIR=${{ matrix.config.homebrew_root }}/opt/libomp/include \ -DOpenMP_CXX_LIB_NAMES=libomp -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp" \ -DOpenMP_C_LIB_NAMES=libomp -DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp" \ - -DOpenMP_libomp_LIBRARY=${{ matrix.config.homebrew_root }}/opt/libomp/lib/libomp.dylib \ - -DTESSERACT_WARNINGS_AS_ERRORS=OFF + -DOpenMP_libomp_LIBRARY=${{ matrix.config.homebrew_root }}/opt/libomp/lib/libomp.dylib - name: colcon test working-directory: ws run: | From 1815a0889320569461bec3a035486ffad164110e Mon Sep 17 00:00:00 2001 From: John Wason Date: Tue, 30 Jul 2024 14:54:24 -0400 Subject: [PATCH 7/7] code format --- trajopt_ext/qpoases/patch_qpoases.cmake | 27 +++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/trajopt_ext/qpoases/patch_qpoases.cmake b/trajopt_ext/qpoases/patch_qpoases.cmake index 026a78d9..e2a8185e 100644 --- a/trajopt_ext/qpoases/patch_qpoases.cmake +++ b/trajopt_ext/qpoases/patch_qpoases.cmake @@ -4,9 +4,28 @@ string( "set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)\nENDIF()\ninclude(GNUInstallDirs)\nIF(0)\n" ROOT_FILE2 ${ROOT_FILE}) -string(REGEX REPLACE "SET\\(CMAKE_INSTALL[^\r\n]*\\)" "" ROOT_FILE3 ${ROOT_FILE2}) -string(REGEX REPLACE "set\\([^\r\n]*RPATH[^\r\n]*\\)" "" ROOT_FILE4 ${ROOT_FILE3}) -string(REGEX REPLACE "SET\\([^\r\n]*OUTPUT_PATH[^\r\n]*\\)" "" ROOT_FILE5 ${ROOT_FILE4}) -string(REPLACE "cmake_minimum_required(VERSION 2.6)" "cmake_minimum_required(VERSION 3.10.0)" ROOT_FILE6 ${ROOT_FILE5}) +string( + REGEX + REPLACE "SET\\(CMAKE_INSTALL[^\r\n]*\\)" + "" + ROOT_FILE3 + ${ROOT_FILE2}) +string( + REGEX + REPLACE "set\\([^\r\n]*RPATH[^\r\n]*\\)" + "" + ROOT_FILE4 + ${ROOT_FILE3}) +string( + REGEX + REPLACE "SET\\([^\r\n]*OUTPUT_PATH[^\r\n]*\\)" + "" + ROOT_FILE5 + ${ROOT_FILE4}) +string( + REPLACE "cmake_minimum_required(VERSION 2.6)" + "cmake_minimum_required(VERSION 3.10.0)" + ROOT_FILE6 + ${ROOT_FILE5}) file(WRITE CMakeLists.txt ${ROOT_FILE6})