Skip to content

Commit

Permalink
elmerfem: init at release-8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Wulfsta authored and Jon committed May 2, 2020
1 parent 3234163 commit 5dbc4f7
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
49 changes: 49 additions & 0 deletions pkgs/applications/science/physics/elmerfem/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{ stdenv, fetchFromGitHub, cmake, git, gfortran, openmpi, blas, liblapack, qt4, qwt6_qt4, pkg-config }:

stdenv.mkDerivation rec {
pname = "elmerfem";
version = "8.4";

src = fetchFromGitHub {
owner = "elmercsc";
repo = "elmerfem";
rev = "release-${version}";
sha256 = "0vk31lplxlng173q8jjcpbyj1gaf98jvkqjvi9077d1nslya7vpm";
};

hardeningDisable = [ "format" ];

nativeBuildInputs = [ cmake pkg-config git ];
buildInputs = [ gfortran openmpi blas liblapack qt4 qwt6_qt4 ];

preConfigure = ''
patchShebangs ./
'';

storepath = placeholder "out";

cmakeFlags = [
"-DELMER_INSTALL_LIB_DIR=${storepath}/lib"
"-DWITH_OpenMP:BOOLEAN=TRUE"
"-DWITH_MPI:BOOLEAN=TRUE"
"-DWITH_ELMERGUI:BOOLEAN=TRUE"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_OpenGL_GL_PREFERENCE=GLVND"
];

patches = [
./fix-cmake.patch
];

enableParallelBuilding = true;

meta = with stdenv.lib; {
homepage = http://www.elmerfem.org/;
description = "A finite element software for multiphysical problems.";
platforms = platforms.unix;
maintainers = [ maintainers.wulfsta ];
license = licenses.lgpl21;
};

}
13 changes: 13 additions & 0 deletions pkgs/applications/science/physics/elmerfem/fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --exclude '*~' -ruN A/torch/CMakeLists.txt B/torch/CMakeLists.txt
--- A/fem/tests/CMakeLists.txt 2020-04-23 02:35:03.243388917 -0400
+++ B/fem/tests/CMakeLists.txt 2018-12-19 20:18:40.671857320 -0400
@@ -14,7 +14,7 @@
SET(MESH2D_BIN "${CMAKE_BINARY_DIR}/meshgen2d/src/Mesh2D")

MACRO(SUBDIRLIST result curdir depth)
set(glob_pattern "*")
- FOREACH(D RANGE 1 depth)
+ FOREACH(D RANGE 1 ${depth})
FILE(GLOB children RELATIVE ${curdir} ${glob_pattern})
FOREACH(child ${children})
IF(IS_DIRECTORY ${curdir}/${child})
4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24603,7 +24603,9 @@ in

dcmtk = callPackage ../applications/science/medicine/dcmtk { };

### PHYSICS
### SCIENCE/PHYSICS

elmerfem = callPackage ../applications/science/physics/elmerfem {};

sacrifice = callPackage ../applications/science/physics/sacrifice {};

Expand Down

0 comments on commit 5dbc4f7

Please sign in to comment.