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 { stdenv.mkDerivation rec {
name = "pagmo2-${version}"; name = "pagmo2-${version}";
version = "2.8"; version = "2.9";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "esa"; owner = "esa";
repo = "pagmo2"; repo = "pagmo2";
rev = "v${version}"; rev = "v${version}";
sha256 = "1xwxamcn3fkwr62jn6bkanrwy0cvsksf75hfwx4fvl56awnbz41z"; sha256 = "0al2i59m5qr83wz5n5408zvys0b3mc40rszf0l5b9a0gp1axj400";
}; };
buildInputs = [ cmake eigen nlopt ipopt boost ]; nativeBuildInputs = [ cmake ];
buildInputs = [ eigen nlopt ipopt boost ];
preBuild = '' cmakeFlags = [
cp -r $src/* . "-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" # tests pass but take 30+ minutes
"-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)
doCheck = false; doCheck = false;
meta = { meta = with stdenv.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 = stdenv.lib.licenses.gpl3Plus; license = licenses.gpl3Plus;
maintainers = [ maintainers.costrouc ];
}; };
} }

View File

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

View File

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