mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
gnu: fenics-dolfin: Fix build.
* gnu/packages/patches/fenics-dolfin-algorithm.patch, gnu/packages/patches/fenics-dolfin-boost.patch, gnu/packages/patches/fenics-dolfin-config-slepc.patch, gnu/packages/patches/fenics-dolfin-demo-init.patch: New patches. * gnu/local.mk (dist_patch_DATA): Register them. * gnu/packages/simulation.scm (fenics-dolfin)[source]: Use them.
This commit is contained in:
parent
dd823172d8
commit
41b11c459b
6 changed files with 180 additions and 7 deletions
|
@ -1053,6 +1053,10 @@ dist_patch_DATA = \
|
|||
%D%/packages/patches/fasthenry-spSolve.patch \
|
||||
%D%/packages/patches/fasthenry-spFactor.patch \
|
||||
%D%/packages/patches/fbreader-curl-7.62.patch \
|
||||
%D%/packages/patches/fenics-dolfin-algorithm.patch \
|
||||
%D%/packages/patches/fenics-dolfin-demo-init.patch \
|
||||
%D%/packages/patches/fenics-dolfin-boost.patch \
|
||||
%D%/packages/patches/fenics-dolfin-config-slepc.patch \
|
||||
%D%/packages/patches/fifengine-boost-compat.patch \
|
||||
%D%/packages/patches/fifengine-swig-compat.patch \
|
||||
%D%/packages/patches/fifo-map-fix-flags-for-gcc.patch \
|
||||
|
|
37
gnu/packages/patches/fenics-dolfin-algorithm.patch
Normal file
37
gnu/packages/patches/fenics-dolfin-algorithm.patch
Normal file
|
@ -0,0 +1,37 @@
|
|||
Fix compilation errors:
|
||||
|
||||
dolfin/geometry/IntersectionConstruction.cpp: In static member function ‘static std::vector<dolfin::Point> dolfin::IntersectionConstruction::intersection_segment_segment_2d(const dolfin::Point&, const dolfin::Point&, const dolfin::Point&, const dolfin::Point&)’:
|
||||
dolfin/geometry/IntersectionConstruction.cpp:442:24: error: ‘min_element’ is not a member of ‘std’; did you mean ‘tuple_element’?
|
||||
442 | const auto it = std::min_element(oo.begin(), oo.end());
|
||||
| ^~~~~~~~~~~
|
||||
| tuple_element
|
||||
|
||||
dolfin/mesh/MeshFunction.h: In member function ‘std::vector<long unsigned int> dolfin::MeshFunction<T>::where_equal(T)’:
|
||||
dolfin/mesh/MeshFunction.h:652:26: error: ‘count’ is not a member of ‘std’; did you mean ‘cout’?
|
||||
652 | std::size_t n = std::count(_values.get(), _values.get() + _size, value);
|
||||
| ^~~~~
|
||||
| cout
|
||||
|
||||
Submitted upstream at https://bitbucket.org/fenics-project/dolfin/issues/1128
|
||||
|
||||
--- a/dolfin/geometry/IntersectionConstruction.cpp
|
||||
+++ b/dolfin/geometry/IntersectionConstruction.cpp
|
||||
@@ -18,7 +18,8 @@
|
||||
// First added: 2014-02-03
|
||||
// Last changed: 2017-12-12
|
||||
|
||||
+#include <algorithm>
|
||||
#include <iomanip>
|
||||
#include <dolfin/mesh/MeshEntity.h>
|
||||
#include "predicates.h"
|
||||
|
||||
--- a/dolfin/mesh/MeshFunction.h
|
||||
+++ b/dolfin/mesh/MeshFunction.h
|
||||
@@ -24,6 +24,7 @@
|
||||
#ifndef __MESH_FUNCTION_H
|
||||
#define __MESH_FUNCTION_H
|
||||
|
||||
+#include <algorithm>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
45
gnu/packages/patches/fenics-dolfin-boost.patch
Normal file
45
gnu/packages/patches/fenics-dolfin-boost.patch
Normal file
|
@ -0,0 +1,45 @@
|
|||
The `BOOST_LITTLE_ENDIAN` and `BOOST_BIG_ENDIAN` macros, along with the
|
||||
"boost/detail/endian.hpp" header, were deprecated in boost 1.69.0 and finally
|
||||
removed in boost 1.73.0. They are superseded by the BOOST_ENDIAN_LITTLE_BYTE
|
||||
and BOOST_ENDIAN_BIG_BYTE macros and "boost/predef/other/endian.h" header.
|
||||
|
||||
Deprecated: https://github.com/boostorg/predef/commit/32d4581c1689370444f2e565cfbb8421d5071807
|
||||
Removed: https://github.com/boostorg/predef/commit/aa6e232bf170ad8b856aff9e7c70334f77441c7f
|
||||
|
||||
Adaptation of patch from https://bitbucket.org/fenics-project/dolfin/issues/1116
|
||||
|
||||
--- a/dolfin/io/VTKFile.cpp
|
||||
+++ b/dolfin/io/VTKFile.cpp
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <vector>
|
||||
#include <iomanip>
|
||||
#include <boost/cstdint.hpp>
|
||||
-#include <boost/detail/endian.hpp>
|
||||
+#include <boost/predef/other/endian.h>
|
||||
|
||||
#include "pugixml.hpp"
|
||||
|
||||
@@ -614,9 +614,9 @@
|
||||
std::string endianness = "";
|
||||
if (encode_string == "binary")
|
||||
{
|
||||
- #if defined BOOST_LITTLE_ENDIAN
|
||||
+ #if defined BOOST_ENDIAN_LITTLE_BYTE
|
||||
endianness = "byte_order=\"LittleEndian\"";
|
||||
- #elif defined BOOST_BIG_ENDIAN
|
||||
+ #elif defined BOOST_ENDIAN_BIG_BYTE
|
||||
endianness = "byte_order=\"BigEndian\"";;
|
||||
#else
|
||||
dolfin_error("VTKFile.cpp",
|
||||
|
||||
--- a/dolfin/io/VTKWriter.cpp
|
||||
+++ b/dolfin/io/VTKWriter.cpp
|
||||
@@ -24,7 +24,6 @@
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <iomanip>
|
||||
-#include <boost/detail/endian.hpp>
|
||||
|
||||
#include <dolfin/fem/GenericDofMap.h>
|
||||
#include <dolfin/fem/FiniteElement.h>
|
||||
|
48
gnu/packages/patches/fenics-dolfin-config-slepc.patch
Normal file
48
gnu/packages/patches/fenics-dolfin-config-slepc.patch
Normal file
|
@ -0,0 +1,48 @@
|
|||
From https://bitbucket.org/fenics-project/dolfin/issues/1120
|
||||
|
||||
From f627a442350560e50dbbb11f7828b6d807369533 Mon Sep 17 00:00:00 2001
|
||||
From: Alexei Colin <acolin@isi.edu>
|
||||
Date: Sun, 11 Apr 2021 20:40:00 -0400
|
||||
Subject: [PATCH] cmake: PETSc,SLEPc: match lowercase .pc pkg-config files
|
||||
|
||||
Upstream has moved to lowercase. PETSc has kept the mixed-case file for
|
||||
compatibility, but SLEPc hasn't.
|
||||
|
||||
pkg_search_module takes multiple patterns and succeeds on first match,
|
||||
so this commit is backward-compatible with older installations of PETSc,
|
||||
SLEPc.
|
||||
|
||||
---
|
||||
cmake/modules/FindPETSc.cmake | 2 +-
|
||||
cmake/modules/FindSLEPc.cmake | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/cmake/modules/FindPETSc.cmake b/cmake/modules/FindPETSc.cmake
|
||||
index 80faffdad..728a6ec30 100644
|
||||
--- a/cmake/modules/FindPETSc.cmake
|
||||
+++ b/cmake/modules/FindPETSc.cmake
|
||||
@@ -51,7 +51,7 @@ find_package(PkgConfig REQUIRED)
|
||||
|
||||
# Find PETSc pkg-config file. Note: craypetsc_real is on Cray systems
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{CRAY_PETSC_PREFIX_DIR}/lib/pkgconfig:$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig:$ENV{PETSC_DIR}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
|
||||
-pkg_search_module(PETSC craypetsc_real PETSc)
|
||||
+pkg_search_module(PETSC craypetsc_real petsc PETSc)
|
||||
|
||||
# Extract major, minor, etc from version string
|
||||
if (PETSC_VERSION)
|
||||
diff --git a/cmake/modules/FindSLEPc.cmake b/cmake/modules/FindSLEPc.cmake
|
||||
index 327cffc23..dec26fcc4 100644
|
||||
--- a/cmake/modules/FindSLEPc.cmake
|
||||
+++ b/cmake/modules/FindSLEPc.cmake
|
||||
@@ -48,7 +48,7 @@ find_package(PkgConfig REQUIRED)
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{SLEPC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig:$ENV{SLEPC_DIR}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig:$ENV{PETSC_DIR}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}:$ENV{PETSC_DIR}:$ENV{PKG_CONFIG_PATH}")
|
||||
-pkg_search_module(SLEPC crayslepc_real SLEPc)
|
||||
+pkg_search_module(SLEPC crayslepc_real slepc SLEPc)
|
||||
|
||||
# Extract major, minor, etc from version string
|
||||
if (SLEPC_VERSION)
|
||||
--
|
||||
2.30.0
|
||||
|
39
gnu/packages/patches/fenics-dolfin-demo-init.patch
Normal file
39
gnu/packages/patches/fenics-dolfin-demo-init.patch
Normal file
|
@ -0,0 +1,39 @@
|
|||
Ensure MPI is initialized before getting rank, which may be called early by
|
||||
Logger::write() via dolfin::info().
|
||||
|
||||
Fixes "MPI_Comm_rank called before MPI_INIT" error from
|
||||
`demo_stokes-iterative_serial` and `demo_waveguide_serial` tests.
|
||||
|
||||
Submitted upstream at https://bitbucket.org/fenics-project/dolfin/issues/1127
|
||||
|
||||
--- a/dolfin/common/MPI.cpp
|
||||
+++ b/dolfin/common/MPI.cpp
|
||||
@@ -143,6 +143,7 @@ MPI_Info& dolfin::MPIInfo::operator*()
|
||||
unsigned int dolfin::MPI::rank(const MPI_Comm comm)
|
||||
{
|
||||
#ifdef HAS_MPI
|
||||
+ SubSystemsManager::init_mpi();
|
||||
int rank;
|
||||
MPI_Comm_rank(comm, &rank);
|
||||
return rank;
|
||||
diff --git a/dolfin/common/MPI.h b/dolfin/common/MPI.h
|
||||
index b93f6df30..854114a3f 100644
|
||||
--- a/dolfin/common/MPI.h
|
||||
+++ b/dolfin/common/MPI.h
|
||||
@@ -102,12 +102,13 @@ namespace dolfin
|
||||
/// communicator
|
||||
void reset(MPI_Comm comm);
|
||||
|
||||
- /// Return process rank for the communicator
|
||||
+ /// Return process rank for the communicator. This function will
|
||||
+ /// also initialize MPI if it hasn't already been initialised.
|
||||
unsigned int rank() const;
|
||||
|
||||
/// Return size of the group (number of processes) associated
|
||||
- /// with the communicator. This function will also intialise MPI
|
||||
- /// if it hasn't already been intialised.
|
||||
+ /// with the communicator. This function will also initialise MPI
|
||||
+ /// if it hasn't already been initialised.
|
||||
unsigned int size() const;
|
||||
|
||||
/// Set a barrier (synchronization point)
|
|
@ -1,6 +1,7 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2017, 2018, 2019, 2020, 2021 Paul Garlick <pgarlick@tourbillion-technology.com>
|
||||
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
||||
;;; Copyright © 2022 Eric Bavier <bavier@posteo.net>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
@ -430,6 +431,10 @@ (define-public fenics-dolfin
|
|||
(sha256
|
||||
(base32
|
||||
"1m91hwcq5gfj4qqswp8l8kj58nia48f0n4kq13w0xqj4biq7rla0"))
|
||||
(patches (search-patches "fenics-dolfin-algorithm.patch"
|
||||
"fenics-dolfin-demo-init.patch"
|
||||
"fenics-dolfin-boost.patch"
|
||||
"fenics-dolfin-config-slepc.patch"))
|
||||
(modules '((guix build utils)))
|
||||
(snippet
|
||||
'(begin
|
||||
|
@ -498,11 +503,8 @@ (define-public fenics-dolfin
|
|||
;; git-lfs, so only the links are downloaded. The tests that
|
||||
;; require the absent meshes cannot run and are skipped.
|
||||
;;
|
||||
;; Two other serial tests fail and are skipped.
|
||||
;; i) demo_stokes-iterative_serial,
|
||||
;; The MPI_Comm_rank() function was called before MPI_INIT was
|
||||
;; invoked
|
||||
;; ii) demo_multimesh-stokes_serial:
|
||||
;; One serial test fails and is skipped.
|
||||
;; i) demo_multimesh-stokes_serial:
|
||||
;; Warning: Found no facets matching domain for boundary
|
||||
;; condition.
|
||||
;;
|
||||
|
@ -544,8 +546,6 @@ (define-public fenics-dolfin
|
|||
"demo_mesh-quality_serial "
|
||||
"demo_mesh-quality_mpi "
|
||||
"demo_multimesh-stokes_serial "
|
||||
"demo_stokes-iterative_serial "
|
||||
"demo_stokes-iterative_mpi "
|
||||
")\n") port)))
|
||||
#t))
|
||||
(replace 'check
|
||||
|
|
Loading…
Reference in a new issue