2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv
|
2017-08-14 12:32:07 +00:00
|
|
|
, fetchurl
|
2019-12-26 20:53:05 +00:00
|
|
|
, fetchpatch
|
2022-04-25 14:42:36 +00:00
|
|
|
, blas
|
2017-08-14 12:32:07 +00:00
|
|
|
, boost
|
|
|
|
, cmake
|
|
|
|
, doxygen
|
|
|
|
, eigen
|
2022-04-25 14:42:36 +00:00
|
|
|
, gtest
|
|
|
|
, hdf5
|
|
|
|
, lapack
|
|
|
|
, mpi
|
2019-12-26 20:53:05 +00:00
|
|
|
, mpi4py
|
2017-08-14 12:32:07 +00:00
|
|
|
, numpy
|
2019-12-26 20:53:05 +00:00
|
|
|
, pkg-config
|
2022-04-25 14:42:36 +00:00
|
|
|
, ply
|
2019-12-26 20:53:05 +00:00
|
|
|
, pybind11
|
2017-08-14 12:32:07 +00:00
|
|
|
, pytest
|
2019-12-26 20:53:05 +00:00
|
|
|
, python
|
2022-04-25 14:42:36 +00:00
|
|
|
, pythonPackages
|
2019-12-26 20:53:05 +00:00
|
|
|
, scotch
|
|
|
|
, setuptools
|
2022-04-25 14:42:36 +00:00
|
|
|
, six
|
2019-12-26 20:53:05 +00:00
|
|
|
, sphinx
|
|
|
|
, suitesparse
|
|
|
|
, swig
|
2022-04-25 14:42:36 +00:00
|
|
|
, sympy
|
2019-12-26 20:53:05 +00:00
|
|
|
, zlib
|
2022-01-23 20:08:10 +00:00
|
|
|
, nixosTests
|
2019-12-26 20:53:05 +00:00
|
|
|
}:
|
2022-04-25 14:42:36 +00:00
|
|
|
|
2017-08-14 12:32:07 +00:00
|
|
|
let
|
2019-12-26 20:53:05 +00:00
|
|
|
version = "2019.1.0";
|
2017-08-14 12:32:07 +00:00
|
|
|
|
|
|
|
dijitso = pythonPackages.buildPythonPackage {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "dijitso";
|
|
|
|
inherit version;
|
2017-08-14 12:32:07 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://bitbucket.org/fenics-project/dijitso/downloads/dijitso-${version}.tar.gz";
|
2019-12-26 20:53:05 +00:00
|
|
|
sha256 = "1ncgbr0bn5cvv16f13g722a0ipw6p9y6p4iasxjziwsp8kn5x97a";
|
2017-08-14 12:32:07 +00:00
|
|
|
};
|
2019-12-26 20:53:05 +00:00
|
|
|
propagatedBuildInputs = [ numpy six ];
|
|
|
|
checkInputs = [ pytest ];
|
2019-04-24 02:40:08 +00:00
|
|
|
preCheck = ''
|
2017-08-14 12:32:07 +00:00
|
|
|
export HOME=$PWD
|
2019-04-24 02:40:08 +00:00
|
|
|
'';
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
2017-08-14 12:32:07 +00:00
|
|
|
py.test test/
|
2019-04-24 02:40:08 +00:00
|
|
|
runHook postCheck
|
2017-08-14 12:32:07 +00:00
|
|
|
'';
|
|
|
|
meta = {
|
|
|
|
description = "Distributed just-in-time shared library building";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://fenicsproject.org/";
|
2021-01-21 17:00:13 +00:00
|
|
|
platforms = lib.platforms.all;
|
|
|
|
license = lib.licenses.lgpl3;
|
2017-08-14 12:32:07 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
fiat = pythonPackages.buildPythonPackage {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "fiat";
|
|
|
|
inherit version;
|
2017-08-14 12:32:07 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://bitbucket.org/fenics-project/fiat/downloads/fiat-${version}.tar.gz";
|
2019-12-26 20:53:05 +00:00
|
|
|
sha256 = "1sbi0fbr7w9g9ajr565g3njxrc3qydqjy3334vmz5xg0rd3106il";
|
2017-08-14 12:32:07 +00:00
|
|
|
};
|
2019-12-26 20:53:05 +00:00
|
|
|
propagatedBuildInputs = [ numpy six sympy ];
|
|
|
|
checkInputs = [ pytest ];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# Workaround pytest 4.6.3 issue.
|
|
|
|
# See: https://bitbucket.org/fenics-project/fiat/pull-requests/59
|
|
|
|
rm test/unit/test_quadrature.py
|
|
|
|
rm test/unit/test_reference_element.py
|
|
|
|
rm test/unit/test_fiat.py
|
|
|
|
'';
|
2017-08-14 12:32:07 +00:00
|
|
|
checkPhase = ''
|
2019-12-26 20:53:05 +00:00
|
|
|
runHook preCheck
|
2017-08-14 12:32:07 +00:00
|
|
|
py.test test/unit/
|
2019-12-26 20:53:05 +00:00
|
|
|
runHook postCheck
|
2017-08-14 12:32:07 +00:00
|
|
|
'';
|
|
|
|
meta = {
|
|
|
|
description = "Automatic generation of finite element basis functions";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://fenicsproject.org/";
|
2021-01-21 17:00:13 +00:00
|
|
|
platforms = lib.platforms.all;
|
|
|
|
license = lib.licenses.lgpl3;
|
2017-08-14 12:32:07 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
ufl = pythonPackages.buildPythonPackage {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "ufl";
|
|
|
|
inherit version;
|
2017-08-14 12:32:07 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://bitbucket.org/fenics-project/ufl/downloads/ufl-${version}.tar.gz";
|
2019-12-26 20:53:05 +00:00
|
|
|
sha256 = "04daxwg4y9c51sdgvwgmlc82nn0fjw7i2vzs15ckdc7dlazmcfi1";
|
2017-08-14 12:32:07 +00:00
|
|
|
};
|
2019-12-26 20:53:05 +00:00
|
|
|
propagatedBuildInputs = [ numpy six ];
|
|
|
|
checkInputs = [ pytest ];
|
2017-08-14 12:32:07 +00:00
|
|
|
checkPhase = ''
|
2019-12-26 20:53:05 +00:00
|
|
|
runHook preCheck
|
2017-08-14 12:32:07 +00:00
|
|
|
py.test test/
|
2019-12-26 20:53:05 +00:00
|
|
|
runHook postCheck
|
2017-08-14 12:32:07 +00:00
|
|
|
'';
|
|
|
|
meta = {
|
|
|
|
description = "A domain-specific language for finite element variational forms";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://fenicsproject.org/";
|
2021-01-21 17:00:13 +00:00
|
|
|
platforms = lib.platforms.all;
|
|
|
|
license = lib.licenses.lgpl3;
|
2017-08-14 12:32:07 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
ffc = pythonPackages.buildPythonPackage {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "ffc";
|
|
|
|
inherit version;
|
2017-08-14 12:32:07 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://bitbucket.org/fenics-project/ffc/downloads/ffc-${version}.tar.gz";
|
2019-12-26 20:53:05 +00:00
|
|
|
sha256 = "1zdg6pziss4va74pd7jjl8sc3ya2gmhpypccmyd8p7c66ji23y2g";
|
2017-08-14 12:32:07 +00:00
|
|
|
};
|
2019-12-26 20:53:05 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pybind11
|
|
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
dijitso
|
|
|
|
fiat
|
|
|
|
numpy
|
|
|
|
six
|
|
|
|
sympy
|
|
|
|
ufl
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
checkInputs = [ pytest ];
|
|
|
|
preCheck = ''
|
2017-08-14 12:32:07 +00:00
|
|
|
export HOME=$PWD
|
2019-12-26 20:53:05 +00:00
|
|
|
rm test/unit/ufc/finite_element/test_evaluate.py
|
|
|
|
'';
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
2017-08-14 12:32:07 +00:00
|
|
|
py.test test/unit/
|
2019-12-26 20:53:05 +00:00
|
|
|
runHook postCheck
|
2017-08-14 12:32:07 +00:00
|
|
|
'';
|
|
|
|
meta = {
|
|
|
|
description = "A compiler for finite element variational forms";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://fenicsproject.org/";
|
2021-01-21 17:00:13 +00:00
|
|
|
platforms = lib.platforms.all;
|
|
|
|
license = lib.licenses.lgpl3;
|
2017-08-14 12:32:07 +00:00
|
|
|
};
|
|
|
|
};
|
2019-12-26 20:53:05 +00:00
|
|
|
dolfin = stdenv.mkDerivation {
|
|
|
|
pname = "dolfin";
|
2019-08-13 21:52:01 +00:00
|
|
|
inherit version;
|
2017-08-14 12:32:07 +00:00
|
|
|
src = fetchurl {
|
2019-12-26 20:53:05 +00:00
|
|
|
url = "https://bitbucket.org/fenics-project/dolfin/downloads/dolfin-${version}.tar.gz";
|
|
|
|
sha256 = "0kbyi4x5f6j4zpasch0swh0ch81w2h92rqm1nfp3ydi4a93vky33";
|
2017-08-14 12:32:07 +00:00
|
|
|
};
|
2019-12-26 20:53:05 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-double-prefix.patch";
|
|
|
|
url = "https://bitbucket.org/josef_kemetmueller/dolfin/commits/328e94acd426ebaf2243c072b806be3379fd4340/raw";
|
|
|
|
sha256 = "1zj7k3y7vsx0hz3gwwlxhq6gdqamqpcw90d4ishwx5ps5ckcsb9r";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
dijitso
|
|
|
|
fiat
|
|
|
|
numpy
|
|
|
|
six
|
|
|
|
ufl
|
|
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
doxygen
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
dijitso
|
|
|
|
eigen
|
|
|
|
ffc
|
|
|
|
fiat
|
|
|
|
hdf5
|
|
|
|
mpi
|
|
|
|
numpy
|
2020-03-31 14:47:18 +00:00
|
|
|
blas
|
|
|
|
lapack
|
2019-12-26 20:53:05 +00:00
|
|
|
ply
|
|
|
|
python
|
|
|
|
scotch
|
|
|
|
six
|
|
|
|
sphinx
|
2020-03-31 14:47:18 +00:00
|
|
|
suitesparse
|
2019-12-26 20:53:05 +00:00
|
|
|
swig
|
|
|
|
sympy
|
|
|
|
ufl
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DDOLFIN_CXX_FLAGS=-std=c++11"
|
|
|
|
"-DDOLFIN_AUTO_DETECT_MPI=ON"
|
|
|
|
"-DDOLFIN_ENABLE_CHOLMOD=ON"
|
|
|
|
"-DDOLFIN_ENABLE_DOCS=ON"
|
|
|
|
"-DDOLFIN_ENABLE_HDF5=ON"
|
|
|
|
"-DDOLFIN_ENABLE_MPI=ON"
|
|
|
|
"-DDOLFIN_ENABLE_SCOTCH=ON"
|
|
|
|
"-DDOLFIN_ENABLE_UMFPACK=ON"
|
|
|
|
"-DDOLFIN_ENABLE_ZLIB=ON"
|
|
|
|
"-DDOLFIN_SKIP_BUILD_TESTS=ON" # Otherwise SCOTCH is not found
|
|
|
|
# TODO: Enable the following features
|
|
|
|
"-DDOLFIN_ENABLE_PARMETIS=OFF"
|
|
|
|
"-DDOLFIN_ENABLE_PETSC=OFF"
|
|
|
|
"-DDOLFIN_ENABLE_SLEPC=OFF"
|
|
|
|
"-DDOLFIN_ENABLE_TRILINOS=OFF"
|
|
|
|
];
|
|
|
|
installCheckPhase = ''
|
|
|
|
source $out/share/dolfin/dolfin.conf
|
|
|
|
make runtests
|
|
|
|
'';
|
2017-08-14 12:32:07 +00:00
|
|
|
meta = {
|
2019-12-26 20:53:05 +00:00
|
|
|
description = "The FEniCS Problem Solving Environment in Python and C++";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://fenicsproject.org/";
|
2021-01-21 17:00:13 +00:00
|
|
|
license = lib.licenses.lgpl3;
|
2017-08-14 12:32:07 +00:00
|
|
|
};
|
|
|
|
};
|
2019-12-26 20:53:05 +00:00
|
|
|
python-dolfin = pythonPackages.buildPythonPackage rec {
|
|
|
|
pname = "dolfin";
|
|
|
|
inherit version;
|
|
|
|
disabled = pythonPackages.isPy27;
|
|
|
|
src = dolfin.src;
|
|
|
|
sourceRoot = "${pname}-${version}/python";
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pybind11
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
preConfigure = ''
|
|
|
|
export CMAKE_PREFIX_PATH=${pybind11}/share/cmake/pybind11:$CMAKE_PREFIX_PATH
|
|
|
|
substituteInPlace setup.py --replace "pybind11==2.2.4" "pybind11"
|
|
|
|
substituteInPlace dolfin/jit/jit.py \
|
python3Packages.fenics: fix build, pin to older boost (#166728)
* python3Packages.fenics: fix build, pin to older boost
Looking at upstream, there are various issues with newer boost.
(At least some of them have been since fixed)
For now, fix the build by using a version of boost that works
with the current version.
Error here was complaining about `std::min_element`,
which is no longer available, apparently, due to newer boost
no longer (transitively) including <algorithm>.
This was added in C++17, so I'm not sure the cmake flag
specifying dolfin built with C++11 makes sense or is used.
Leaving for now :).
* nixos/tests/fenics: fix name of machine/node in script
Still fails for now.
* python3Packages.fenics: fix accidentally changed strings in subst
Looks like in migration to pkg-config this was erroneously
changed from `pkgconfig` (python package, and source string)
to `pkg-config` (nix package name, tool name).
(see 9bb3fccb5b55326cb3c2c507464a8a28d44d1730)
Fixes the NixOS test.
2022-04-15 00:37:20 +00:00
|
|
|
--replace 'pkgconfig.exists("dolfin")' 'pkgconfig.exists("${dolfin}/lib/pkgconfig/dolfin.pc")' \
|
|
|
|
--replace 'pkgconfig.parse("dolfin")' 'pkgconfig.parse("${dolfin}/lib/pkgconfig/dolfin.pc")'
|
2019-12-26 20:53:05 +00:00
|
|
|
'';
|
|
|
|
buildInputs = [
|
|
|
|
dolfin
|
|
|
|
boost
|
|
|
|
];
|
2017-08-14 12:32:07 +00:00
|
|
|
|
2019-12-26 20:53:05 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
dijitso
|
|
|
|
ffc
|
|
|
|
mpi4py
|
|
|
|
numpy
|
|
|
|
ufl
|
|
|
|
pythonPackages.pkgconfig
|
|
|
|
pythonPackages.pybind11
|
|
|
|
];
|
|
|
|
doCheck = false; # Tries to orte_ess_init and call ssh to localhost
|
2022-01-23 20:08:10 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) fenics; };
|
2019-12-26 20:53:05 +00:00
|
|
|
meta = {
|
|
|
|
description = "Python bindings for the DOLFIN FEM compiler";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://fenicsproject.org/";
|
2021-01-21 17:00:13 +00:00
|
|
|
platforms = lib.platforms.all;
|
|
|
|
license = lib.licenses.lgpl3;
|
2019-12-26 20:53:05 +00:00
|
|
|
};
|
2017-08-14 12:32:07 +00:00
|
|
|
};
|
2019-12-26 20:53:05 +00:00
|
|
|
in python-dolfin
|