From 466b1d32cb4a1bcb9aa4900d82c6b9d6e1bc11ec Mon Sep 17 00:00:00 2001 From: Koen Schmeets Date: Sat, 8 Feb 2025 19:01:50 +0100 Subject: [PATCH 1/8] Update boost url --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 3d7f51b0..61c34f2f 100755 --- a/install.sh +++ b/install.sh @@ -2,8 +2,8 @@ set -e -boost_url="https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.gz" -boost_additional_versions="1.81.0;1.80.0;1.79.0;1.78.0;1.77.0;1.76.0;1.75.0;1.74.0;1.73.0;1.72.0;1.71.0;1.70.0" +boost_url="https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz" +boost_additional_versions="1.87.0;1.86.0;1.85.0;1.84.0;1.83.0;1.82.0;1.81.0;1.80.0;1.79.0;1.78.0;1.77.0;1.76.0;1.75.0;1.74.0;1.73.0;1.72.0;1.71.0;1.70.0" project_dir=$(pwd) print_help() { From 40d0041e6941a88687b2d7231f9ed3e5de2a476c Mon Sep 17 00:00:00 2001 From: Koen Schmeets Date: Sat, 8 Feb 2025 19:04:43 +0100 Subject: [PATCH 2/8] dir --- install.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 61c34f2f..36fc95b3 100755 --- a/install.sh +++ b/install.sh @@ -3,6 +3,7 @@ set -e boost_url="https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz" +boost_dir="boost_1_87_0" boost_additional_versions="1.87.0;1.86.0;1.85.0;1.84.0;1.83.0;1.82.0;1.81.0;1.80.0;1.79.0;1.78.0;1.77.0;1.76.0;1.75.0;1.74.0;1.73.0;1.72.0;1.71.0;1.70.0" project_dir=$(pwd) @@ -267,12 +268,12 @@ download_boost() { tar -zxf "${TMPDIR:-"/tmp"}/boost.tar.gz" -C . prettyprint "Applying boost-python-3.11.patch" - git apply --ignore-space-change --ignore-whitespace --directory "boost_1_80_0/libs/python" "${project_dir}/.github/patches/boost-python-3.11.patch" + git apply --ignore-space-change --ignore-whitespace --directory "${boost_dir}/libs/python" "${project_dir}/.github/patches/boost-python-3.11.patch" } compile_boost_python() { boost_variant="${build_type_lower}" - cd "${project_dir}/boost_1_80_0" + cd "${project_dir}/${boost_dir}" if [ -n "${OCL_BOOST_WITH_PYTHON}" ]; then if [ -n "${OCL_PYTHON_EXECUTABLE}" ]; then python_version=$(${OCL_PYTHON_EXECUTABLE} -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}".format(*version))') @@ -312,8 +313,8 @@ compile_boost_python() { install_boost () { cd "${project_dir}" - if [ -d boost_1_80_0 ]; then - # boost folder already exists, re-unsing + if [ -d "${boost_dir}" ]; then + # boost folder already exists, re-using prettyprint "Boost already found, re-using..." elif [ -f boost-precompiled.tar.gz ]; then # boost-precompiled.tar.gz found, re-using From 77ac688883f80eb36c2707ff7d13b4898c41d917 Mon Sep 17 00:00:00 2001 From: Koen Schmeets Date: Sat, 8 Feb 2025 19:05:48 +0100 Subject: [PATCH 3/8] Remove patch --- install.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/install.sh b/install.sh index 36fc95b3..10a63e3d 100755 --- a/install.sh +++ b/install.sh @@ -266,9 +266,6 @@ download_boost() { fi prettyprint "Extracting boost.tar.gz..." tar -zxf "${TMPDIR:-"/tmp"}/boost.tar.gz" -C . - - prettyprint "Applying boost-python-3.11.patch" - git apply --ignore-space-change --ignore-whitespace --directory "${boost_dir}/libs/python" "${project_dir}/.github/patches/boost-python-3.11.patch" } compile_boost_python() { From 25bf0d5c2b12a9d6dfe70aef328dbec524d9f191 Mon Sep 17 00:00:00 2001 From: Koen Schmeets Date: Sat, 8 Feb 2025 19:10:57 +0100 Subject: [PATCH 4/8] Use Python3_SITEARCH and try to find Boost using CONFIG --- src/CMakeLists.txt | 2 +- src/pythonlib/pythonlib.cmake | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c04ec398..e6d36636 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -130,7 +130,7 @@ if(BUILD_EMSCRIPTEN_LIB) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) endif() -find_package(Boost REQUIRED) +find_package(Boost CONFIG REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) if(BUILD_EMSCRIPTEN_LIB) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/src/pythonlib/pythonlib.cmake b/src/pythonlib/pythonlib.cmake index 8b6cea88..5b5c8c74 100644 --- a/src/pythonlib/pythonlib.cmake +++ b/src/pythonlib/pythonlib.cmake @@ -3,6 +3,7 @@ if(Python3_FOUND) message(STATUS "Found Python: " ${Python3_VERSION}) message(STATUS "Python libraries: " ${Python3_LIBRARIES}) message(STATUS "Python executable: " ${Python3_EXECUTABLE}) + message(STATUS "Python (arch-dependant) module destination: " ${Python3_SITEARCH}) endif() find_package(Boost COMPONENTS python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR} REQUIRED) @@ -41,17 +42,11 @@ if(USE_OPENMP) target_link_libraries(ocl PRIVATE OpenMP::OpenMP_CXX) endif() -execute_process( - COMMAND ${PYTHON_EXECUTABLE} -c "import site; print(site.getsitepackages()[-2])" - OUTPUT_VARIABLE PYTHON_ARCH_PACKAGES - OUTPUT_STRIP_TRAILING_WHITESPACE -) - -install(TARGETS ocl LIBRARY DESTINATION "${PYTHON_ARCH_PACKAGES}/opencamlib") +install(TARGETS ocl LIBRARY DESTINATION "${Python3_SITEARCH}/opencamlib") if(NOT SKBUILD) install( DIRECTORY pythonlib/opencamlib/ - DESTINATION "${PYTHON_ARCH_PACKAGES}/opencamlib" + DESTINATION "${Python3_SITEARCH}/opencamlib" ) endif() From 409b0d11c0d1450c2619c3f7bc92dff47ae9db10 Mon Sep 17 00:00:00 2001 From: Koen Schmeets Date: Sat, 8 Feb 2025 19:14:49 +0100 Subject: [PATCH 5/8] cmake stuff --- src/CMakeLists.txt | 1 + src/gcc_version.cmake | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e6d36636..fd945b26 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,6 +9,7 @@ if(COMMAND cmake_policy) cmake_policy(SET CMP0094 NEW) # for Python*_FIND_STRATEGY=LOCATION cmake_policy(SET CMP0042 NEW) cmake_policy(SET CMP0054 NEW) + cmake_policy(SET CMP0144 NEW) endif(COMMAND cmake_policy) # install targets in root of the build dir, using $<0:> generator expression to force it from not being overwritten diff --git a/src/gcc_version.cmake b/src/gcc_version.cmake index af01bbd9..e85cfa4a 100644 --- a/src/gcc_version.cmake +++ b/src/gcc_version.cmake @@ -3,9 +3,9 @@ if(CMAKE_COMPILER_IS_GNUCXX) - exec_program( - ${CMAKE_CXX_COMPILER} - ARGS --version + execute_process( + COMMAND ${CMAKE_CXX_COMPILER} + ARGS --version OUTPUT_VARIABLE _compiler_output) string(REGEX REPLACE ".*([0-9]\\.[0-9]\\.[0-9]).*" "\\1" gcc_compiler_version From 2bc69ed99b0489260846d4953b64629358810124 Mon Sep 17 00:00:00 2001 From: Koen Schmeets Date: Sat, 8 Feb 2025 19:17:21 +0100 Subject: [PATCH 6/8] Don't use config for now --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fd945b26..eee39166 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -131,7 +131,7 @@ if(BUILD_EMSCRIPTEN_LIB) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) endif() -find_package(Boost CONFIG REQUIRED) +find_package(Boost REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) if(BUILD_EMSCRIPTEN_LIB) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) From 26f980039ba45413df3c5d8459d553aa0e0ca94b Mon Sep 17 00:00:00 2001 From: Koen Schmeets Date: Sat, 8 Feb 2025 19:47:37 +0100 Subject: [PATCH 7/8] update stuff --- .github/workflows/cd.yml | 14 ++++++++------ .github/workflows/test.yml | 12 ++++++------ pyproject.toml | 8 ++++---- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index f60defb9..9fc7a39e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -39,11 +39,11 @@ jobs: architecture: "x64" cmake_generator_platform: "x64" - os_arch: "macos-x86_64" - os: "macos-11.0" + os: "macos-15" os_short: "macos" architecture: "x86_64" - os_arch: "macos-arm64" - os: "macos-11.0" + os: "macos-15" os_short: "macos" architecture: "arm64" - os_arch: linux-x86_64 @@ -122,13 +122,13 @@ jobs: cmake_generator_platform: "x64" node_architecture: "x64" - os_arch: "macos-x86_64" - os: "macos-11.0" + os: "macos-15" os_short: "macos" architecture: "x86_64" node_architecture: "x64" macos_architecture: "x86_64" - os_arch: "macos-arm64" - os: "macos-11.0" + os: "macos-15" os_short: "macos" architecture: "arm64" node_architecture: "arm64" @@ -204,6 +204,8 @@ jobs: "39", "310", "311", + "312", + "313", ] exclude: - os_arch: "macos-arm64" @@ -234,12 +236,12 @@ jobs: # cibuildwheel_architecture: "ARM64" # cmake_generator_platform: "ARM64" - os_arch: "macos-x86_64" - os: "macos-11.0" + os: "macos-15" os_short: "macos" architecture: "x86_64" boost_architecture: "x86" - os_arch: "macos-arm64" - os: "macos-11.0" + os: "macos-15" os_short: "macos" architecture: "arm64" boost_architecture: "arm" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 93836501..7273375a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,11 +20,11 @@ jobs: strategy: fail-fast: false matrix: - os: ["windows-2022", "macos-11.0", "ubuntu-22.04"] + os: ["windows-2022", "macos-15", "ubuntu-22.04"] include: - os: "windows-2022" os_short: "windows" - - os: "macos-11.0" + - os: "macos-15" os_short: "macos" - os: "ubuntu-22.04" os_short: "linux" @@ -53,12 +53,12 @@ jobs: strategy: fail-fast: false matrix: - os: ["windows-2022", "macos-11.0", "ubuntu-22.04"] + os: ["windows-2022", "macos-15", "ubuntu-22.04"] include: - os: "windows-2022" os_short: "windows" libdir: windows-nodejs-x64 - - os: "macos-11.0" + - os: "macos-15" os_short: "macos" libdir: macos-nodejs-x64 - os: "ubuntu-22.04" @@ -91,12 +91,12 @@ jobs: strategy: fail-fast: false matrix: - os: ["windows-2022", "macos-11.0", "ubuntu-22.04"] + os: ["windows-2022", "macos-15", "ubuntu-22.04"] include: - os: "windows-2022" os_short: "windows" python_version: "3.10" - - os: "macos-11.0" + - os: "macos-15" os_short: "macos" python_version: "3.11" - os: "ubuntu-22.04" diff --git a/pyproject.toml b/pyproject.toml index 20be73f3..409539c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,22 +42,22 @@ wheel.packages = ["src/pythonlib/opencamlib"] [tool.scikit-build.cmake.define] BUILD_PY_LIB = "ON" -Boost_ADDITIONAL_VERSIONS = "1.80.0;1.79.0;1.78.0;1.77.0;1.76.0;1.75.0;1.74.0;1.73.0;1.72.0;1.71.0;1.70.0" +Boost_ADDITIONAL_VERSIONS = "1.87.0;1.86.0;1.85.0;1.84.0;1.83.0;1.82.0;1.81.0;1.80.0;1.79.0;1.78.0;1.77.0;1.76.0;1.75.0;1.74.0;1.73.0;1.72.0;1.71.0;1.70.0" BUILD_DOC = "OFF" [tool.cibuildwheel] -build = ["cp37*", "cp38*", "cp39*", "cp310*", "cp311*"] +build = ["cp37*", "cp38*", "cp39*", "cp310*", "cp311*", "cp312*", "cp313*"] skip = ["pp*", "*-musllinux*", "*-manylinux_i686"] [tool.cibuildwheel.windows] -archs = ["AMD64", "x86", "ARM64"] +archs = ["AMD64", "ARM64"] before-all = "cd {package} && bash ./install.sh --install-ci-deps" before-build = "cd {package} && bash ./install.sh --install-boost --boost-with-python --python-executable python" [tool.cibuildwheel.linux] archs = ["x86_64", "aarch64"] before-all = "cd {package} && bash ./install.sh --install-ci-deps" -before-build = "cd {package} && bash ./install.sh --install-boost --boost-with-python --python-executable python && cp --recursive --no-clobber boost_1_80_0 /host/home/runner/work/opencamlib/opencamlib" +before-build = "cd {package} && bash ./install.sh --install-boost --boost-with-python --python-executable python && cp --recursive --no-clobber boost_1_87_0 /host/home/runner/work/opencamlib/opencamlib" [tool.cibuildwheel.macos] archs = ["x86_64", "arm64"] From 08b5143cfe7c4b5e7c599fd5d02e174112e5c796 Mon Sep 17 00:00:00 2001 From: Koen Schmeets Date: Sat, 8 Feb 2025 19:52:38 +0100 Subject: [PATCH 8/8] update --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 10a63e3d..6707fb76 100755 --- a/install.sh +++ b/install.sh @@ -243,9 +243,9 @@ install_ci_dependencies() { elif [ "${determined_os}" = "macos" ]; then prettyprint "Downloading libomp for: " "${OCL_MACOS_ARCHITECTURE}" if [ "${OCL_MACOS_ARCHITECTURE}" = "arm64" ]; then - libomp_tar_loc=$(brew fetch --bottle-tag=arm64_big_sur libomp | grep -i downloaded | grep tar.gz | cut -f2 -d ":" | xargs echo) + libomp_tar_loc=$(brew fetch --bottle-tag=arm64_sonoma libomp | grep -i downloaded | grep tar.gz | cut -f2 -d ":" | xargs echo) else - libomp_tar_loc=$(brew fetch --bottle-tag=big_sur libomp | grep -i downloaded | grep tar.gz | cut -f2 -d ":" | xargs echo) + libomp_tar_loc=$(brew fetch --bottle-tag=sonoma libomp | grep -i downloaded | grep tar.gz | cut -f2 -d ":" | xargs echo) fi temp_dir="/tmp" cp "${libomp_tar_loc}" "${temp_dir}/libomp.tar.gz"