From df6dc7b63946eecdc1fa817a3ace245c1bde85aa Mon Sep 17 00:00:00 2001 From: "Garth N. Wells" Date: Fri, 13 Sep 2024 16:56:40 +0100 Subject: [PATCH 1/3] Avoid CMake Boost policy warning (#3395) --- cpp/cmake/templates/DOLFINXConfig.cmake.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpp/cmake/templates/DOLFINXConfig.cmake.in b/cpp/cmake/templates/DOLFINXConfig.cmake.in index e502bd85aff..ac88d977ba3 100644 --- a/cpp/cmake/templates/DOLFINXConfig.cmake.in +++ b/cpp/cmake/templates/DOLFINXConfig.cmake.in @@ -12,13 +12,17 @@ find_dependency(MPI REQUIRED) find_dependency(spdlog REQUIRED) find_dependency(pugixml REQUIRED) +if(POLICY CMP0167) + cmake_policy(SET CMP0167 NEW) # Boost CONFIG mode +endif() + # Check for Boost 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_VERBOSE TRUE) -find_dependency(Boost 1.70 REQUIRED COMPONENTS timer) +find_package(Boost 1.70 REQUIRED timer) if(@ufcx_FOUND@) find_dependency(ufcx) From 7bb01adaa736a325ca048e37aec0b51cf9ff1f2e Mon Sep 17 00:00:00 2001 From: "Garth N. Wells" Date: Fri, 13 Sep 2024 16:56:52 +0100 Subject: [PATCH 2/3] Bump dependency version in Dockerfiles (#3394) * Version bumps in Dockerfile * Fix cython install * Revert HDF5 version bump * Format fixes * HDF5 filename updates * Fix HDF5 tarball names * More HDF5 updates --- .github/workflows/pyvista.yml | 4 ++-- docker/Dockerfile.end-user | 4 ++-- docker/Dockerfile.redhat | 12 +++++------- docker/Dockerfile.test-env | 26 +++++++++----------------- python/dolfinx/wrappers/la.cpp | 2 +- python/dolfinx/wrappers/refinement.cpp | 5 +++-- 6 files changed, 22 insertions(+), 31 deletions(-) diff --git a/.github/workflows/pyvista.yml b/.github/workflows/pyvista.yml index c96f735a4f1..6263f0ae29a 100644 --- a/.github/workflows/pyvista.yml +++ b/.github/workflows/pyvista.yml @@ -20,8 +20,8 @@ jobs: # For pyvista/pyvistaqt DISPLAY: ":99.0" PYVISTA_OFF_SCREEN: true - PYVISTA_QT_VERSION: 0.11.0 - PYVISTA_VERSION: 0.43.10 + PYVISTA_QT_VERSION: 0.11.1 + PYVISTA_VERSION: 0.44.1 QT_DEBUG_PLUGINS: 1 PETSC_ARCH: ${{ matrix.petsc_arch }} diff --git a/docker/Dockerfile.end-user b/docker/Dockerfile.end-user index 1a75d05ac44..b07284a9f9f 100644 --- a/docker/Dockerfile.end-user +++ b/docker/Dockerfile.end-user @@ -34,7 +34,7 @@ # echo "FROM dolfinx/dolfinx-onbuild:nightly" | docker build -f- . # -ARG PYVISTA_VERSION=0.43.8 +ARG PYVISTA_VERSION=0.44.1 # Used to set the correct PYTHONPATH for the real and complex install of # DOLFINx @@ -170,7 +170,7 @@ RUN dpkgArch="$(dpkg --print-architecture)"; \ pip install --no-cache-dir pyvista[trame]==${PYVISTA_VERSION} ;; \ esac; \ case "$dpkgArch" in arm64) \ - pip install --no-cache-dir https://github.com/finsberg/vtk-aarch64/releases/download/vtk-9.3.0-cp312/vtk-9.3.0.dev0-cp312-cp312-linux_aarch64.whl && \ + pip install --no-cache-dir https://github.com/finsberg/vtk-aarch64/releases/download/vtk-9.3.0-cp312/vtk-9.3.0.dev0-cp312-cp312-linux_aarch64.whl && \ pip install --no-cache-dir pyvista[trame]==${PYVISTA_VERSION} ;; \ esac; \ pip cache purge diff --git a/docker/Dockerfile.redhat b/docker/Dockerfile.redhat index 363e1cc9cb6..b9567630715 100644 --- a/docker/Dockerfile.redhat +++ b/docker/Dockerfile.redhat @@ -7,10 +7,8 @@ FROM rockylinux/rockylinux:9 ARG BUILD_NP=4 -ARG HDF5_SERIES=1.14 -ARG HDF5_PATCH=3 -ARG HDF5_FIX= -ARG PETSC_VERSION=3.21.3 +ARG HDF5_VERSION=1.14.4.3 +ARG PETSC_VERSION=3.21.5 ARG MPICH_VERSION=4.2.2 WORKDIR /tmp @@ -54,9 +52,9 @@ RUN curl -L -O https://www.mpich.org/static/downloads/${MPICH_VERSION}/mpich-${M rm -rf /tmp/* # Build HDF5 -RUN curl -L -O https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${HDF5_SERIES}/hdf5-${HDF5_SERIES}.${HDF5_PATCH}/src/hdf5-${HDF5_SERIES}.${HDF5_PATCH}${HDF5_FIX}.tar.gz && \ - tar -xf hdf5-${HDF5_SERIES}.${HDF5_PATCH}${HDF5_FIX}.tar.gz && \ - cd hdf5-${HDF5_SERIES}.${HDF5_PATCH}${HDF5_FIX} && \ +RUN curl -L -O https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5_${HDF5_VERSION}.tar.gz && \ + tar -xf hdf5_${HDF5_VERSION}.tar.gz && \ + cd hdf5-hdf5_${HDF5_VERSION} && \ ./configure --prefix=/usr/local --enable-parallel --enable-shared --enable-static=no && \ make -j${BUILD_NP} install && \ rm -rf /tmp/* diff --git a/docker/Dockerfile.test-env b/docker/Dockerfile.test-env index 4399b882622..72da92c5b19 100644 --- a/docker/Dockerfile.test-env +++ b/docker/Dockerfile.test-env @@ -13,14 +13,12 @@ # ARG ADIOS2_VERSION=2.10.1 -ARG DOXYGEN_VERSION=1_11_0 +ARG DOXYGEN_VERSION=1_12_0 ARG GMSH_VERSION=4_13_1 -ARG HDF5_SERIES=1.14 -ARG HDF5_PATCH=3 -ARG HDF5_FIX= +ARG HDF5_VERSION=1.14.4.3 ARG KAHIP_VERSION=3.16 -ARG NUMPY_VERSION=1.26.4 -ARG PETSC_VERSION=3.21.3 +ARG NUMPY_VERSION=2.1.1 +ARG PETSC_VERSION=3.21.5 ARG SLEPC_VERSION=3.21.1 ARG MPICH_VERSION=4.2.2 @@ -35,9 +33,7 @@ LABEL description="FEniCS testing and development environment with PETSc real, c ARG DOXYGEN_VERSION ARG GMSH_VERSION -ARG HDF5_SERIES -ARG HDF5_PATCH -ARG HDF5_FIX +ARG HDF5_VERSION ARG PETSC_VERSION ARG SLEPC_VERSION ARG ADIOS2_VERSION @@ -149,7 +145,7 @@ RUN python3 -m venv ${VIRTUAL_ENV} # Install Python packages (via pip) RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \ - pip install --no-cache-dir numpy==${NUMPY_VERSION} && \ + pip install --no-cache-dir cython numpy==${NUMPY_VERSION} && \ pip install --no-cache-dir --no-build-isolation mpi4py # Install KaHIP @@ -165,9 +161,9 @@ RUN wget -nc --quiet https://github.com/kahip/kahip/archive/v${KAHIP_VERSION}.ta # HDF5 overrides CMAKE_INSTALL_PREFIX by default, hence it is set # below to ensure that HDF5 is installed into a path where it can be # found. -RUN wget -nc --quiet https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${HDF5_SERIES}/hdf5-${HDF5_SERIES}.${HDF5_PATCH}/src/hdf5-${HDF5_SERIES}.${HDF5_PATCH}${HDF5_FIX}.tar.gz && \ - tar xfz hdf5-${HDF5_SERIES}.${HDF5_PATCH}${HDF5_FIX}.tar.gz && \ - cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DHDF5_ENABLE_PARALLEL=on -DHDF5_ENABLE_Z_LIB_SUPPORT=on -B build-dir -S hdf5-${HDF5_SERIES}.${HDF5_PATCH}${HDF5_FIX} && \ +RUN wget -nc --quiet https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5_${HDF5_VERSION}.tar.gz && \ + tar xfz hdf5_${HDF5_VERSION}.tar.gz && \ + cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DHDF5_ENABLE_PARALLEL=on -DHDF5_ENABLE_Z_LIB_SUPPORT=on -B build-dir -S hdf5-hdf5_${HDF5_VERSION} && \ cmake --build build-dir && \ cmake --install build-dir && \ rm -rf /tmp/* @@ -316,9 +312,7 @@ RUN apt-get -qq update && \ make PETSC_ARCH=linux-gnu-complex128-64 ${MAKEFLAGS} all && \ # Install petsc4py cd src/binding/petsc4py && \ - pip install --no-cache-dir cython && \ PETSC_ARCH=linux-gnu-real32-32:linux-gnu-complex64-32:linux-gnu-real64-32:linux-gnu-complex128-32:linux-gnu-real64-64:linux-gnu-complex128-64 pip -v install --no-cache-dir --no-build-isolation . && \ - pip3 uninstall --yes cython && \ # Cleanup apt-get -y purge bison flex && \ apt-get -y autoremove && \ @@ -359,9 +353,7 @@ RUN git clone --depth=1 -b v${SLEPC_VERSION} https://gitlab.com/slepc/slepc.git make && \ # Install slepc4py cd src/binding/slepc4py && \ - pip3 install --no-cache-dir cython && \ PETSC_ARCH=linux-gnu-real32-32:linux-gnu-complex64-32:linux-gnu-real64-32:linux-gnu-complex128-32:linux-gnu-real64-64:linux-gnu-complex128-64 pip -v install --no-cache-dir --no-build-isolation . && \ - pip3 uninstall --yes cython && \ rm -rf ${SLEPC_DIR}/CTAGS ${SLEPC_DIR}/TAGS ${SLEPC_DIR}/docs ${SLEPC_DIR}/src/ ${SLEPC_DIR}/**/obj/ ${SLEPC_DIR}/**/test/ && \ rm -rf /tmp/* diff --git a/python/dolfinx/wrappers/la.cpp b/python/dolfinx/wrappers/la.cpp index e3d8ebd76fc..e0aeff3db8e 100644 --- a/python/dolfinx/wrappers/la.cpp +++ b/python/dolfinx/wrappers/la.cpp @@ -138,7 +138,7 @@ void declare_objects(nb::module_& m, const std::string& type) std::size_t nrows = self.num_all_rows() * bs[0]; std::size_t ncols = self.index_map(1)->size_global() * bs[1]; auto dense = self.to_dense(); - assert(nrows*ncols == dense.size()); + assert(nrows * ncols == dense.size()); return dolfinx_wrappers::as_nbarray(std::move(self.to_dense()), {nrows, ncols}); }) diff --git a/python/dolfinx/wrappers/refinement.cpp b/python/dolfinx/wrappers/refinement.cpp index 45770c1c476..af5337a5684 100644 --- a/python/dolfinx/wrappers/refinement.cpp +++ b/python/dolfinx/wrappers/refinement.cpp @@ -47,8 +47,9 @@ void export_refinement_with_variable_mesh_type(nb::module_& m) [](const dolfinx::mesh::Mesh& mesh, bool redistribute, dolfinx::mesh::GhostMode ghost_mode) { - auto [mesh_refined, parent_cells] = dolfinx::refinement::refine_interval( - mesh, std::nullopt, redistribute, ghost_mode); + auto [mesh_refined, parent_cells] + = dolfinx::refinement::refine_interval(mesh, std::nullopt, + redistribute, ghost_mode); return std::tuple(std::move(mesh_refined), as_nbarray(std::move(parent_cells))); }, From 9635a820abce147172a89009227f249bec7b8eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=2E=20K=C3=BChner?= <56360279+schnellerhase@users.noreply.github.com> Date: Sun, 15 Sep 2024 15:50:30 +0200 Subject: [PATCH 3/3] Fix missing template type in generation (#3404) --- cpp/dolfinx/mesh/generation.h | 34 ++++++++++++++++---------------- python/dolfinx/wrappers/mesh.cpp | 6 +++--- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/cpp/dolfinx/mesh/generation.h b/cpp/dolfinx/mesh/generation.h index 5afd4264f23..15bd2a4545e 100644 --- a/cpp/dolfinx/mesh/generation.h +++ b/cpp/dolfinx/mesh/generation.h @@ -37,36 +37,36 @@ enum class DiagonalType namespace impl { template -Mesh build_tri(MPI_Comm comm, std::array, 2> p, +Mesh build_tri(MPI_Comm comm, std::array, 2> p, std::array n, const CellPartitionFunction& partitioner, DiagonalType diagonal); template -Mesh build_quad(MPI_Comm comm, const std::array, 2> p, +Mesh build_quad(MPI_Comm comm, const std::array, 2> p, std::array n, const CellPartitionFunction& partitioner); template std::vector create_geom(MPI_Comm comm, - std::array, 2> p, + std::array, 2> p, std::array n); template Mesh build_tet(MPI_Comm comm, MPI_Comm subcomm, - std::array, 2> p, + std::array, 2> p, std::array n, const CellPartitionFunction& partitioner); template Mesh build_hex(MPI_Comm comm, MPI_Comm subcomm, - std::array, 2> p, + std::array, 2> p, std::array n, const CellPartitionFunction& partitioner); template Mesh build_prism(MPI_Comm comm, MPI_Comm subcomm, - std::array, 2> p, + std::array, 2> p, std::array n, const CellPartitionFunction& partitioner); } // namespace impl @@ -93,7 +93,7 @@ Mesh build_prism(MPI_Comm comm, MPI_Comm subcomm, /// @return Mesh template Mesh create_box(MPI_Comm comm, MPI_Comm subcomm, - std::array, 2> p, + std::array, 2> p, std::array n, CellType celltype, CellPartitionFunction partitioner = nullptr) { @@ -139,7 +139,7 @@ Mesh create_box(MPI_Comm comm, MPI_Comm subcomm, /// across MPI ranks. /// @return Mesh template -Mesh create_box(MPI_Comm comm, std::array, 2> p, +Mesh create_box(MPI_Comm comm, std::array, 2> p, std::array n, CellType celltype, const CellPartitionFunction& partitioner = nullptr) { @@ -163,7 +163,7 @@ Mesh create_box(MPI_Comm comm, std::array, 2> p, /// @param[in] diagonal Direction of diagonals /// @return Mesh template -Mesh create_rectangle(MPI_Comm comm, std::array, 2> p, +Mesh create_rectangle(MPI_Comm comm, std::array, 2> p, std::array n, CellType celltype, CellPartitionFunction partitioner, DiagonalType diagonal = DiagonalType::right) @@ -206,7 +206,7 @@ Mesh create_rectangle(MPI_Comm comm, std::array, 2> p, /// @param[in] diagonal Direction of diagonals /// @return Mesh template -Mesh create_rectangle(MPI_Comm comm, std::array, 2> p, +Mesh create_rectangle(MPI_Comm comm, std::array, 2> p, std::array n, CellType celltype, DiagonalType diagonal = DiagonalType::right) { @@ -227,7 +227,7 @@ Mesh create_rectangle(MPI_Comm comm, std::array, 2> p, /// across MPI ranks. /// @return A mesh. template -Mesh create_interval(MPI_Comm comm, std::int64_t n, std::array p, +Mesh create_interval(MPI_Comm comm, std::int64_t n, std::array p, mesh::GhostMode ghost_mode = mesh::GhostMode::none, CellPartitionFunction partitioner = nullptr) { @@ -278,7 +278,7 @@ namespace impl { template std::vector create_geom(MPI_Comm comm, - std::array, 2> p, + std::array, 2> p, std::array n) { // Extract data @@ -327,7 +327,7 @@ std::vector create_geom(MPI_Comm comm, template Mesh build_tet(MPI_Comm comm, MPI_Comm subcomm, - std::array, 2> p, + std::array, 2> p, std::array n, const CellPartitionFunction& partitioner) { @@ -375,7 +375,7 @@ Mesh build_tet(MPI_Comm comm, MPI_Comm subcomm, template mesh::Mesh build_hex(MPI_Comm comm, MPI_Comm subcomm, - std::array, 2> p, + std::array, 2> p, std::array n, const CellPartitionFunction& partitioner) { @@ -418,7 +418,7 @@ mesh::Mesh build_hex(MPI_Comm comm, MPI_Comm subcomm, template Mesh build_prism(MPI_Comm comm, MPI_Comm subcomm, - std::array, 2> p, + std::array, 2> p, std::array n, const CellPartitionFunction& partitioner) { @@ -464,7 +464,7 @@ Mesh build_prism(MPI_Comm comm, MPI_Comm subcomm, } template -Mesh build_tri(MPI_Comm comm, std::array, 2> p, +Mesh build_tri(MPI_Comm comm, std::array, 2> p, std::array n, const CellPartitionFunction& partitioner, DiagonalType diagonal) @@ -621,7 +621,7 @@ Mesh build_tri(MPI_Comm comm, std::array, 2> p, } template -Mesh build_quad(MPI_Comm comm, const std::array, 2> p, +Mesh build_quad(MPI_Comm comm, const std::array, 2> p, std::array n, const CellPartitionFunction& partitioner) { diff --git a/python/dolfinx/wrappers/mesh.cpp b/python/dolfinx/wrappers/mesh.cpp index 8706760b907..b894a3903b1 100644 --- a/python/dolfinx/wrappers/mesh.cpp +++ b/python/dolfinx/wrappers/mesh.cpp @@ -241,7 +241,7 @@ void declare_mesh(nb::module_& m, std::string type) std::string create_interval("create_interval_" + type); m.def( create_interval.c_str(), - [](MPICommWrapper comm, std::int64_t n, std::array p, + [](MPICommWrapper comm, std::int64_t n, std::array p, dolfinx::mesh::GhostMode ghost_mode, const PythonCellPartitionFunction& part) { @@ -254,7 +254,7 @@ void declare_mesh(nb::module_& m, std::string type) std::string create_rectangle("create_rectangle_" + type); m.def( create_rectangle.c_str(), - [](MPICommWrapper comm, std::array, 2> p, + [](MPICommWrapper comm, std::array, 2> p, std::array n, dolfinx::mesh::CellType celltype, const PythonCellPartitionFunction& part, dolfinx::mesh::DiagonalType diagonal) @@ -269,7 +269,7 @@ void declare_mesh(nb::module_& m, std::string type) std::string create_box("create_box_" + type); m.def( create_box.c_str(), - [](MPICommWrapper comm, std::array, 2> p, + [](MPICommWrapper comm, std::array, 2> p, std::array n, dolfinx::mesh::CellType celltype, const PythonCellPartitionFunction& part) {