diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0d08e261a2..8d8c190456 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,3 +9,7 @@ updates: directory: "/" # Location of package manifests schedule: interval: "weekly" + - package-ecosystem: "pip" # See documentation for possible values + directory: "python/" + schedule: + interval: "weekly" diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 40d57adc68..69a7e415ee 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -2,8 +2,8 @@ name: Conda install on: # Uncomment the below 'push' to trigger on push - # push: - # branches: + #push: + # branches: # - "**" schedule: # '*' is a special character in YAML, so string must be quoted @@ -15,52 +15,52 @@ jobs: name: Install and test strategy: matrix: - os: [ubuntu-latest, macos-13, macos-14] + os: [ubuntu-latest, macos-13, macos-14, windows-2022] + python-version: ["3.9", "3.10", "3.11", "3.12"] + petsc-scalar-type: ["real"] + include: + - os: ubuntu-latest + python-version: "3.12" + petsc-scalar-type: "complex" runs-on: ${{ matrix.os }} timeout-minutes: 30 + # This is necessary to ensure conda environment is activated in every step. + defaults: + run: + shell: bash -el {0} steps: - - name: Install conda (macOS) - if: runner.os == 'macOS' + - uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + python-version: ${{ matrix.python-version }} + + # TODO: These could probably be merged into one cross-platform step. + - name: Install DOLFINx with MPICH (Unix-like) + if: ${{ runner.os == 'macOS' || runner.os == 'Linux' }} run: | - brew install anaconda - echo "/opt/homebrew/anaconda3/bin:/usr/local/anaconda3/bin" >> $GITHUB_PATH - - name: Update conda + conda install -c conda-forge fenics-dolfinx mpich petsc=*=${{ matrix.petsc-scalar-type }}* + - name: Install DOLFINx (Windows) + if: ${{ runner.os == 'Windows' }} run: | - conda update conda - - - name: Install DOLFINx (py3-10) - run: | - conda create -n env3-10 -c conda-forge python=3.10 fenics-dolfinx mpich - conda env export -n env3-10 - - name: Test (py3-10) - run: | - conda run -n env3-10 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))" - conda run -n env3-10 mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))" - - - name: Install DOLFINx (py3-11) - run: | - conda create -n env3-11 -c conda-forge python=3.11 fenics-dolfinx mpich - conda env export -n env3-11 - - name: Test (py3-11) - run: | - conda run -n env3-11 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))" - conda run -n env3-11 mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))" - - - name: Install DOLFINx (py3-12) - run: | - conda create -n env3-12 -c conda-forge python=3.12 fenics-dolfinx mpich - conda env export -n env3-12 - - name: Test (py3-12) - run: | - conda run -n env3-12 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))" - conda run -n env3-12 mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))" - - - name: Install DOLFINx (py3-12, petsc-complex) + conda install -c conda-forge fenics-dolfinx + + - name: Test (Unix-like) + if: ${{ runner.os == 'macOS' || runner.os == 'Linux' }} run: | - conda create -n env3-12-complex -c conda-forge python=3.12 fenics-dolfinx petsc=*=complex* mpich - conda env export -n env3-12-complex - - name: Test (py3-12-complex) + conda info + conda list + mpiexec --version + mpiexec -v -np 1 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))" + mpiexec -v -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))" + + # NOTE: Late 2024, Intel MPI is only correctly setup using cmd.exe. + - name: Test (Windows) + if: ${{ runner.os == 'Windows' }} + shell: cmd /C CALL {0} run: | - conda run -n env3-12-complex python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))" - conda run -n env3-12-complex mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))" + conda info + conda list + mpiexec --version + mpiexec -v -np 1 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))" + mpiexec -v -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))" diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index ca3f9a3f31..b5bfbadc4c 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -20,7 +20,7 @@ on: type: string dolfinx_version: description: "DOLFINx release branch/tag to test" - default: "0.8.0" + default: "0.9.0" type: string jobs: @@ -34,7 +34,7 @@ jobs: PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe # Newer OpenMPI OMPI_MCA_rmaps_base_oversubscribe: true # Older OpenMPI - DOLFINX_RELEASE_VERSION: "${{ github.event_name != 'workflow_dispatch' && '0.8.0' || github.event.inputs.dolfinx_version }}" + DOLFINX_RELEASE_VERSION: "${{ github.event_name != 'workflow_dispatch' && '0.9.0' || github.event.inputs.dolfinx_version }}" steps: - name: Get Spack @@ -100,7 +100,6 @@ jobs: spack env create cpp-release-test spack env activate cpp-release-test spack add fenics-dolfinx@${DOLFINX_RELEASE_VERSION}+adios2 cmake py-fenics-ffcx - spack add py-nanobind@1.9 spack install cd dolfinx-release/cpp/ cd demo/poisson diff --git a/README.md b/README.md index d044e65427..b510ec5d06 100644 --- a/README.md +++ b/README.md @@ -78,23 +78,21 @@ comprehensive instructions. #### conda -To install the latest release of the Python interface, with pyvista -support for visualisation, using [conda](https://conda.io): +To install the latest release of the Python interface, including pyvista for +visualisation, using [conda](https://conda.io): ```shell conda create -n fenicsx-env conda activate fenicsx-env -conda install -c conda-forge fenics-dolfinx mpich pyvista +conda install -c conda-forge fenics-dolfinx mpich pyvista # Linux and macOS +conda install -c conda-forge fenics-dolfinx pyvista pyamg # Windows ``` -Windows conda packages are currently in beta testing and can be installed using: -```shell -conda create -n fenicsx-env -conda activate fenicsx-env -conda install -c minrk/label/fenics-windows -c conda-forge fenics-dolfinx=0.9.0.dev -``` -Because FEniCS uses just-in-time compilation it also necessary to install -[Microsoft Visual Studio](https://visualstudio.microsoft.com/downloads/). +*Windows only*: Windows conda packages are currently in beta testing. PETSc and +petsc4py are not available on Windows; as an alternative we recommend using +`pyamg` following `python/demo/demo_pyamg.py`. Because FEniCS uses just-in-time +compilation it necessary to install [Microsoft Visual +Studio](https://visualstudio.microsoft.com/downloads/). conda is distributed with [Anaconda](https://www.anaconda.com/) and [Miniconda](https://docs.conda.io/en/latest/miniconda.html). The recipe diff --git a/cpp/cmake/templates/dolfinx.conf.in b/cpp/cmake/templates/dolfinx.conf.in index 02bd8e4f82..36fcae00f7 100644 --- a/cpp/cmake/templates/dolfinx.conf.in +++ b/cpp/cmake/templates/dolfinx.conf.in @@ -1,10 +1,10 @@ # Helper file for setting non-default DOLFINx environment variables # Common Unix variables -export @OS_LIBRARY_PATH_NAME@=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@:$@OS_LIBRARY_PATH_NAME@ -export PATH=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@:$PATH -export PKG_CONFIG_PATH=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/pkgconfig:$PKG_CONFIG_PATH -export CMAKE_PREFIX_PATH=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/cmake:$CMAKE_PREFIX_PATH +export @OS_LIBRARY_PATH_NAME@=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@:${@OS_LIBRARY_PATH_NAME@:-} +export PATH=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@:${PATH:-} +export PKG_CONFIG_PATH=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/pkgconfig:${PKG_CONFIG_PATH:-} +export CMAKE_PREFIX_PATH=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/cmake:${CMAKE_PREFIX_PATH:-} # Special macOS variables -export DYLD_FRAMEWORK_PATH=/opt/local/Library/Frameworks:$DYLD_FRAMEWORK_PATH +export DYLD_FRAMEWORK_PATH=/opt/local/Library/Frameworks:${DYLD_FRAMEWORK_PATH:-} diff --git a/docker/Dockerfile.test-env b/docker/Dockerfile.test-env index 78385d8d47..bbe248f5de 100644 --- a/docker/Dockerfile.test-env +++ b/docker/Dockerfile.test-env @@ -31,7 +31,7 @@ ARG OPENMPI_PATCH=3 ######################################## -FROM ubuntu:24.04 as dev-env +FROM ubuntu:24.04 AS dev-env LABEL maintainer="FEniCS Steering Council " LABEL description="FEniCS testing and development environment with PETSc real, complex, 32-bit and 64-bit modes" @@ -143,8 +143,8 @@ RUN if [ "$MPI" = "mpich" ]; then \ ldconfig && \ rm -rf /tmp/* -ENV VIRTUAL_ENV /dolfinx-env -ENV PATH /dolfinx-env/bin:$PATH +ENV VIRTUAL_ENV=/dolfinx-env +ENV PATH=/dolfinx-env/bin:$PATH RUN python3 -m venv ${VIRTUAL_ENV} # Install Python packages (via pip)