Repository navigation
Build with meson (meson-python) instead of setuptools + CMake - #49
Merged
Merged
Conversation
meson.build compiles pele_lib, the Cython extensions (with .pxd dependency tracking) and the f2py modules in one ninja graph and installs the package, replacing setup.py, the CMakeLists.txt.in template and cythonize.py. Options: -Dcvode=disabled (was PELE_WITH_CVODE=0), -Dnative=false (was PELE_NATIVE=0), -Dbuildtype=debug (was PELE_BUILD_TYPE=Debug), passed as pip -Csetup-args=.... Configure fails with a clear message when the C++ compiler is newer than the libstdc++ that Python loads, instead of the extensions failing at import with CXXABI_x not found. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cpp_tests/meson.build builds test_main (GoogleTest from the submodule, or the system one) and the benchmarks against the same pele_lib as the Python package, replacing the separate CMake project. The Python parts of meson.build are now optional: meson setup build -Dpython=disabled -Dtests=true -Dbuildtype=debug -Db_sanitize=address meson test -C build Test output files now go to the build directory instead of the source tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mixed descent optimizers call dpotrf_/dpotrs_. A missing LAPACK now fails at configure time instead of at import. Looks in extern/install and the conda env first, then pkg-config lapack or openblas. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C++ job: meson setup -Dpython=disabled -Dtests=true, meson test, lcov on the build dir. Python job: editable meson-python install for pytest/coverage on the source tree. macOS uses homebrew gcc-15 via CC/CXX/FC (setup.py used to pick it). PELE_NATIVE=0 becomes -Csetup-args=-Dnative=false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rn/install Remove the extern/sundials and extern/eigen submodules and extern/sun_inst.sh. meson.build looks in $CONDA_PREFIX, then the system, and gives the extensions and C++ tests an rpath to the env's lib directory so its shared libraries (SUNDIALS, LAPACK) are found at import/run time. CI creates a conda-forge env with sundials, eigen and blas-devel for both the C++ and Python parts. macOS jobs build with homebrew gcc-15 (setup.py used to pick it); meson.build now fails early with that advice when given clang on macOS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
pele calls the Fortran LAPACK routines dpotrf_/dpotrs_ (liblapack) and never the LAPACKE_* C interface, so liblapacke is not linked. It does need lapack.h for their prototypes, which Debian/Ubuntu ship only in liblapacke-dev (conda: openblas, via blas-devel). meson.build now checks for it with that advice instead of failing mid-compile. extended_mixed_descent.hpp includes lapack.h instead of lapacke.h; newton.cpp and newton_with_extension.cpp included lapacke.h without using it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the setuptools + CMake build (
setup.py,setup_with_cmake.py,CMakeLists.txt.in,cythonize.py,cpp_tests/source/CMakeLists.txt) with a singlemeson.builddriven by meson-python, the build NumPy/SciPy use.What changes
pele_lib, the 37 Cython extensions (with.pxddependency tracking) and the 16 f2py modules. No template file, no separate cythonize step, no copying libraries after the build.meson.build, without Python:extern/sundialsandextern/eigensubmodules andextern/sun_inst.share removed. Extensions get an rpath to the env'slib, so conda's shared SUNDIALS is found at import.dpotrf_/dpotrs_. A missing LAPACK now fails at configure time rather than at import.PELE_BUILD_TYPE=Debug→-Csetup-args=-Dbuildtype=debug,PELE_WITH_CVODE=0→-Dcvode=disabled,PELE_NATIVE=0→-Dnative=false.pip install --no-build-isolation -e .gives an editable install that rebuilds changed C++/Cython/Fortran on the nextimport pele(only the affected targets).CXXABI_x not found), or if clang is used on macOS (Homebrew gcc is needed for OpenMP and Fortran;setup.pyused to pick it automatically).Testing
pytest --pyargs pele589 passed; C++ tests 343 passed under AddressSanitizer.test_generalized_dimer::test1(fixed separately in GeneralizedDimer: use the C++ LBFGS for the rotation step (fixes flaky test_generalized_dimer) #48).Not yet done
<pele>/extern/install; they need follow-up changes to use conda's SUNDIALS. Existing localextern/installdirectories keep working until then.🤖 Generated with Claude Code