diff --git a/.github/actions/parallel_h5py/action.yml b/.github/actions/install_h5py/action.yml similarity index 92% rename from .github/actions/parallel_h5py/action.yml rename to .github/actions/install_h5py/action.yml index e75cf03ab..caa37a512 100644 --- a/.github/actions/parallel_h5py/action.yml +++ b/.github/actions/install_h5py/action.yml @@ -1,4 +1,5 @@ name: 'Parallel h5py installation' +description: 'Install h5py in parallel mode using the system MPI and HDF5 libraries' runs: using: "composite" diff --git a/.github/actions/install_petsc4py/action.yml b/.github/actions/install_petsc4py/action.yml new file mode 100644 index 000000000..7cc21c01e --- /dev/null +++ b/.github/actions/install_petsc4py/action.yml @@ -0,0 +1,54 @@ +name: 'Install PETSc and petsc4py' +description: 'Install PETSc and petsc4py with complex support' + +runs: + using: "composite" + steps: + + - name: Cache PETSc + uses: actions/cache@v4 + id: cache-petsc + env: + cache-name: cache-PETSc + with: + path: "./petsc" + key: petsc-${{ matrix.os }}-${{ matrix.python-version }} + + - if: steps.cache-petsc.outputs.cache-hit != 'true' + name: Download a specific release of PETSc + shell: bash + run: | + git clone --depth 1 --branch v3.25.0 https://gitlab.com/petsc/petsc.git + # The branch "release" contains work towards the next version of PETSc, + # and it may not be stable. If necessary, it can be cloned as follows: + # git clone --depth 1 --branch release https://gitlab.com/petsc/petsc.git + + - if: steps.cache-petsc.outputs.cache-hit != 'true' + name: Install PETSc with complex support + shell: bash + working-directory: ./petsc + run: | + export PETSC_DIR=$(pwd) + export PETSC_ARCH=petsc-cmplx + ./configure --with-scalar-type=complex --with-fortran-bindings=0 --have-numpy=1 + make all + echo "PETSC_DIR=$PETSC_DIR" > petsc.env + echo "PETSC_ARCH=$PETSC_ARCH" >> petsc.env + + # This step is not really necessary and could be combined with PETSc install + # step; however it's good to verify if the cached PETSc installation really works! + - name: Test PETSc installation + shell: bash + working-directory: ./petsc + run: | + source petsc.env + make check + echo "PETSC_DIR=$PETSC_DIR" >> $GITHUB_ENV + echo "PETSC_ARCH=$PETSC_ARCH" >> $GITHUB_ENV + + - name: Install petsc4py + shell: bash + working-directory: ./petsc + run: | + pip install wheel Cython numpy + pip install src/binding/petsc4py diff --git a/.github/actions/macos_install/action.yml b/.github/actions/macos_installations/action.yml similarity index 93% rename from .github/actions/macos_install/action.yml rename to .github/actions/macos_installations/action.yml index ab3c1ae8c..52c60934e 100644 --- a/.github/actions/macos_install/action.yml +++ b/.github/actions/macos_installations/action.yml @@ -1,4 +1,5 @@ name: 'MacOS installation commands' +description: 'Install non-Python dependencies on macOS' runs: using: "composite" diff --git a/.github/actions/ubuntu_install/action.yml b/.github/actions/ubuntu_installations/action.yml similarity index 93% rename from .github/actions/ubuntu_install/action.yml rename to .github/actions/ubuntu_installations/action.yml index 1b04fc189..0edf2011d 100644 --- a/.github/actions/ubuntu_install/action.yml +++ b/.github/actions/ubuntu_installations/action.yml @@ -1,4 +1,5 @@ name: 'Ubuntu installation commands' +description: 'Install non-Python dependencies on Ubuntu' runs: using: "composite" diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7804583f7..7929ddf04 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,7 +24,7 @@ jobs: submodules: true - name: Install dependencies - uses: ./.github/actions/ubuntu_install + uses: ./.github/actions/ubuntu_installations - name: Update build tools run: | diff --git a/.github/workflows/deploy_check.yml b/.github/workflows/deploy_check.yml index fed925115..9be91e987 100644 --- a/.github/workflows/deploy_check.yml +++ b/.github/workflows/deploy_check.yml @@ -33,7 +33,7 @@ jobs: - name: Install dependencies if: steps.duplicate_check.outputs.should_skip != 'true' - uses: ./.github/actions/ubuntu_install + uses: ./.github/actions/ubuntu_installations - name: Update build tools if: steps.duplicate_check.outputs.should_skip != 'true' diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index c42429b95..c708fb6f6 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -56,51 +56,11 @@ jobs: run: | pip install --upgrade pip setuptools wheel - - name: Cache PETSc - uses: actions/cache@v4 - id: cache-petsc - env: - cache-name: cache-PETSc - with: - path: "./petsc" - key: petsc-${{ matrix.os }}-${{ matrix.python-version }} - - - if: steps.cache-petsc.outputs.cache-hit != 'true' - name: Download a specific release of PETSc - run: | - git clone --depth 1 -b release https://gitlab.com/petsc/petsc.git - # when a tag will be available for the latest release we can install with - # git clone --depth 1 --branch v*.**.* https://gitlab.com/petsc/petsc.git - - - if: steps.cache-petsc.outputs.cache-hit != 'true' - name: Install PETSc with complex support - working-directory: ./petsc - run: | - export PETSC_DIR=$(pwd) - export PETSC_ARCH=petsc-cmplx - ./configure --with-scalar-type=complex --with-fortran-bindings=0 --have-numpy=1 - make all - echo "PETSC_DIR=$PETSC_DIR" > petsc.env - echo "PETSC_ARCH=$PETSC_ARCH" >> petsc.env - - # This step is not really necessary and could be combined with PETSc install - # step; however it's good to verify if the cached PETSc installation really works! - - name: Test PETSc installation - working-directory: ./petsc - run: | - source petsc.env - make check - echo "PETSC_DIR=$PETSC_DIR" >> $GITHUB_ENV - echo "PETSC_ARCH=$PETSC_ARCH" >> $GITHUB_ENV - - - name: Install petsc4py - working-directory: ./petsc - run: | - pip install wheel Cython numpy - pip install src/binding/petsc4py + - name: Install PETSc and petsc4py with complex support + uses: ./.github/actions/install_petsc4py - name: Install h5py in parallel mode - uses: ./.github/actions/parallel_h5py + uses: ./.github/actions/install_h5py - name: Install project run: | diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 1826ed656..f482ff643 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -52,11 +52,11 @@ jobs: - name: Install non-Python dependencies on Ubuntu if: matrix.os == 'ubuntu-24.04' - uses: ./.github/actions/ubuntu_install + uses: ./.github/actions/ubuntu_installations - name: Install non-Python dependencies on macOS if: matrix.os == 'macos-14' - uses: ./.github/actions/macos_install + uses: ./.github/actions/macos_installations - name: Print information on MPI and HDF5 libraries run: | @@ -67,51 +67,11 @@ jobs: run: | pip install --upgrade pip setuptools wheel - - name: Cache PETSc - uses: actions/cache@v4 - id: cache-petsc - env: - cache-name: cache-PETSc - with: - path: "./petsc" - key: petsc-${{ matrix.os }}-${{ matrix.python-version }} - - - if: steps.cache-petsc.outputs.cache-hit != 'true' - name: Download a specific release of PETSc - run: | - git clone --depth 1 -b release https://gitlab.com/petsc/petsc.git - # when a tag will be available for the latest release we can install with - # git clone --depth 1 --branch v*.**.* https://gitlab.com/petsc/petsc.git - - - if: steps.cache-petsc.outputs.cache-hit != 'true' - name: Install PETSc with complex support - working-directory: ./petsc - run: | - export PETSC_DIR=$(pwd) - export PETSC_ARCH=petsc-cmplx - ./configure --with-scalar-type=complex --with-fortran-bindings=0 --have-numpy=1 - make all - echo "PETSC_DIR=$PETSC_DIR" > petsc.env - echo "PETSC_ARCH=$PETSC_ARCH" >> petsc.env - - # This step is not really necessary and could be combined with PETSc install - # step; however it's good to verify if the cached PETSc installation really works! - - name: Test PETSc installation - working-directory: ./petsc - run: | - source petsc.env - make check - echo "PETSC_DIR=$PETSC_DIR" >> $GITHUB_ENV - echo "PETSC_ARCH=$PETSC_ARCH" >> $GITHUB_ENV - - - name: Install petsc4py - working-directory: ./petsc - run: | - pip install wheel Cython numpy - pip install src/binding/petsc4py + - name: Install PETSc and petsc4py with complex support + uses: ./.github/actions/install_petsc4py - name: Install h5py in parallel mode - uses: ./.github/actions/parallel_h5py + uses: ./.github/actions/install_h5py - name: Install project run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b6bfa652..3546db8cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. ### Added - #577 : Add an installation configuration option to choose the backend language +- [DEVELOPER] Create action `install_petsc4py` to install PETSc & `petsc4py` w/ complex support ### Fixed @@ -18,16 +19,19 @@ All notable changes to this project will be documented in this file. - #570 : Optimize PSYDAC logo - #565 : Expand editable install info in `README.md` - #566 : Fix command `psydac test --mpi` on Ubuntu machines +- [DEVELOPER] Add missing 'description' properties (required!) to our GitHub actions - [DEVELOPER] Update CI installation of `petsc4py` after release of `setuptools` 81.0 - [DEVELOPER] Check correct reporting of failure for `psydac test` command in CI testing - [DEVELOPER] Use correct configuration file in coverage CI tests ### Changed +- #580 : Use PETSc 3.25.0 whose Python bindings `petsc4py` install correctly with `setuptools>=81.0` - #579 : Require `pyccel>=2.2.3` which can compile all kernels with C - #579 : Require `numpy>=2.1` to support Python >= 3.10 - #579 : Require `pytest>=9.0` and use `pytest.toml` instead of `pytest.ini` for Pytest configuration - #579 : Move coverage configuration from `pyproject.toml` to `psydac/pytest.toml` +- [DEVELOPER] Rename actions: `macos/ubuntu_install` -> `macos/ubuntu_installations` - [DEVELOPER] Do not check file changes to trigger testing workflow on PRs - [DEVELOPER] Run documentation workflow on pushes to `devel` whenever `README.md` is modified - [DEVELOPER] Run testing and documentation workflows on PRs only when set to "ready for review" diff --git a/docs/installation.md b/docs/installation.md index 7e2c2d10b..0dd7576e1 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -162,7 +162,7 @@ Although PSYDAC provides several iterative linear solvers which work with our na In order to use these additional feature, PETSc and petsc4py must be installed as follows. First, we download the latest release of PETSc from its [official Git repository](https://gitlab.com/petsc/petsc): ```sh -git clone --depth 1 --branch v3.24.2 https://gitlab.com/petsc/petsc.git +git clone --depth 1 --branch v3.25.0 https://gitlab.com/petsc/petsc.git ``` Next, we specify a configuration for complex numbers, and install PETSc in a local directory: ```sh