Merge pull request #188345 from gdinh/add-openturns

This commit is contained in:
Sandro 2022-09-08 22:01:43 +02:00 committed by GitHub
commit 6f2eb7c6c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 101 additions and 5 deletions

View File

@ -0,0 +1,80 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, swig
, boost
, spectra
, libxml2
, tbb
, hmat-oss
, nlopt
, cminpack
, ceres-solver
, dlib
, hdf5
, primesieve
, pagmo2
, ipopt
, Accelerate
# tests take an hour to build on a 48-core machine
, runTests ? false
, enablePython ? false
, python3Packages
}:
stdenv.mkDerivation rec {
pname = "openturns";
version = "1.19";
src = fetchFromGitHub {
owner = "openturns";
repo = "openturns";
rev = "v${version}";
sha256 = "sha256-hSvhKx7Ke5PXPYGcn9OJvq7YooAbHrbP6TdLZBotriE=";
};
nativeBuildInputs = [ cmake ] ++ lib.optional enablePython python3Packages.sphinx;
buildInputs = [
swig
boost
spectra
libxml2
tbb
hmat-oss
nlopt
cminpack
ceres-solver
dlib
hdf5
primesieve
pagmo2
ipopt
] ++ lib.optionals enablePython [
python3Packages.python
python3Packages.matplotlib
python3Packages.psutil
python3Packages.dill
] ++ lib.optional stdenv.isDarwin Accelerate;
cmakeFlags = [
"-DOPENTURNS_SYSCONFIG_PATH=$out/etc"
"-DCMAKE_UNITY_BUILD=ON"
"-DCMAKE_UNITY_BUILD_BATCH_SIZE=32"
"-DSWIG_COMPILE_FLAGS='-O1'"
"-DUSE_SPHINX=${if enablePython then "ON" else "OFF"}"
"-DBUILD_PYTHON=${if enablePython then "ON" else "OFF"}"
];
doCheck = runTests;
checkTarget = "tests check";
meta = with lib; {
description = "Multivariate probabilistic modeling and uncertainty treatment library";
license = with licenses; [ lgpl3 gpl3 ];
homepage = "https://openturns.github.io/www/";
maintainers = with maintainers; [ gdinh ];
platforms = platforms.unix;
};
}

View File

@ -6,6 +6,8 @@
, ipopt
, boost
, tbb
# tests pass but take 30+ minutes
, runTests ? false
}:
stdenv.mkDerivation rec {
@ -20,24 +22,29 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ cmake ];
buildInputs = [ eigen nlopt ipopt boost tbb ];
buildInputs = [ eigen nlopt boost tbb ] ++ lib.optional (!stdenv.isDarwin) ipopt;
cmakeFlags = [
"-DPAGMO_BUILD_TESTS=no"
"-DPAGMO_BUILD_TESTS=${if runTests then "ON" else "OFF"}"
"-DPAGMO_WITH_EIGEN3=yes"
"-DPAGMO_WITH_NLOPT=yes"
"-DNLOPT_LIBRARY=${nlopt}/lib/libnlopt.so"
"-DNLOPT_LIBRARY=${nlopt}/lib/libnlopt${stdenv.hostPlatform.extensions.sharedLibrary}"
] ++ lib.optionals stdenv.isLinux [
"-DPAGMO_WITH_IPOPT=yes"
"-DCMAKE_CXX_FLAGS='-fuse-ld=gold'"
] ++ lib.optionals stdenv.isDarwin [
# FIXME: fails ipopt test with Invalid_Option on darwin, so disable.
"-DPAGMO_WITH_IPOPT=no"
"-DLLVM_USE_LINKER=gold"
];
# tests pass but take 30+ minutes
doCheck = false;
doCheck = runTests;
meta = with lib; {
homepage = "https://esa.github.io/pagmo2/";
description = "Scientific library for massively parallel optimization";
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = [ maintainers.costrouc ];
};
}

View File

@ -20902,6 +20902,10 @@ with pkgs;
opensupaplex = callPackage ../games/opensupaplex { };
openturns = callPackage ../development/libraries/openturns {
inherit (darwin.apple_sdk.frameworks) Accelerate;
};
open-wbo = callPackage ../applications/science/logic/open-wbo {};
openwsman = callPackage ../development/libraries/openwsman {};

View File

@ -6386,6 +6386,11 @@ in {
opentimestamps = callPackage ../development/python-modules/opentimestamps { };
openturns = toPythonModule (pkgs.openturns.override {
python3Packages = self;
enablePython = true;
});
opentracing = callPackage ../development/python-modules/opentracing { };
openvino = toPythonModule (pkgs.openvino.override {