Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9960c82
Fix: expand ~ in CCACHE_CONFIGPATH to actual home directory
b95702041 Jan 31, 2026
04934a9
Fix: add cblas.h symlink for Linux builds
b95702041 Jan 31, 2026
c01e17a
Fix: add openblas_config.h symlink for Linux builds
b95702041 Jan 31, 2026
b177936
Fix: ensure all OpenBLAS headers are accessible
b95702041 Jan 31, 2026
e317a6a
Fix: install core dev tools for gcc-toolset compatibility
b95702041 Jan 31, 2026
f2b3cf3
Fix: add CFLAGS and CXXFLAGS for gcc-toolset include paths
b95702041 Jan 31, 2026
c46b562
Fix: add CFLAGS and CXXFLAGS for Linux gcc-toolset
b95702041 Jan 31, 2026
86de99e
fix: remove CFLAGS and CXXFLAGS to fix math.h not found error
b95702041 Jan 31, 2026
02126f6
fix: add setuptools for distutils compatibility with Python 3.12+
b95702041 Jan 31, 2026
3041121
fix: use dnf instead of yum for manylinux_2_34
b95702041 Jan 31, 2026
ac4f5ea
fix: detect available package manager in manylinux
b95702041 Feb 1, 2026
b029f41
fix: restore before_all.sh to working version
b95702041 Feb 1, 2026
44ad9bc
Fix: restore all Linux build fixes for manylinux_2_28
b95702041 Feb 1, 2026
ca6690c
fix: change to manylinux_2_28
b95702041 Feb 1, 2026
4bbeea1
fix: disable Boost CMake config for manylinux_2_28
b95702041 Feb 1, 2026
7a56f85
fix: allow Boost MODULE mode for manylinux_2_28
b95702041 Feb 1, 2026
2ca5be9
fix: use full path for dnf in manylinux_2_28
b95702041 Feb 1, 2026
62eeb1f
debug: check available package managers in manylinux_2_28
b95702041 Feb 1, 2026
9c61140
fix: install ccache via pipx in manylinux
b95702041 Feb 1, 2026
2f972cf
fix: install ccache from binary release
b95702041 Feb 1, 2026
01a7f3c
fix: install boost and dependencies via dnf/yum
b95702041 Feb 1, 2026
5a9d1e9
fix: add fallback dummy ccache if binary fails
b95702041 Feb 2, 2026
ae4720d
fix: add musllinux (apk) support
b95702041 Feb 2, 2026
07d192a
fix: add conditional compilation for execinfo.h to support musl libc
b95702041 Feb 2, 2026
f9f436b
refactor: use package manager for ccache, move Boost cmake flag to ci…
b95702041 Feb 6, 2026
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ endif()
# #####################################################################

# ## Boost
find_package(Boost CONFIG REQUIRED)
find_package(Boost REQUIRED)
target_include_directories(cytnx SYSTEM
PUBLIC
${Boost_INCLUDE_DIRS}
Expand Down
7 changes: 7 additions & 0 deletions include/cytnx_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
#include <iostream>
#include <stdexcept>

#if defined(__GLIBC__)
#include <execinfo.h>
#define HAS_EXECINFO 1
#else
#define HAS_EXECINFO 0
#endif

#ifdef _MSC_VER
#define __PRETTY_FUNCTION__ __FUNCTION__
Expand All @@ -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;
Expand All @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why setuptools is needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

distutils was deprecated in Python 3.10 and removed in Python 3.12.
Since the build uses Python 3.12, build 8 failed with:
ModuleNotFoundError: No module named 'distutils'
Adding setuptools resolves this because it provides a distutils compatibility layer.
Reference: https://github.com/b95702041/Cytnx/actions/runs/21543068253

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try to figure out which package provide the outdated FindPythonLibsNew.cmake? pybind11 has fixed the issue about distutils few years ago: pybind/pybind11#3677

build-backend = "scikit_build_core.build"

[project]
Expand Down Expand Up @@ -67,14 +67,14 @@ 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]
# 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", 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"
Expand Down
36 changes: 21 additions & 15 deletions tools/cibuildwheel_before_all.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
set -xe

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.
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
# 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 ccache
elif command -v dnf &> /dev/null; then
# manylinux_2_28+ (AlmaLinux/RHEL)
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 ccache
else
echo "WARNING: No package manager found"
fi

ls /usr/include/openblas
# boost1.78-devel
# ls /usr/include/boost | head
# ls /usr/lib64/libboost_*.so
# 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
3 changes: 3 additions & 0 deletions tools/cibuildwheel_before_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')

Expand Down
Loading