-
Notifications
You must be signed in to change notification settings - Fork 555
Enable Scikit-Build-Core Support #3339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Enable Scikit-Build-Core Support #3339
Conversation
…into scikit_build_core_wheel
…into scikit_build_core_wheel
Congratulations Ahnaf looks like all thest tests are pass and the coverage is also good. |
This PR is realy for review. Feedback welcome |
Hey @ahnaf-tahmid-chowdhury thanks for this, I'm planning on testing this with @rossmacdonald98 and @SteSeg to fix our workflow (see #3369 ) without having to wait for a new release or recompile from source |
This branch and the pip install mechanism can be tried with with command pip install git+https://github.com/ahnaf-tahmid-chowdhury/OpenMC.git@skbuild-minimal Let us know if you uncover any issues |
I tried to merge python version
|
Hello, @RemDelaporteMathurin. This is a short PR that only introduces the scikit-build-core setup. You may need to install dependencies before running the setup. |
Yes in the future (follow up PR) these will be bundled in the wheel but for now if you install via pip and this branch I guess these are needed.
|
Installed these dependencies and I still have the error. Is there a list somewhere? |
For minimal setup you may only need hdf5 installed. For detail setup you may consider reviewing the CI workflows. There is a Manylinux dockerfile available at #3087 that might also help. |
Thanks @ahnaf-tahmid-chowdhury for making the changes now that mcpl is linked via a pip install |
We need to do the same thing for mcpl that we have done for ncrystal. |
I have already created PR #3429 to make this PR working again. |
ed17466
to
3384aba
Compare
Everything is working now. |
python -m pip install . | ||
.. code-block:: bash | ||
|
||
python -m pip install . --config-settings=cmake.args="-DOPENMC_USE_MPI=ON;-DOPENMC_USE_MCPL=ON" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the mcpl part in this command as I think the way we not include mcpl has changed
# Build in debug mode by default with support for MCPL | ||
cmake_cmd = ['cmake', '-DCMAKE_BUILD_TYPE=Debug', '-DOPENMC_USE_MCPL=on'] | ||
# List to store the CMake arguments | ||
cmake_args = ['-DCMAKE_BUILD_TYPE=Debug', '-DOPENMC_USE_MCPL=on'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still use the DOPENMC_USE_MCPL arg or has this been removed now we use MCPL from pypi
Here's a minimal Dockerfile I used to produce the wheel for python 3.13/ubuntu25.04, works great: FROM ubuntu:25.04
RUN apt update -y \
&& apt install -y python3 python-is-python3 python3-venv python3-dev \
git g++ cmake libhdf5-dev libpng-dev curl
RUN python -m venv venv \
&& . venv/bin/activate \
&& pip install git+https://github.com/ahnaf-tahmid-chowdhury/OpenMC.git@skbuild-minimal What are the difficulties that need solving to add DAGMC+dependencies to the wheel? |
Glad to hear it is working for you.
No difficulties, Ahnaf and myself have already added DAGMC + Embree + Moab to a wheel. We have not included it in this PR as we are trying to keep it minimal. If this one is merged then we would follow up with a PR that adds DAGMC to the wheel. However for a sneak preview you could take a peak that this branch and this repo for method and resulting wheels. One difference is that we have used manylinux dockerfiles to ensure compatibility with other flavors of linux. |
Description
This PR introduces support for
scikit-build-core
, streamlining the build process and improving compatibility.Key Changes
Enable
scikit-build-core
supportpyproject.toml
to usescikit-build-core
instead of legacy methods.CMake and Build Updates
CMakeLists.txt
to supportskbuild
, ensuring compatibility with bothscikit-build-core
and native CMake builds.GenerateScript.cmake
to handle executable files (openmc
) on both Linux and macOS.OpenMCConfig.cmake.in
to integratescikit-build-core
.Git and Packaging Improvements
.h5
files from.gitignore
as they are needed.MANIFEST.in
as it is no longer required.CI and Docs Updates
pip install
asscikit-build-core
now handles it.Python API Enhancements
__init__.py
to retrieve OpenMC installation configuration from the Python side.Sponsored By
This contribution is kindly sponsored by @proximafusion, supporting the ongoing development and modernization of OpenMC’s Python packaging and build system.