nixpkgs/pkgs/by-name/op/openturns/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

100 lines
2.0 KiB
Nix
Raw Normal View History

{
lib,
boost,
ceres-solver,
cmake,
cminpack,
darwin,
dlib,
fetchFromGitHub,
fetchpatch,
hdf5,
hmat-oss,
ipopt,
libxml2,
nlopt,
pagmo2,
primesieve,
python3Packages,
spectra,
stdenv,
swig,
tbb,
# Boolean flags
runTests ? false, # tests take an hour to build on a 48-core machine
enablePython ? false,
2022-08-25 03:54:35 +00:00
}:
2024-05-05 17:43:46 +00:00
let
inherit (darwin.apple_sdk.frameworks) Accelerate;
in
stdenv.mkDerivation (finalAttrs: {
2022-08-25 03:54:35 +00:00
pname = "openturns";
2024-01-11 05:36:06 +00:00
version = "1.22";
2022-08-25 03:54:35 +00:00
src = fetchFromGitHub {
owner = "openturns";
repo = "openturns";
rev = "v${finalAttrs.version}";
hash = "sha256-ku3/mPoa1YJVJB99R/kWlOubIO+OZAiKfPqS/DrtJQk=";
2022-08-25 03:54:35 +00:00
};
nativeBuildInputs = [
cmake
]
++ lib.optionals enablePython [ python3Packages.sphinx ];
2022-08-25 03:54:35 +00:00
buildInputs = [
(lib.getLib primesieve)
2022-08-25 03:54:35 +00:00
boost
ceres-solver
cminpack
2022-08-25 03:54:35 +00:00
dlib
hdf5
hmat-oss
2022-08-25 03:54:35 +00:00
ipopt
libxml2
nlopt
pagmo2
spectra
swig
tbb
]
++ lib.optionals enablePython [
python3Packages.dill
2022-08-25 03:54:35 +00:00
python3Packages.matplotlib
python3Packages.psutil
python3Packages.python
]
++ lib.optionals stdenv.isDarwin [
Accelerate
];
2022-08-25 03:54:35 +00:00
cmakeFlags = [
(lib.cmakeBool "BUILD_PYTHON" enablePython)
(lib.cmakeBool "CMAKE_UNITY_BUILD" true)
(lib.cmakeBool "USE_SPHINX" enablePython)
(lib.cmakeFeature "CMAKE_UNITY_BUILD_BATCH_SIZE" "32")
(lib.cmakeFeature "SWIG_COMPILE_FLAGS" "-O1")
(lib.cmakeOptionType "PATH" "OPENTURNS_SYSCONFIG_PATH" "$out/etc")
2022-08-25 03:54:35 +00:00
];
checkTarget = lib.concatStringsSep " " [
"tests"
"check"
];
2022-08-25 03:54:35 +00:00
strictDeps = true;
2022-08-25 03:54:35 +00:00
doCheck = runTests;
meta = {
2022-08-25 03:54:35 +00:00
homepage = "https://openturns.github.io/www/";
description = "Multivariate probabilistic modeling and uncertainty treatment library";
changelog = "https://github.com/openturns/openturns/raw/v${finalAttrs.version}/ChangeLog";
license = with lib.licenses; [ lgpl3Plus gpl3Plus ];
maintainers = with lib.maintainers; [ gdinh ];
platforms = lib.platforms.unix;
2022-08-25 03:54:35 +00:00
};
})