diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 8dd638008ec..c054efe49bf 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -8,7 +8,7 @@ on: inputs: dolfinx_ref: description: "dolfinx git ref to checkout" - default: "" + default: "main" type: string build_fenicsx_stack: @@ -18,24 +18,24 @@ on: basix_ref: description: "basix git ref to checkout" - default: "" + default: "main" type: string ufl_ref: description: "ufl git ref to checkout" - default: "" + default: "main" type: string ffcx_ref: description: "ffcx git ref to checkout" - default: "" + default: "main" type: string workflow_call: inputs: dolfinx_ref: description: "dolfinx git ref to checkout" - default: "" + default: "main" type: string build_fenicsx_stack: @@ -45,17 +45,17 @@ on: basix_ref: description: "basix git ref to checkout" - default: "" + default: "main" type: string ufl_ref: description: "ufl git ref to checkout" - default: "" + default: "main" type: string ffcx_ref: description: "ffcx git ref to checkout" - default: "" + default: "main" type: string jobs: @@ -64,18 +64,18 @@ jobs: runs-on: ubuntu-latest env: - MPI4PY_VERSION: 3.1.2 - PETSC4PY_VERSION: 3.16.1 - CIBW_MANYLINUX_X86_64_IMAGE: docker.io/fenicsproject/wheelbuilder_x86_64:latest - CIBW_BUILD: cp37-manylinux_x86_64 cp38-manylinux_x86_64 cp39-manylinux_x86_64 + CIBW_BUILD: cp39-manylinux_x86_64 CIBW_BUILD_VERBOSITY: 1 - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=file:///project/simple PETSC_DIR=/usr/local MAKEFLAGS=-j2 + CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=file:///project/simple MAKEFLAGS=-j3 + CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_34_x86_64:2024-11-24-a3012f3 steps: - uses: actions/setup-python@v5 + with: + python-version: 3.12 - name: Install Python dependencies - run: python -m pip install cibuildwheel simple503 wheel + run: python -m pip install cibuildwheel simple503 build - name: Checkout Basix if: ${{ github.event.inputs.build_fenicsx_stack == 'true' }} @@ -88,8 +88,8 @@ jobs: - name: Build Basix wheel if: ${{ github.event.inputs.build_fenicsx_stack == 'true' }} run: | - cd basix - python -m cibuildwheel --output-dir ../wheelhouse . + cd basix/ + python -m cibuildwheel --output-dir ../wheelhouse/ . - name: Checkout UFL if: ${{ github.event.inputs.build_fenicsx_stack == 'true' }} @@ -101,7 +101,8 @@ jobs: - name: Build UFL wheel if: ${{ github.event.inputs.build_fenicsx_stack == 'true' }} - run: python -m pip wheel --no-deps -w wheelhouse ./ufl + run: | + python -m build -o wheelhouse/ ufl/ - name: Checkout FFCx if: ${{ github.event.inputs.build_fenicsx_stack == 'true' }} @@ -113,16 +114,8 @@ jobs: - name: Build FFCx wheel if: ${{ github.event.inputs.build_fenicsx_stack == 'true' }} - run: python -m pip wheel --no-deps -w wheelhouse ./ffcx - - - name: Download mpi4py run: | - curl -L -O https://github.com/mpi4py/mpi4py/releases/download/${MPI4PY_VERSION}/mpi4py-${MPI4PY_VERSION}.tar.gz - mkdir -p mpi4py - tar -xf mpi4py-${MPI4PY_VERSION}.tar.gz -C mpi4py --strip-components 1 - - - name: Build mpi4py wheels - run: python -m cibuildwheel --output-dir wheelhouse mpi4py + python -m build -o wheelhouse/ ffcx/ - name: Make temporary simple503 repository run: | @@ -130,22 +123,6 @@ jobs: cp wheelhouse/* simple/ python -m simple503 --base-url file:///project/simple simple - - name: Download petsc4py - run: | - curl -L -O https://pypi.io/packages/source/p/petsc4py/petsc4py-${PETSC4PY_VERSION}.tar.gz - mkdir -p petsc4py - tar -xf petsc4py-${PETSC4PY_VERSION}.tar.gz -C petsc4py --strip-components 1 - - - name: Build petsc4py wheels - run: python -m cibuildwheel --output-dir wheelhouse petsc4py - env: - CIBW_BEFORE_BUILD: python -m pip install numpy # Not specified correctly in petsc4py - - - name: Update temporary simple503 repository - run: | - cp wheelhouse/* simple/ - python -m simple503 --base-url file:///project/simple simple - - name: Checkout DOLFINx uses: actions/checkout@v4 with: @@ -155,10 +132,27 @@ jobs: # fenics-ffcx and fenics-basix are required by DOLFINx C++ build # mpi4py and petsc4py are build_requirements of DOLFINx Python - name: Build DOLFINx wheel - run: python -m cibuildwheel --output-dir wheelhouse dolfinx/python + run: | + python -m cibuildwheel --output-dir wheelhouse/ dolfinx/python env: - CIBW_BEFORE_BUILD: python -m pip -v install --prefer-binary fenics-ffcx fenics-basix && python -m pip -v install --prefer-binary petsc4py mpi4py && cmake -S dolfinx/cpp -B build-dir -DPython3_EXECUTABLE=$(which python) && cmake --build build-dir && cmake --install build-dir - CIBW_REPAIR_WHEEL_COMMAND_LINUX: export LD_LIBRARY_PATH=$(python -c "import site; print(site.getsitepackages()[0] + '/fenics_basix.libs')") && auditwheel repair -w {dest_dir} {wheel} + CIBW_BEFORE_BUILD: | + . /etc/profile && + dnf -y update && + dnf install -y dnf-plugins-core && + dnf install -y epel-release && + /usr/bin/crb enable && + dnf -y update && + dnf -y install boost-devel boost-program-options cmake hdf5-devel hdf5-mpich-devel make mpich-devel openblas-devel pugixml-devel spdlog-devel && + module load mpi/mpich-$(arch) && + pip -v install mpi4py -i https://pypi.anaconda.org/mpi4py/simple && + pip -v install 'fenics-basix==0.10.0.dev0' 'fenics-ffcx==0.10.0.dev0' 'fenics-ufl==2024.3.0.dev0' && + pip -v install scikit-build-core[pyproject] nanobind && + /usr/bin/cmake -S dolfinx/cpp -B build-dir -DPython3_EXECUTABLE=$(which python) -DHDF5_C_INCLUDE_DIR=/usr/include/mpich-$(arch) -DHDF5_C_LIBRARIES=/usr/lib64/mpich/lib && + /usr/bin/cmake --build build-dir && + /usr/bin/cmake --install build-dir + CIBW_REPAIR_WHEEL_COMMAND_LINUX: export LD_LIBRARY_PATH=$(python -c "import site; print(site.getsitepackages()[0] + '/fenics_basix.libs')"):${LD_LIBRARY_PATH} && auditwheel repair -w {dest_dir} {wheel} + CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=file:///project/simple MAKEFLAGS=-j3 + CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - name: Update temporary simple503 repository run: | @@ -189,16 +183,3 @@ jobs: with: name: "simple503" path: simple/* - - # Extract mpiexec from docker image - - name: Extract mpiexec.hydra from Docker image - run: | - export CONTAINER_ID=$(docker create ${CIBW_MANYLINUX_X86_64_IMAGE}) - docker cp ${CONTAINER_ID}:/usr/local/bin/mpiexec.hydra mpiexec.hydra - docker rm ${CONTAINER_ID} - - - name: Upload mpiexec artifact - uses: actions/upload-artifact@v4 - with: - name: "mpiexec.hydra" - path: mpiexec.hydra diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 20003555877..27067fd9f8a 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -297,11 +297,11 @@ endif() find_package(pugixml REQUIRED) # Note: When updating Boost version, also update DOLFINXConfig.cmake.in -if(DEFINED ENV{BOOST_ROOT} OR DEFINED BOOST_ROOT) - set(Boost_NO_SYSTEM_PATHS on) -endif() +#if(DEFINED ENV{BOOST_ROOT} OR DEFINED BOOST_ROOT) +# set(Boost_NO_SYSTEM_PATHS on) +#endif() -set(Boost_USE_MULTITHREADED $ENV{BOOST_USE_MULTITHREADED}) +#set(Boost_USE_MULTITHREADED $ENV{BOOST_USE_MULTITHREADED}) set(Boost_VERBOSE TRUE) find_package(Boost 1.70 REQUIRED) set_package_properties(