-
Notifications
You must be signed in to change notification settings - Fork 5
HPC-friendly Python build #429
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,6 +130,56 @@ jobs: | |
| name: wheel-linux-${{ matrix.python-version }} | ||
| path: wheelhouse/*.whl | ||
|
|
||
| build-wheels-linux-hpc: | ||
| name: Build wheel on Ubuntu HPC profile (Python 3.12) | ||
| needs: [check-version] | ||
| runs-on: ubuntu-latest | ||
| if: needs.check-version.outputs.should_build == 'true' | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python 3.12 | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt update | ||
| sudo apt install -y cmake build-essential doxygen libtbb-dev | ||
|
|
||
| - name: Install build dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install build wheel setuptools pybind11-stubgen | ||
|
|
||
| - name: Build Ubuntu HPC wheel (-O3 only) | ||
| env: | ||
| CMAKE_ARGS: "-DDSF_HPC_RELEASE=ON -DDSF_OPTIMIZE_ARCH=OFF" | ||
| DSF_HPC_BUILD: "ON" | ||
| DSF_PACKAGE_VERSION: ${{ needs.check-version.outputs.publish_version }} | ||
| run: | | ||
| rm -rf dist wheelhouse | ||
| python -m build --wheel | ||
|
|
||
| - name: Prepare wheel artifact | ||
| run: | | ||
| mkdir -p wheelhouse | ||
| cp dist/*.whl wheelhouse/ | ||
|
|
||
| - name: Test wheel installation | ||
| run: | | ||
| python -m pip install wheelhouse/*.whl | ||
| python -c "import dsf; print('DSF Ubuntu HPC wheel installation successful')" | ||
|
|
||
| - name: Upload Ubuntu HPC wheel as artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: wheel-linux-hpc-3.12 | ||
| path: wheelhouse/*.whl | ||
|
|
||
| build-wheels-macos: | ||
| name: Build wheels on macOS (Python ${{ matrix.python-version }}) | ||
| needs: [check-version] | ||
|
|
@@ -263,7 +313,7 @@ jobs: | |
|
|
||
| publish: | ||
| name: Publish to PyPI | ||
| needs: [check-version, build-wheels-linux, build-wheels-macos, build-wheels-windows, build-sdist] | ||
| needs: [check-version, build-wheels-linux, build-wheels-linux-hpc, build-wheels-macos, build-wheels-windows, build-sdist] | ||
|
||
| runs-on: ubuntu-latest | ||
| if: needs.check-version.outputs.should_build == 'true' | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,6 +23,7 @@ option(DSF_BENCHMARKS "Build DSF benchmarks" OFF) | |||||||||
| option(DSF_BUILD_PIC "Build DSF with position-independent code" OFF) | ||||||||||
| option(BUILD_PYTHON_BINDINGS "Build Python bindings" OFF) | ||||||||||
| option(DSF_OPTIMIZE_ARCH "Optimize for native architecture" ON) | ||||||||||
| option(DSF_HPC_RELEASE "Build release flags suitable for HPC infrastructure" OFF) | ||||||||||
|
|
||||||||||
| # If CMAKE_BUILD_TYPE not set, default to Debug | ||||||||||
| if(NOT CMAKE_BUILD_TYPE) | ||||||||||
|
|
@@ -47,21 +48,33 @@ set(CMAKE_CXX_STANDARD 20) | |||||||||
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||||||||||
| set(CMAKE_CXX_EXTENSIONS OFF) | ||||||||||
|
|
||||||||||
| if(DSF_HPC_RELEASE) | ||||||||||
| set(DSF_OPTIMIZE_ARCH OFF) | ||||||||||
|
||||||||||
| set(DSF_OPTIMIZE_ARCH OFF) | |
| set(DSF_OPTIMIZE_ARCH | |
| OFF | |
| CACHE BOOL "Optimize for native architecture" FORCE) |
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.
This job sets
CMAKE_ARGSin the environment, butsetup.pydoesn’t currently read/appendCMAKE_ARGSat all, so these flags won’t affect the CMake configure step. Either wireCMAKE_ARGSthrough insetup.py(preferred, since other jobs also set it) or removeCMAKE_ARGShere and rely solely on theDSF_HPC_BUILDtoggle.