2022-03-05 16:20:37 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, boost, eigen, libxml2, mpi, python3
|
|
|
|
, mklSupport ? true, mkl
|
2023-04-29 16:46:19 +00:00
|
|
|
, substituteAll
|
2022-03-05 16:20:37 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "FEBio";
|
|
|
|
version = "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "febiosoftware";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "187s4lyzr806xla3smq3lsvj3f6wxlhfkban89w0fnyfmfb8w9am";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2023-04-29 16:46:19 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-cmake.patch; # cannot find mkl libraries without this
|
|
|
|
so = stdenv.hostPlatform.extensions.sharedLibrary;
|
|
|
|
})
|
2022-03-05 16:20:37 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = lib.optional mklSupport "-DUSE_MKL=On"
|
|
|
|
++ lib.optional mklSupport "-DMKLROOT=${mkl}"
|
|
|
|
;
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
env.CXXFLAGS = lib.optionalString stdenv.isLinux "-include cstring";
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/include
|
|
|
|
cp -R lib bin $out/
|
|
|
|
cp -R ../FECore \
|
|
|
|
../FEBioFluid \
|
|
|
|
../FEBioLib \
|
|
|
|
../FEBioMech \
|
|
|
|
../FEBioMix \
|
|
|
|
../FEBioOpt \
|
|
|
|
../FEBioPlot \
|
|
|
|
../FEBioXML \
|
|
|
|
../NumCore \
|
|
|
|
$out/include
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ boost eigen libxml2 mpi python3 python3.pkgs.numpy ]
|
|
|
|
++ lib.optional mklSupport mkl
|
|
|
|
;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "FEBio Suite Solver";
|
|
|
|
license = with lib.licenses; [ mit ];
|
|
|
|
homepage = "https://febio.org/";
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
maintainers = with lib.maintainers; [ Scriptkiddi ];
|
|
|
|
};
|
|
|
|
}
|