Skip to content
Merged
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
14 changes: 8 additions & 6 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -204,6 +204,8 @@ jobs:
"39",
"310",
"311",
"312",
"313",
]
exclude:
- os_arch: "macos-arm64"
Expand Down Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
18 changes: 8 additions & 10 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

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_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)

print_help() {
Expand Down Expand Up @@ -242,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"
Expand All @@ -265,14 +266,11 @@ 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_1_80_0/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))')
Expand Down Expand Up @@ -312,8 +310,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
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/gcc_version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 3 additions & 8 deletions src/pythonlib/pythonlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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()

Expand Down
Loading