Merge pull request #51959 from worldofpeace/pagmo-pygmo/fixes

pagmo2, pythonPackages.pygmo fixes
This commit is contained in:
Robert Schütz 2018-12-18 17:08:06 +01:00 committed by GitHub
commit 7d5c1d8e7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 43 deletions

View File

@ -11,32 +11,34 @@
stdenv.mkDerivation rec {
name = "pagmo2-${version}";
version = "2.8";
version = "2.9";
src = fetchFromGitHub {
owner = "esa";
repo = "pagmo2";
rev = "v${version}";
sha256 = "1xwxamcn3fkwr62jn6bkanrwy0cvsksf75hfwx4fvl56awnbz41z";
sha256 = "0al2i59m5qr83wz5n5408zvys0b3mc40rszf0l5b9a0gp1axj400";
};
buildInputs = [ cmake eigen nlopt ipopt boost ];
nativeBuildInputs = [ cmake ];
buildInputs = [ eigen nlopt ipopt boost ];
preBuild = ''
cp -r $src/* .
'';
cmakeFlags = [
"-DPAGMO_BUILD_TESTS=no"
"-DPAGMO_WITH_EIGEN3=yes"
"-DPAGMO_WITH_NLOPT=yes"
"-DNLOPT_LIBRARY=${nlopt}/lib/libnlopt.so"
"-DPAGMO_WITH_IPOPT=yes"
"-DCMAKE_CXX_FLAGS='-fuse-ld=gold'"
];
cmakeFlags = [ "-DPAGMO_BUILD_TESTS=no"
"-DPAGMO_WITH_EIGEN3=yes" "-DPAGMO_WITH_NLOPT=yes"
"-DNLOPT_LIBRARY=${nlopt}/lib/libnlopt_cxx.so" "-DPAGMO_WITH_IPOPT=yes"
"-DCMAKE_CXX_FLAGS='-fuse-ld=gold'" ];
# All but one test pass skip for now (tests also take about 30 min to compile)
# tests pass but take 30+ minutes
doCheck = false;
meta = {
meta = with stdenv.lib; {
homepage = https://esa.github.io/pagmo2/;
description = "Scientific library for massively parallel optimization";
license = stdenv.lib.licenses.gpl3Plus;
license = licenses.gpl3Plus;
maintainers = [ maintainers.costrouc ];
};
}

View File

@ -1,5 +1,5 @@
{ lib
, fetchurl
, fetchPypi
, buildPythonPackage
, numpy
, scipy
@ -10,12 +10,12 @@
}:
buildPythonPackage rec {
version = "3.16.2";
pname = "ase";
version = "3.17.0";
src = fetchurl {
url = "https://gitlab.com/${pname}/${pname}/-/archive/${version}/${pname}-${version}.tar.gz";
sha256 = "171j3f4a261cfnqjq98px5fldxql65i3jgf60wc945xvh0mbc8ds";
src = fetchPypi {
inherit pname version;
sha256 = "1d4gxypaahby45zcpl0rffcn2z7n55dg9lcd8sv6jjsmbbf9vr4g";
};
propagatedBuildInputs = [ numpy scipy matplotlib flask pillow psycopg2 ];
@ -27,10 +27,10 @@ buildPythonPackage rec {
# tests just hang most likely due to something with subprocesses and cli
doCheck = false;
meta = {
meta = with lib; {
description = "Atomic Simulation Environment";
homepage = https://wiki.fysik.dtu.dk/ase/;
license = lib.licenses.lgpl21Plus;
maintainers = with lib.maintainers; [ costrouc ];
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ costrouc ];
};
}

View File

@ -1,7 +1,6 @@
{ lib
, fetchFromGitHub
, buildPythonPackage
, cmake
, eigen
, nlopt
, ipopt
@ -11,38 +10,44 @@
, cloudpickle
, ipyparallel
, numba
, python
}:
buildPythonPackage rec {
pname = "pygmo";
version = "2.8";
src = fetchFromGitHub {
owner = "esa";
repo = "pagmo2";
rev = "v${version}";
sha256 = "1xwxamcn3fkwr62jn6bkanrwy0cvsksf75hfwx4fvl56awnbz41z";
};
buildInputs = [ cmake eigen nlopt ipopt boost pagmo2 ];
let
propagatedBuildInputs = [ numpy cloudpickle ipyparallel numba ];
preBuild = ''
cp -v -r $src/* .
cmake -DCMAKE_INSTALL_PREFIX=$out -DPAGMO_BUILD_TESTS=no -DCMAKE_SYSTEM_NAME=Linux -DPagmo_DIR=${pagmo2} -DPAGMO_BUILD_PYGMO=yes -DPAGMO_BUILD_PAGMO=no -DPAGMO_WITH_EIGEN3=yes -DPAGMO_WITH_NLOPT=yes -DNLOPT_LIBRARY=${nlopt}/lib/libnlopt_cxx.so -DPAGMO_WITH_IPOPT=yes -DIPOPT=${ipopt}
pagmo2WithPython = pagmo2.overrideAttrs (oldAttrs: {
cmakeFlags = oldAttrs.cmakeFlags ++ [
"-DPAGMO_BUILD_PYGMO=yes"
"-DPAGMO_BUILD_PAGMO=no"
"-DPagmo_DIR=${pagmo2}"
];
buildInputs = [ eigen nlopt ipopt boost pagmo2 ] ++ propagatedBuildInputs;
postInstall = ''
mv wheel $out
'';
});
make install
mv $out/lib/python*/site-packages/pygmo wheel
in buildPythonPackage rec {
pname = "pygmo";
version = pagmo2WithPython.version;
inherit propagatedBuildInputs;
src = pagmo2WithPython;
preBuild = ''
mv ${python.sitePackages}/pygmo wheel
cd wheel
'';
# dont do tests
doCheck = false;
meta = {
meta = with lib; {
description = "Parallel optimisation for Python";
homepage = https://esa.github.io/pagmo2/;
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ costrouc ];
license = licenses.gpl3Plus;
maintainers = [ maintainers.costrouc ];
};
}