From 9960c82d09b4fd166b879f8409e659776d07d23a Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sat, 31 Jan 2026 05:45:39 +0000 Subject: [PATCH 01/26] Fix: expand ~ in CCACHE_CONFIGPATH to actual home directory - Use os.path.expanduser() to properly expand ~ in ccache config path - Fixes FileNotFoundError on macOS builds in cibuildwheel - Resolves CI failure in PR #711 --- tools/cibuildwheel_before_build.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/cibuildwheel_before_build.py b/tools/cibuildwheel_before_build.py index 66d9c91cd..bf0bac717 100644 --- a/tools/cibuildwheel_before_build.py +++ b/tools/cibuildwheel_before_build.py @@ -6,6 +6,9 @@ tag = f'cp{sys.version_info.major}{sys.version_info.minor}' ccache_config_path = os.getenv('CCACHE_CONFIGPATH') + +# Expand ~ to actual home directory +ccache_config_path = os.path.expanduser(ccache_config_path) if not ccache_config_path: raise RuntimeError('The CCACHE_CONFIGPATH environment variable must be set.') From 04934a91947e1c32c5acf36113631c6c8388edaa Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sat, 31 Jan 2026 07:08:54 +0000 Subject: [PATCH 02/26] Fix: add cblas.h symlink for Linux builds - Create symlink from /usr/include/openblas/cblas.h to /usr/include/cblas.h - Fixes compilation error: 'cblas.h: No such file or directory' - Similar to existing lapacke.h, lapack.h symlinks --- tools/cibuildwheel_before_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cibuildwheel_before_all.sh b/tools/cibuildwheel_before_all.sh index 8e9a74e3f..aa95a6ac4 100644 --- a/tools/cibuildwheel_before_all.sh +++ b/tools/cibuildwheel_before_all.sh @@ -11,7 +11,7 @@ ls /usr/include ln -s /usr/include/openblas/lapacke.h /usr/include/lapacke.h ln -s /usr/include/openblas/lapack.h /usr/include/lapack.h ln -s /usr/include/openblas/lapacke_mangling.h /usr/include/lapacke_mangling.h - +ln -s /usr/include/openblas/cblas.h /usr/include/cblas.h ls /usr/include/openblas # boost1.78-devel # ls /usr/include/boost | head From c01e17a17314539d40992c77c282dff27b0bf682 Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sat, 31 Jan 2026 07:27:18 +0000 Subject: [PATCH 03/26] Fix: add openblas_config.h symlink for Linux builds - cblas.h requires openblas_config.h - Create symlink from /usr/include/openblas/openblas_config.h --- tools/cibuildwheel_before_all.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/cibuildwheel_before_all.sh b/tools/cibuildwheel_before_all.sh index aa95a6ac4..dae93dca2 100644 --- a/tools/cibuildwheel_before_all.sh +++ b/tools/cibuildwheel_before_all.sh @@ -12,6 +12,7 @@ ln -s /usr/include/openblas/lapacke.h /usr/include/lapacke.h ln -s /usr/include/openblas/lapack.h /usr/include/lapack.h ln -s /usr/include/openblas/lapacke_mangling.h /usr/include/lapacke_mangling.h ln -s /usr/include/openblas/cblas.h /usr/include/cblas.h +ln -s /usr/include/openblas/openblas_config.h /usr/include/openblas_config.h ls /usr/include/openblas # boost1.78-devel # ls /usr/include/boost | head From b1779361052152e21bc267f2605083e63c5dd28e Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sat, 31 Jan 2026 07:45:32 +0000 Subject: [PATCH 04/26] Fix: ensure all OpenBLAS headers are accessible - Add CPATH to environment to include /usr/include/openblas - Create symlinks for all OpenBLAS headers - Fixes openblas_config-x86_64.h not found error --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1a01ccd70..36bbb2c35 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ before-build = "python ./tools/cibuildwheel_before_build.py" # before-all = "apt-get install -y arpack boost ccache libomp openblas" before-all = "bash ./tools/cibuildwheel_before_all.sh" # To include LAPACKE header. -environment = { CMAKE_PREFIX_PATH = "/usr/include/openblas", CCACHE_CONFIGPATH = "~/ccache.conf" } +environment = { CMAKE_PREFIX_PATH = "/usr/include/openblas", CPATH = "/usr/include/openblas:/usr/include", CCACHE_CONFIGPATH = "~/ccache.conf" } [tool.cibuildwheel.macos] before-all = "brew update; brew install arpack boost ccache libomp openblas" From e317a6acd8f69d2f0992049e165cc74e7bfd8edb Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sat, 31 Jan 2026 08:02:12 +0000 Subject: [PATCH 05/26] Fix: install core dev tools for gcc-toolset compatibility - Install gcc-c++, glibc-devel, kernel-headers - Fixes math.h not found error with gcc-toolset-14 --- tools/cibuildwheel_before_all.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/cibuildwheel_before_all.sh b/tools/cibuildwheel_before_all.sh index dae93dca2..4effca677 100644 --- a/tools/cibuildwheel_before_all.sh +++ b/tools/cibuildwheel_before_all.sh @@ -1,5 +1,8 @@ set -xe +# Install core development tools first +yum install -y gcc-c++ glibc-devel kernel-headers + yum search lapack yum --showduplicates list "lapack*" # yum install -y arpack-devel boost-devel ccache lapack-devel libomp-devel openblas-devel From f2b3cf34db9a21dbd2952614980191ce27af3d0d Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sat, 31 Jan 2026 08:19:36 +0000 Subject: [PATCH 06/26] Fix: add CFLAGS and CXXFLAGS for gcc-toolset include paths --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 36bbb2c35..57b0ec628 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,11 +74,11 @@ before-build = "python ./tools/cibuildwheel_before_build.py" # before-all = "apt-get install -y arpack boost ccache libomp openblas" before-all = "bash ./tools/cibuildwheel_before_all.sh" # To include LAPACKE header. -environment = { CMAKE_PREFIX_PATH = "/usr/include/openblas", CPATH = "/usr/include/openblas:/usr/include", CCACHE_CONFIGPATH = "~/ccache.conf" } +environment = { CMAKE_PREFIX_PATH = "/usr/include/openblas", CPATH = "/usr/include/openblas:/usr/include", CFLAGS = "-I/usr/include", CXXFLAGS = "-I/usr/include", CCACHE_CONFIGPATH = "~/ccache.conf" } [tool.cibuildwheel.macos] before-all = "brew update; brew install arpack boost ccache libomp openblas" -environment = { CMAKE_PREFIX_PATH = "$(brew --prefix arpack):$(brew --prefix boost):$(brew --prefix libomp):$(brew --prefix openblas)", PATH = "$(brew --prefix ccache)/libexec:$PATH", CCACHE_CONFIGPATH = "~/ccache.conf" } +environment = { CMAKE_PREFIX_PATH = "$(brew --prefix arpack):$(brew --prefix boost):$(brew --prefix libomp):$(brew --prefix openblas)", PATH = "$(brew --prefix ccache)/libexec:$PATH", CFLAGS = "-I/usr/include", CXXFLAGS = "-I/usr/include", CCACHE_CONFIGPATH = "~/ccache.conf" } # [tool.cibuildwheel] # before-build = "bash {project}/tools/cibuildwheel_before_build.sh" From c46b5624a36f44846080fdefca6edf89144d521c Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sat, 31 Jan 2026 08:31:42 +0000 Subject: [PATCH 07/26] Fix: add CFLAGS and CXXFLAGS for Linux gcc-toolset - Add CFLAGS and CXXFLAGS with -I/usr/include for Linux builds - Helps gcc-toolset-14 find standard headers like math.h - macOS configuration unchanged --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 57b0ec628..c422f867a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,7 +78,7 @@ environment = { CMAKE_PREFIX_PATH = "/usr/include/openblas", CPATH = "/usr/inclu [tool.cibuildwheel.macos] before-all = "brew update; brew install arpack boost ccache libomp openblas" -environment = { CMAKE_PREFIX_PATH = "$(brew --prefix arpack):$(brew --prefix boost):$(brew --prefix libomp):$(brew --prefix openblas)", PATH = "$(brew --prefix ccache)/libexec:$PATH", CFLAGS = "-I/usr/include", CXXFLAGS = "-I/usr/include", CCACHE_CONFIGPATH = "~/ccache.conf" } +environment = { CMAKE_PREFIX_PATH = "$(brew --prefix arpack):$(brew --prefix boost):$(brew --prefix libomp):$(brew --prefix openblas)", PATH = "$(brew --prefix ccache)/libexec:$PATH", CCACHE_CONFIGPATH = "~/ccache.conf" } # [tool.cibuildwheel] # before-build = "bash {project}/tools/cibuildwheel_before_build.sh" From 86de99e83980aa7ad6775d5498a45d306be55d79 Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sat, 31 Jan 2026 10:25:19 +0000 Subject: [PATCH 08/26] fix: remove CFLAGS and CXXFLAGS to fix math.h not found error --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c422f867a..29bcb8cd8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ before-build = "python ./tools/cibuildwheel_before_build.py" # before-all = "apt-get install -y arpack boost ccache libomp openblas" before-all = "bash ./tools/cibuildwheel_before_all.sh" # To include LAPACKE header. -environment = { CMAKE_PREFIX_PATH = "/usr/include/openblas", CPATH = "/usr/include/openblas:/usr/include", CFLAGS = "-I/usr/include", CXXFLAGS = "-I/usr/include", CCACHE_CONFIGPATH = "~/ccache.conf" } +environment = { CMAKE_PREFIX_PATH = "/usr/include/openblas", CPATH = "/usr/include/openblas", CCACHE_CONFIGPATH = "~/ccache.conf" } [tool.cibuildwheel.macos] before-all = "brew update; brew install arpack boost ccache libomp openblas" From 02126f6b420abd0c7fb520c89a8bf37a705c97e3 Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sat, 31 Jan 2026 14:04:43 +0000 Subject: [PATCH 09/26] fix: add setuptools for distutils compatibility with Python 3.12+ --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 29bcb8cd8..e1e45d04a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["scikit-build-core >=0.11", "pybind11 >=3.0"] +requires = ["scikit-build-core >=0.11", "pybind11 >=3.0", "setuptools"] build-backend = "scikit_build_core.build" [project] From 304112115c2db2573c20253d04d0021022763a56 Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sat, 31 Jan 2026 15:53:26 +0000 Subject: [PATCH 10/26] fix: use dnf instead of yum for manylinux_2_34 --- tools/cibuildwheel_before_all.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/cibuildwheel_before_all.sh b/tools/cibuildwheel_before_all.sh index 4effca677..f2483f5d5 100644 --- a/tools/cibuildwheel_before_all.sh +++ b/tools/cibuildwheel_before_all.sh @@ -1,12 +1,12 @@ set -xe # Install core development tools first -yum install -y gcc-c++ glibc-devel kernel-headers +dnf install -y gcc-c++ glibc-devel kernel-headers -yum search lapack -yum --showduplicates list "lapack*" -# yum install -y arpack-devel boost-devel ccache lapack-devel libomp-devel openblas-devel -yum install -y arpack-devel boost-devel ccache libomp-devel openblas-devel +dnf search lapack +dnf --showduplicates list "lapack*" +# dnf install -y arpack-devel boost-devel ccache lapack-devel libomp-devel openblas-devel +dnf install -y arpack-devel boost-devel ccache libomp-devel openblas-devel # On Red Hat/CentOS systems (which manylinux images are based on), the lapack-devel # package typically provides the Fortran bindings and miss the C-interface header, so # use lapacke.h shipped with openblas instead. From ac4f5ea3f6974f9b5a24cf43213c9f9b8a1b2c5b Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sun, 1 Feb 2026 01:11:54 +0000 Subject: [PATCH 11/26] fix: detect available package manager in manylinux --- tools/cibuildwheel_before_all.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/cibuildwheel_before_all.sh b/tools/cibuildwheel_before_all.sh index f2483f5d5..30c9bfd06 100644 --- a/tools/cibuildwheel_before_all.sh +++ b/tools/cibuildwheel_before_all.sh @@ -1,12 +1,12 @@ set -xe # Install core development tools first -dnf install -y gcc-c++ glibc-devel kernel-headers +microdnf install -y gcc-c++ glibc-devel kernel-headers -dnf search lapack -dnf --showduplicates list "lapack*" -# dnf install -y arpack-devel boost-devel ccache lapack-devel libomp-devel openblas-devel -dnf install -y arpack-devel boost-devel ccache libomp-devel openblas-devel +microdnf search lapack +microdnf --showduplicates list "lapack*" +# microdnf install -y arpack-devel boost-devel ccache lapack-devel libomp-devel openblas-devel +microdnf install -y arpack-devel boost-devel ccache libomp-devel openblas-devel # On Red Hat/CentOS systems (which manylinux images are based on), the lapack-devel # package typically provides the Fortran bindings and miss the C-interface header, so # use lapacke.h shipped with openblas instead. From b029f41e77566910655b6650f28486ef82557df4 Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sun, 1 Feb 2026 05:39:34 +0000 Subject: [PATCH 12/26] fix: restore before_all.sh to working version --- tools/cibuildwheel_before_all.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tools/cibuildwheel_before_all.sh b/tools/cibuildwheel_before_all.sh index 30c9bfd06..8e9a74e3f 100644 --- a/tools/cibuildwheel_before_all.sh +++ b/tools/cibuildwheel_before_all.sh @@ -1,12 +1,9 @@ set -xe -# Install core development tools first -microdnf install -y gcc-c++ glibc-devel kernel-headers - -microdnf search lapack -microdnf --showduplicates list "lapack*" -# microdnf install -y arpack-devel boost-devel ccache lapack-devel libomp-devel openblas-devel -microdnf install -y arpack-devel boost-devel ccache libomp-devel openblas-devel +yum search lapack +yum --showduplicates list "lapack*" +# yum install -y arpack-devel boost-devel ccache lapack-devel libomp-devel openblas-devel +yum install -y arpack-devel boost-devel ccache libomp-devel openblas-devel # On Red Hat/CentOS systems (which manylinux images are based on), the lapack-devel # package typically provides the Fortran bindings and miss the C-interface header, so # use lapacke.h shipped with openblas instead. @@ -14,8 +11,7 @@ ls /usr/include ln -s /usr/include/openblas/lapacke.h /usr/include/lapacke.h ln -s /usr/include/openblas/lapack.h /usr/include/lapack.h ln -s /usr/include/openblas/lapacke_mangling.h /usr/include/lapacke_mangling.h -ln -s /usr/include/openblas/cblas.h /usr/include/cblas.h -ln -s /usr/include/openblas/openblas_config.h /usr/include/openblas_config.h + ls /usr/include/openblas # boost1.78-devel # ls /usr/include/boost | head From 44ad9bc86b29da4ea1582aa64d27553e99470970 Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sun, 1 Feb 2026 07:05:21 +0000 Subject: [PATCH 13/26] Fix: restore all Linux build fixes for manylinux_2_28 - Install gcc-c++, glibc-devel, kernel-headers - Add cblas.h and openblas_config.h symlinks - Use ln -sf to force overwrite - Add verification steps --- tools/cibuildwheel_before_all.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/tools/cibuildwheel_before_all.sh b/tools/cibuildwheel_before_all.sh index 8e9a74e3f..47f68a773 100644 --- a/tools/cibuildwheel_before_all.sh +++ b/tools/cibuildwheel_before_all.sh @@ -1,18 +1,25 @@ set -xe +# Install core development tools first +yum install -y gcc-c++ glibc-devel kernel-headers + yum search lapack yum --showduplicates list "lapack*" -# yum install -y arpack-devel boost-devel ccache lapack-devel libomp-devel openblas-devel yum install -y arpack-devel boost-devel ccache libomp-devel openblas-devel + # On Red Hat/CentOS systems (which manylinux images are based on), the lapack-devel # package typically provides the Fortran bindings and miss the C-interface header, so -# use lapacke.h shipped with openblas instead. +# use headers shipped with openblas instead. ls /usr/include -ln -s /usr/include/openblas/lapacke.h /usr/include/lapacke.h -ln -s /usr/include/openblas/lapack.h /usr/include/lapack.h -ln -s /usr/include/openblas/lapacke_mangling.h /usr/include/lapacke_mangling.h - ls /usr/include/openblas -# boost1.78-devel -# ls /usr/include/boost | head -# ls /usr/lib64/libboost_*.so + +# Create symlinks for all required OpenBLAS headers +ln -sf /usr/include/openblas/lapacke.h /usr/include/lapacke.h +ln -sf /usr/include/openblas/lapack.h /usr/include/lapack.h +ln -sf /usr/include/openblas/lapacke_mangling.h /usr/include/lapacke_mangling.h +ln -sf /usr/include/openblas/cblas.h /usr/include/cblas.h +ln -sf /usr/include/openblas/openblas_config.h /usr/include/openblas_config.h + +# Verify symlinks were created +ls -la /usr/include/cblas.h +ls -la /usr/include/openblas_config.h From ca6690c728548dd25b08da5d7464c74022822750 Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sun, 1 Feb 2026 11:41:47 +0000 Subject: [PATCH 14/26] fix: change to manylinux_2_28 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e1e45d04a..c1464696b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,7 +67,7 @@ result = "{major}.{minor}.{patch}" # architecture which is an extension of x86_64, so the wheels built with manylinux_2_34 # may not support older machines. See https://github.com/pypa/manylinux?tab=readme-ov-file#manylinux_2_34-almalinux-9-based---alpha # for more information. -manylinux-x86_64-image = "manylinux_2_34" +manylinux-x86_64-image = "manylinux_2_28" before-build = "python ./tools/cibuildwheel_before_build.py" [tool.cibuildwheel.linux] From 4bbeea1746fcba1ad49e504cd29b07fc187512be Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sun, 1 Feb 2026 12:08:17 +0000 Subject: [PATCH 15/26] fix: disable Boost CMake config for manylinux_2_28 --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index c1464696b..8d8a15a62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,10 +38,12 @@ wheel.packages = ["cytnx"] cmake.args = [ # Use the default preset defined in CMakePresets.json "--preset=openblas-cpu", + "-DBoost_NO_BOOST_CMAKE=ON", # TODO: Remove setting of generator to support builuding on Windows. # scikit-build uses Ninja as the default cmake generator. However, Ninja # conflicts against the build process of HPTT. "-G Unix Makefiles", + "-DBoost_NO_BOOST_CMAKE=ON", ] # Force the build directory to be "build" instead of a random temp folder. This helps # ccache caches the compiler outputs successfully. From 7a56f8509e211c9801cdfa4b4eef2be82eef8083 Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sun, 1 Feb 2026 12:24:05 +0000 Subject: [PATCH 16/26] fix: allow Boost MODULE mode for manylinux_2_28 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 644cca3b8..24e9040dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -251,7 +251,7 @@ endif() # ##################################################################### # ## Boost -find_package(Boost CONFIG REQUIRED) +find_package(Boost REQUIRED) target_include_directories(cytnx SYSTEM PUBLIC ${Boost_INCLUDE_DIRS} From 2ca5be985c3c0cf988c8288943358dedc89c4b30 Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sun, 1 Feb 2026 14:25:18 +0000 Subject: [PATCH 17/26] fix: use full path for dnf in manylinux_2_28 --- tools/cibuildwheel_before_all.sh | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/tools/cibuildwheel_before_all.sh b/tools/cibuildwheel_before_all.sh index 47f68a773..8890ea632 100644 --- a/tools/cibuildwheel_before_all.sh +++ b/tools/cibuildwheel_before_all.sh @@ -1,25 +1,15 @@ set -xe - -# Install core development tools first -yum install -y gcc-c++ glibc-devel kernel-headers - -yum search lapack -yum --showduplicates list "lapack*" -yum install -y arpack-devel boost-devel ccache libomp-devel openblas-devel - -# On Red Hat/CentOS systems (which manylinux images are based on), the lapack-devel -# package typically provides the Fortran bindings and miss the C-interface header, so -# use headers shipped with openblas instead. +# Use full path for dnf on AlmaLinux 8 based manylinux_2_28 +/usr/bin/dnf install -y gcc-c++ glibc-devel kernel-headers +/usr/bin/dnf search lapack +/usr/bin/dnf --showduplicates list "lapack*" +/usr/bin/dnf install -y arpack-devel boost-devel ccache libomp-devel openblas-devel ls /usr/include ls /usr/include/openblas - -# Create symlinks for all required OpenBLAS headers ln -sf /usr/include/openblas/lapacke.h /usr/include/lapacke.h ln -sf /usr/include/openblas/lapack.h /usr/include/lapack.h ln -sf /usr/include/openblas/lapacke_mangling.h /usr/include/lapacke_mangling.h ln -sf /usr/include/openblas/cblas.h /usr/include/cblas.h ln -sf /usr/include/openblas/openblas_config.h /usr/include/openblas_config.h - -# Verify symlinks were created ls -la /usr/include/cblas.h ls -la /usr/include/openblas_config.h From 62eeb1f81b6d35c85de8f4ebcc5c6977f160ca3d Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sun, 1 Feb 2026 16:24:00 +0000 Subject: [PATCH 18/26] debug: check available package managers in manylinux_2_28 --- tools/cibuildwheel_before_all.sh | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/tools/cibuildwheel_before_all.sh b/tools/cibuildwheel_before_all.sh index 8890ea632..ca9578bd8 100644 --- a/tools/cibuildwheel_before_all.sh +++ b/tools/cibuildwheel_before_all.sh @@ -1,15 +1,12 @@ set -xe -# Use full path for dnf on AlmaLinux 8 based manylinux_2_28 -/usr/bin/dnf install -y gcc-c++ glibc-devel kernel-headers -/usr/bin/dnf search lapack -/usr/bin/dnf --showduplicates list "lapack*" -/usr/bin/dnf install -y arpack-devel boost-devel ccache libomp-devel openblas-devel -ls /usr/include -ls /usr/include/openblas -ln -sf /usr/include/openblas/lapacke.h /usr/include/lapacke.h -ln -sf /usr/include/openblas/lapack.h /usr/include/lapack.h -ln -sf /usr/include/openblas/lapacke_mangling.h /usr/include/lapacke_mangling.h -ln -sf /usr/include/openblas/cblas.h /usr/include/cblas.h -ln -sf /usr/include/openblas/openblas_config.h /usr/include/openblas_config.h -ls -la /usr/include/cblas.h -ls -la /usr/include/openblas_config.h +# Debug: find available package managers +echo "=== Checking for package managers ===" +ls -la /usr/bin/dnf /usr/bin/yum /usr/bin/microdnf /usr/bin/apt-get 2>/dev/null || true +echo "=== Checking PATH ===" +echo $PATH +echo "=== Looking for *dnf* or *yum* in /usr/bin ===" +ls /usr/bin/*dnf* /usr/bin/*yum* 2>/dev/null || echo "None found" +echo "=== Check if packages are pre-installed ===" +rpm -qa | grep -E "(boost|openblas|arpack)" || echo "Packages not found via rpm" +echo "=== Check /usr/include/openblas ===" +ls /usr/include/openblas 2>/dev/null || echo "openblas headers not found" From 9c61140f52cc6edc2c02042a4029d312b606f822 Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sun, 1 Feb 2026 16:28:54 +0000 Subject: [PATCH 19/26] fix: install ccache via pipx in manylinux --- tools/cibuildwheel_before_all.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/cibuildwheel_before_all.sh b/tools/cibuildwheel_before_all.sh index ca9578bd8..5f6f86b6d 100644 --- a/tools/cibuildwheel_before_all.sh +++ b/tools/cibuildwheel_before_all.sh @@ -1,12 +1,12 @@ set -xe -# Debug: find available package managers -echo "=== Checking for package managers ===" -ls -la /usr/bin/dnf /usr/bin/yum /usr/bin/microdnf /usr/bin/apt-get 2>/dev/null || true -echo "=== Checking PATH ===" -echo $PATH -echo "=== Looking for *dnf* or *yum* in /usr/bin ===" -ls /usr/bin/*dnf* /usr/bin/*yum* 2>/dev/null || echo "None found" -echo "=== Check if packages are pre-installed ===" -rpm -qa | grep -E "(boost|openblas|arpack)" || echo "Packages not found via rpm" -echo "=== Check /usr/include/openblas ===" -ls /usr/include/openblas 2>/dev/null || echo "openblas headers not found" +# Install ccache using pipx (available in manylinux images) +pipx install ccache + +# Create symlinks for OpenBLAS headers if available +if [ -d /usr/include/openblas ]; then + ln -sf /usr/include/openblas/lapacke.h /usr/include/lapacke.h + ln -sf /usr/include/openblas/lapack.h /usr/include/lapack.h + ln -sf /usr/include/openblas/lapacke_mangling.h /usr/include/lapacke_mangling.h + ln -sf /usr/include/openblas/cblas.h /usr/include/cblas.h + ln -sf /usr/include/openblas/openblas_config.h /usr/include/openblas_config.h +fi From 2f972cfd91fd9fc69d1a675eeab6f20a493d54aa Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sun, 1 Feb 2026 16:30:57 +0000 Subject: [PATCH 20/26] fix: install ccache from binary release --- tools/cibuildwheel_before_all.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/cibuildwheel_before_all.sh b/tools/cibuildwheel_before_all.sh index 5f6f86b6d..4455fe688 100644 --- a/tools/cibuildwheel_before_all.sh +++ b/tools/cibuildwheel_before_all.sh @@ -1,6 +1,9 @@ set -xe -# Install ccache using pipx (available in manylinux images) -pipx install ccache +# Install ccache from GitHub releases +CCACHE_VERSION=4.9.1 +curl -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}-linux-x86_64.tar.xz | tar -xJ +cp ccache-${CCACHE_VERSION}-linux-x86_64/ccache /usr/local/bin/ +ccache --version # Create symlinks for OpenBLAS headers if available if [ -d /usr/include/openblas ]; then From 01a7f3c9d05fcba0a4951e54aa92c7bd0ba8e28d Mon Sep 17 00:00:00 2001 From: b95702041 Date: Sun, 1 Feb 2026 16:34:29 +0000 Subject: [PATCH 21/26] fix: install boost and dependencies via dnf/yum --- tools/cibuildwheel_before_all.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/cibuildwheel_before_all.sh b/tools/cibuildwheel_before_all.sh index 4455fe688..76fd91a0a 100644 --- a/tools/cibuildwheel_before_all.sh +++ b/tools/cibuildwheel_before_all.sh @@ -1,10 +1,21 @@ set -xe + # Install ccache from GitHub releases CCACHE_VERSION=4.9.1 curl -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}-linux-x86_64.tar.xz | tar -xJ cp ccache-${CCACHE_VERSION}-linux-x86_64/ccache /usr/local/bin/ ccache --version +# Install required packages +# manylinux_2_28 is AlmaLinux 8 based, try dnf first, then yum +if command -v dnf &> /dev/null; then + dnf install -y boost-devel openblas-devel arpack-devel +elif command -v yum &> /dev/null; then + yum install -y boost-devel openblas-devel arpack-devel +else + echo "WARNING: No package manager found, assuming packages are pre-installed" +fi + # Create symlinks for OpenBLAS headers if available if [ -d /usr/include/openblas ]; then ln -sf /usr/include/openblas/lapacke.h /usr/include/lapacke.h From 5a9d1e9e9dc2802186742925a81f515108f2067a Mon Sep 17 00:00:00 2001 From: b95702041 Date: Mon, 2 Feb 2026 03:09:04 +0000 Subject: [PATCH 22/26] fix: add fallback dummy ccache if binary fails --- tools/cibuildwheel_before_all.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tools/cibuildwheel_before_all.sh b/tools/cibuildwheel_before_all.sh index 76fd91a0a..d068d7ba2 100644 --- a/tools/cibuildwheel_before_all.sh +++ b/tools/cibuildwheel_before_all.sh @@ -1,19 +1,27 @@ set -xe -# Install ccache from GitHub releases -CCACHE_VERSION=4.9.1 +# Install ccache from sccache (static binary) as alternative +# Or try older ccache version that might be more compatible +CCACHE_VERSION=4.8.3 curl -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}-linux-x86_64.tar.xz | tar -xJ cp ccache-${CCACHE_VERSION}-linux-x86_64/ccache /usr/local/bin/ -ccache --version +chmod +x /usr/local/bin/ccache +# Check if it works, if not, create a dummy ccache that just passes through +if ! /usr/local/bin/ccache --version 2>/dev/null; then + echo '#!/bin/bash' > /usr/local/bin/ccache + echo 'exec "${@}"' >> /usr/local/bin/ccache + chmod +x /usr/local/bin/ccache + echo "WARNING: Using dummy ccache passthrough" +fi +ccache --version || echo "ccache passthrough mode" # Install required packages -# manylinux_2_28 is AlmaLinux 8 based, try dnf first, then yum if command -v dnf &> /dev/null; then dnf install -y boost-devel openblas-devel arpack-devel elif command -v yum &> /dev/null; then yum install -y boost-devel openblas-devel arpack-devel else - echo "WARNING: No package manager found, assuming packages are pre-installed" + echo "WARNING: No package manager found" fi # Create symlinks for OpenBLAS headers if available From ae4720d893f1b3763f82e4e9b7cb9f9382aeda49 Mon Sep 17 00:00:00 2001 From: b95702041 Date: Mon, 2 Feb 2026 05:27:30 +0000 Subject: [PATCH 23/26] fix: add musllinux (apk) support --- tools/cibuildwheel_before_all.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/cibuildwheel_before_all.sh b/tools/cibuildwheel_before_all.sh index d068d7ba2..3900e5ec6 100644 --- a/tools/cibuildwheel_before_all.sh +++ b/tools/cibuildwheel_before_all.sh @@ -1,24 +1,26 @@ set -xe -# Install ccache from sccache (static binary) as alternative -# Or try older ccache version that might be more compatible +# Install ccache CCACHE_VERSION=4.8.3 curl -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}-linux-x86_64.tar.xz | tar -xJ cp ccache-${CCACHE_VERSION}-linux-x86_64/ccache /usr/local/bin/ chmod +x /usr/local/bin/ccache -# Check if it works, if not, create a dummy ccache that just passes through if ! /usr/local/bin/ccache --version 2>/dev/null; then echo '#!/bin/bash' > /usr/local/bin/ccache echo 'exec "${@}"' >> /usr/local/bin/ccache chmod +x /usr/local/bin/ccache echo "WARNING: Using dummy ccache passthrough" fi -ccache --version || echo "ccache passthrough mode" -# Install required packages -if command -v dnf &> /dev/null; then +# Install required packages based on distro +if command -v apk &> /dev/null; then + # musllinux (Alpine) + apk add --no-cache boost-dev openblas-dev arpack-dev +elif command -v dnf &> /dev/null; then + # manylinux_2_28+ (AlmaLinux/RHEL) dnf install -y boost-devel openblas-devel arpack-devel elif command -v yum &> /dev/null; then + # manylinux2014 (CentOS) yum install -y boost-devel openblas-devel arpack-devel else echo "WARNING: No package manager found" From 07d192a82e0b04dcd8c0a251960c1147693be5a2 Mon Sep 17 00:00:00 2001 From: b95702041 Date: Mon, 2 Feb 2026 11:03:33 +0000 Subject: [PATCH 24/26] fix: add conditional compilation for execinfo.h to support musl libc --- include/cytnx_error.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/cytnx_error.hpp b/include/cytnx_error.hpp index 109d2cff1..34135276c 100644 --- a/include/cytnx_error.hpp +++ b/include/cytnx_error.hpp @@ -9,7 +9,12 @@ #include #include +#if defined(__GLIBC__) #include +#define HAS_EXECINFO 1 +#else +#define HAS_EXECINFO 0 +#endif #ifdef _MSC_VER #define __PRETTY_FUNCTION__ __FUNCTION__ @@ -34,6 +39,7 @@ static inline void error_msg(char const *const func, const char *const file, int va_end(args); // std::cerr << output_str << std::endl; std::cerr << output_str << std::endl; + #if HAS_EXECINFO std::cerr << "Stack trace:" << std::endl; void *array[10]; size_t size; @@ -43,6 +49,7 @@ static inline void error_msg(char const *const func, const char *const file, int std::cerr << strings[i] << std::endl; } free(strings); +#endif throw std::logic_error(output_str); } // } catch (const char *output_msg) { From f9f436b3c70d7b952b684afe4ec3111cafb6d88a Mon Sep 17 00:00:00 2001 From: b95702041 Date: Fri, 6 Feb 2026 12:53:19 +0000 Subject: [PATCH 25/26] refactor: use package manager for ccache, move Boost cmake flag to cibuildwheel env --- pyproject.toml | 4 +--- tools/cibuildwheel_before_all.sh | 18 +++--------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8d8a15a62..b084823a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,12 +38,10 @@ wheel.packages = ["cytnx"] cmake.args = [ # Use the default preset defined in CMakePresets.json "--preset=openblas-cpu", - "-DBoost_NO_BOOST_CMAKE=ON", # TODO: Remove setting of generator to support builuding on Windows. # scikit-build uses Ninja as the default cmake generator. However, Ninja # conflicts against the build process of HPTT. "-G Unix Makefiles", - "-DBoost_NO_BOOST_CMAKE=ON", ] # Force the build directory to be "build" instead of a random temp folder. This helps # ccache caches the compiler outputs successfully. @@ -76,7 +74,7 @@ before-build = "python ./tools/cibuildwheel_before_build.py" # before-all = "apt-get install -y arpack boost ccache libomp openblas" before-all = "bash ./tools/cibuildwheel_before_all.sh" # To include LAPACKE header. -environment = { CMAKE_PREFIX_PATH = "/usr/include/openblas", CPATH = "/usr/include/openblas", CCACHE_CONFIGPATH = "~/ccache.conf" } +environment = { CMAKE_PREFIX_PATH = "/usr/include/openblas", CPATH = "/usr/include/openblas", CCACHE_CONFIGPATH = "~/ccache.conf", CMAKE_ARGS = "-DBoost_NO_BOOST_CMAKE=ON" } [tool.cibuildwheel.macos] before-all = "brew update; brew install arpack boost ccache libomp openblas" diff --git a/tools/cibuildwheel_before_all.sh b/tools/cibuildwheel_before_all.sh index 3900e5ec6..d70fac68b 100644 --- a/tools/cibuildwheel_before_all.sh +++ b/tools/cibuildwheel_before_all.sh @@ -1,27 +1,15 @@ set -xe -# Install ccache -CCACHE_VERSION=4.8.3 -curl -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}-linux-x86_64.tar.xz | tar -xJ -cp ccache-${CCACHE_VERSION}-linux-x86_64/ccache /usr/local/bin/ -chmod +x /usr/local/bin/ccache -if ! /usr/local/bin/ccache --version 2>/dev/null; then - echo '#!/bin/bash' > /usr/local/bin/ccache - echo 'exec "${@}"' >> /usr/local/bin/ccache - chmod +x /usr/local/bin/ccache - echo "WARNING: Using dummy ccache passthrough" -fi - # Install required packages based on distro if command -v apk &> /dev/null; then # musllinux (Alpine) - apk add --no-cache boost-dev openblas-dev arpack-dev + apk add --no-cache boost-dev openblas-dev arpack-dev ccache elif command -v dnf &> /dev/null; then # manylinux_2_28+ (AlmaLinux/RHEL) - dnf install -y boost-devel openblas-devel arpack-devel + dnf install -y boost-devel openblas-devel arpack-devel ccache elif command -v yum &> /dev/null; then # manylinux2014 (CentOS) - yum install -y boost-devel openblas-devel arpack-devel + yum install -y boost-devel openblas-devel arpack-devel ccache else echo "WARNING: No package manager found" fi From efe359377cf55c1a5ffea31a39e95d3f9dd598c7 Mon Sep 17 00:00:00 2001 From: b95702041 Date: Mon, 23 Feb 2026 04:49:24 +0000 Subject: [PATCH 26/26] Test: remove outdated FindPythonLibsNew.cmake --- .../{FindPythonLibsNew.cmake => FindPythonLibsNew.cmake.bak} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cmake/Modules/{FindPythonLibsNew.cmake => FindPythonLibsNew.cmake.bak} (100%) diff --git a/cmake/Modules/FindPythonLibsNew.cmake b/cmake/Modules/FindPythonLibsNew.cmake.bak similarity index 100% rename from cmake/Modules/FindPythonLibsNew.cmake rename to cmake/Modules/FindPythonLibsNew.cmake.bak