mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
Merge pull request #188345 from gdinh/add-openturns
This commit is contained in:
commit
6f2eb7c6c3
80
pkgs/development/libraries/openturns/default.nix
Normal file
80
pkgs/development/libraries/openturns/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
@ -6,6 +6,8 @@
|
|||||||
, ipopt
|
, ipopt
|
||||||
, boost
|
, boost
|
||||||
, tbb
|
, tbb
|
||||||
|
# tests pass but take 30+ minutes
|
||||||
|
, runTests ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -20,24 +22,29 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ];
|
nativeBuildInputs = [ cmake ];
|
||||||
buildInputs = [ eigen nlopt ipopt boost tbb ];
|
buildInputs = [ eigen nlopt boost tbb ] ++ lib.optional (!stdenv.isDarwin) ipopt;
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DPAGMO_BUILD_TESTS=no"
|
"-DPAGMO_BUILD_TESTS=${if runTests then "ON" else "OFF"}"
|
||||||
"-DPAGMO_WITH_EIGEN3=yes"
|
"-DPAGMO_WITH_EIGEN3=yes"
|
||||||
"-DPAGMO_WITH_NLOPT=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"
|
"-DPAGMO_WITH_IPOPT=yes"
|
||||||
"-DCMAKE_CXX_FLAGS='-fuse-ld=gold'"
|
"-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 = runTests;
|
||||||
doCheck = false;
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://esa.github.io/pagmo2/";
|
homepage = "https://esa.github.io/pagmo2/";
|
||||||
description = "Scientific library for massively parallel optimization";
|
description = "Scientific library for massively parallel optimization";
|
||||||
license = licenses.gpl3Plus;
|
license = licenses.gpl3Plus;
|
||||||
|
platforms = platforms.unix;
|
||||||
maintainers = [ maintainers.costrouc ];
|
maintainers = [ maintainers.costrouc ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -20902,6 +20902,10 @@ with pkgs;
|
|||||||
|
|
||||||
opensupaplex = callPackage ../games/opensupaplex { };
|
opensupaplex = callPackage ../games/opensupaplex { };
|
||||||
|
|
||||||
|
openturns = callPackage ../development/libraries/openturns {
|
||||||
|
inherit (darwin.apple_sdk.frameworks) Accelerate;
|
||||||
|
};
|
||||||
|
|
||||||
open-wbo = callPackage ../applications/science/logic/open-wbo {};
|
open-wbo = callPackage ../applications/science/logic/open-wbo {};
|
||||||
|
|
||||||
openwsman = callPackage ../development/libraries/openwsman {};
|
openwsman = callPackage ../development/libraries/openwsman {};
|
||||||
|
@ -6386,6 +6386,11 @@ in {
|
|||||||
|
|
||||||
opentimestamps = callPackage ../development/python-modules/opentimestamps { };
|
opentimestamps = callPackage ../development/python-modules/opentimestamps { };
|
||||||
|
|
||||||
|
openturns = toPythonModule (pkgs.openturns.override {
|
||||||
|
python3Packages = self;
|
||||||
|
enablePython = true;
|
||||||
|
});
|
||||||
|
|
||||||
opentracing = callPackage ../development/python-modules/opentracing { };
|
opentracing = callPackage ../development/python-modules/opentracing { };
|
||||||
|
|
||||||
openvino = toPythonModule (pkgs.openvino.override {
|
openvino = toPythonModule (pkgs.openvino.override {
|
||||||
|
Loading…
Reference in New Issue
Block a user