Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
a56322f
Support Eigen 5
jfowkes Sep 21, 2026
5b953fe
Update cibuildhweel action
jfowkes Sep 21, 2026
9c262ff
[CI] Find Eigen
jfowkes Sep 21, 2026
352ea3e
[CI] Find Eigen differently
jfowkes Sep 21, 2026
65919b5
[CI] Try to find Eigen again...
jfowkes Sep 21, 2026
7848794
[CI] And again...
jfowkes Sep 21, 2026
cafd5c6
Support Eigen 5 all
jfowkes Sep 21, 2026
5c258ab
Simplify macros
jfowkes Sep 21, 2026
34d5f6f
[CI] use system Eigen on manylinux
jfowkes Sep 21, 2026
8fda001
Drop unsupported license classifier
jfowkes Sep 21, 2026
779619a
[CI] Add include path for macOS
jfowkes Sep 21, 2026
4d132b1
[CI] Pull in latest Eigen for Linux
jfowkes Sep 21, 2026
83d28a9
[CI] Install Eigen 5 on Windows
jfowkes Sep 21, 2026
d50d675
[CI] Fix syntax
jfowkes Sep 21, 2026
575c0c3
[CI] Find eigen on Intel macs
jfowkes Sep 21, 2026
d3730db
[CI] Find eigen on Windows
jfowkes Sep 21, 2026
9a5e981
[CI] Try again...
jfowkes Sep 21, 2026
0118a7e
[CI] Trying to be too clever...
jfowkes Sep 21, 2026
d42e9fc
[CI] I hate Windows...
jfowkes Sep 21, 2026
8072761
[CI] And powershell...
jfowkes Sep 21, 2026
f346534
[CI] ...
jfowkes Sep 21, 2026
f872eac
[CI] Fix Eigen install on Windows
jfowkes Sep 21, 2026
2b32bd4
[CI] Fix Eigen install on Windows again
jfowkes Sep 21, 2026
8b98f59
[CI] Getting there...
jfowkes Sep 21, 2026
9126e54
[CI] Almost...
jfowkes Sep 21, 2026
df7e76f
[CI] I Think...
jfowkes Sep 21, 2026
6e9ca59
[CI] Maybe...
jfowkes Sep 21, 2026
7258da1
[CI] Or maybe not...
jfowkes Sep 21, 2026
6bfeef3
[CI] Definitely not...
jfowkes Sep 21, 2026
eb8f2f5
[CI] Told you...
jfowkes Sep 21, 2026
53614cb
[CI] Hmmm...
jfowkes Sep 21, 2026
45a2a8e
[CI] Right...
jfowkes Sep 21, 2026
2e024ad
[CI] More promising...
jfowkes Sep 21, 2026
95bf6f7
[CI] Even more promising...
jfowkes Sep 21, 2026
6a19baa
[CI] Seriously? It was this simple??
jfowkes Sep 21, 2026
d84e98c
[CI] It was that simple
jfowkes Sep 21, 2026
35746dd
[CI] Of course it was not...
jfowkes Sep 21, 2026
606fec2
[CI] Try chocolatey...
jfowkes Sep 21, 2026
b2fb4de
Fix CMakelists.txt
jfowkes Sep 21, 2026
8231b00
Fix CMakelists.txt again
jfowkes Sep 21, 2026
596e5cc
[CI] Faster Eigen install on Linux
jfowkes Sep 21, 2026
f8a0f5f
[CI] Fix curl oops
jfowkes Sep 21, 2026
76c0ed4
[CI] Fix stupid Cmake
jfowkes Sep 21, 2026
6ed9db8
[CI] This is nicer
jfowkes Sep 21, 2026
7feeef2
[CI] Even nicer
jfowkes Sep 21, 2026
0af2d8a
[CI] Syntax tweak
jfowkes Sep 21, 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
29 changes: 12 additions & 17 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,36 @@ jobs:
strategy:
matrix:
# Note: builds on these are backward compatible
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, macos-13, macos-14, windows-latest]
os: [ubuntu-latest, macos-15-intel, macos-15, windows-latest]

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/cibuildwheel@v2.23.3
uses: pypa/cibuildwheel@v4.2.1
# to supply options, put them in 'env', like:
# env:
# CIBW_SOME_OPTION: value
env:
# List of platforms to build on
CIBW_BUILD: cp3{10,11,12,13}-manylinux_x86_64 cp3{10,11,12,13}-macosx_x86_64 cp3{10,11,12,13}-macosx_arm64 cp3{10,11,12,13}-win_amd64
CIBW_BUILD: cp3{10,11,12,13,14}-manylinux_x86_64 cp3{10,11,12,13,14}-macosx_x86_64 cp3{10,11,12,13,14}-macosx_arm64 cp3{10,11,12,13,14}-win_amd64

# Install Eigen and pybind11 on manylinux images (no brew, need Eigen >= 3.4)
CIBW_BEFORE_ALL_LINUX: >
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* &&
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* &&
yum install -y wget &&
wget https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz &&
tar xzf eigen-3.4.0.tar.gz &&
cd eigen-3.4.0 &&
mkdir build &&
cd build &&
cmake .. &&
make install &&
cd ../..
curl -L https://gitlab.com/libeigen/eigen/-/archive/5.0.1/eigen-5.0.1.tar.gz -o eigen-5.0.1.tar.gz &&
tar xzf eigen-5.0.1.tar.gz &&
cmake -S eigen-5.0.1 -B eigen-build -DCMAKE_INSTALL_PREFIX=/usr/local -DEIGEN_BUILD_BLAS=OFF -DEIGEN_BUILD_LAPACK=OFF -DBUILD_TESTING=OFF &&
cmake --install eigen-build
CIBW_ENVIRONMENT_LINUX: 'CPATH="/usr/local/include/eigen3"'
CIBW_BEFORE_BUILD_LINUX: pip install pybind11[global]

# Install Eigen and pybind11 on macOS
CIBW_BEFORE_ALL_MACOS: brew install eigen pybind11
CIBW_ENVIRONMENT_MACOS: 'CPLUS_INCLUDE_PATH="/opt/homebrew/include/eigen3:/usr/local/include/eigen3"'

# Install Eigen and pybind11 on Windows
CIBW_BEFORE_ALL_WINDOWS: choco install eigen
# Install Eigen and pybind11 on Windows images (no brew, need Eigen >= 3.4)
CIBW_BEFORE_ALL_WINDOWS: "choco install eigen -y"
CIBW_ENVIRONMENT_WINDOWS: 'CMAKE_ARGS="-DCMAKE_PREFIX_PATH=C:\ProgramData\chocolatey\lib\eigen -DCMAKE_INCLUDE_PATH=C:\ProgramData\chocolatey\lib\eigen\include\eigen3"'
CIBW_BEFORE_BUILD_WINDOWS: pip install pybind11[global] delvewheel

# cibuildwheel doesn't yet ship a default repair command for Windows
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10","3.11","3.12","3.13"]
python-version: ["3.10","3.11","3.12","3.13","3.14"]

steps:
- uses: actions/checkout@v4
Expand All @@ -28,6 +28,9 @@ jobs:
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install eigen pybind11
export CPLUS_INCLUDE_PATH="/home/linuxbrew/.linuxbrew/opt/eigen/include/eigen3:$CPLUS_INCLUDE_PATH"
export CMAKE_PREFIX_PATH="/home/linuxbrew/.linuxbrew/opt/eigen"
export CMAKE_ARGS="-DCMAKE_PREFIX_PATH=/home/linuxbrew/.linuxbrew/opt/eigen"
pip install .
- name: Tests
run: |
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
find_package(pybind11 CONFIG REQUIRED)

# Find Eigen 3.4+
find_package(Eigen3 3.4 REQUIRED)
find_package(Eigen3 REQUIRED)
if(Eigen3_VERSION VERSION_LESS "3.4.0")
message(FATAL_ERROR "Eigen3 version ${Eigen3_VERSION} is too old. GOFit requires at least version 3.4")
endif()

# Add project sources to python module
file(GLOB SOURCES src/*.cpp)
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,14 @@ def build_extension(self, ext):
"Documentation": "https://ralna.github.io/GOFit/",
"Source Code": "https://github.com/ralna/gofit/",
},
license='New BSD',
license='BSD-3-Clause',
keywords = "mathematics optimization",
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Framework :: IPython',
'Framework :: Jupyter',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Operating System :: Unix',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
Expand Down
7 changes: 7 additions & 0 deletions src/findiff.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
#include <functional>
#include <Eigen/Core>

// Eigen 5.0 moved all to the placeholders namespace to prevent global name clashes
#if EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION > 4
namespace Eigen {
using namespace Eigen::placeholders;
}
#endif

/*
* Forward finite difference approximation to the Jacobian
*
Expand Down
7 changes: 7 additions & 0 deletions src/lhs.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@

#include <Eigen/Core>

// Eigen 5.0 moved all to the placeholders namespace to prevent global name clashes
#if EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION > 4
namespace Eigen {
using namespace Eigen::placeholders;
}
#endif

/*
* Generate Latin Hypercube Design on [0,1]^n
*
Expand Down
7 changes: 7 additions & 0 deletions src/multistart.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@

#include "regularisation.h"

// Eigen 5.0 moved all to the placeholders namespace to prevent global name clashes
#if EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION > 4
namespace Eigen {
using namespace Eigen::placeholders;
}
#endif

/*
* Multistart adaptive quadratic regularisation
*
Expand Down
Loading