2020-04-24 23:36:52 +00:00
|
|
|
{ fetchFromGitHub
|
2021-02-05 17:12:51 +00:00
|
|
|
, lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, cmake
|
|
|
|
, eigen
|
|
|
|
, nlopt
|
|
|
|
, ipopt
|
|
|
|
, boost
|
2022-03-05 16:20:37 +00:00
|
|
|
, tbb
|
2022-09-09 14:08:57 +00:00
|
|
|
# tests pass but take 30+ minutes
|
|
|
|
, runTests ? false
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pagmo2";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "2.19.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "esa";
|
|
|
|
repo = "pagmo2";
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
sha256 = "sha256-ido3e0hQLDEPT0AmsfAVTPlGbWe5QBkxgRO6Fg1wp/c=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = [ eigen nlopt boost tbb ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) ipopt;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
2022-09-09 14:08:57 +00:00
|
|
|
"-DPAGMO_BUILD_TESTS=${if runTests then "ON" else "OFF"}"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DPAGMO_WITH_EIGEN3=yes"
|
|
|
|
"-DPAGMO_WITH_NLOPT=yes"
|
2022-09-09 14:08:57 +00:00
|
|
|
"-DNLOPT_LIBRARY=${nlopt}/lib/libnlopt${stdenv.hostPlatform.extensions.sharedLibrary}"
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DPAGMO_WITH_IPOPT=yes"
|
|
|
|
"-DCMAKE_CXX_FLAGS='-fuse-ld=gold'"
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2022-09-09 14:08:57 +00:00
|
|
|
# FIXME: fails ipopt test with Invalid_Option on darwin, so disable.
|
|
|
|
"-DPAGMO_WITH_IPOPT=no"
|
|
|
|
"-DLLVM_USE_LINKER=gold"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
doCheck = runTests;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://esa.github.io/pagmo2/";
|
|
|
|
description = "Scientific library for massively parallel optimization";
|
|
|
|
license = licenses.gpl3Plus;
|
2022-09-09 14:08:57 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
}
|