From 9745611ed6464998f56b6fb25fdf7216b29a38c2 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Wed, 8 Aug 2018 00:40:23 -0400 Subject: [PATCH 01/12] lammps: 16Feb16 -> patch_2Aug2018 Major changes and update to lammps build - using fetchFromGitHub to get source instead of lammps mirror - configurable lammps packages included and includes for compilation - cleaner build script - preserving the executable, shared library names, and include headers --- .../molecular-dynamics/lammps/default.nix | 45 +++++++++++++------ 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/science/molecular-dynamics/lammps/default.nix b/pkgs/applications/science/molecular-dynamics/lammps/default.nix index 9a89b88d7a52..03e37ad9d935 100644 --- a/pkgs/applications/science/molecular-dynamics/lammps/default.nix +++ b/pkgs/applications/science/molecular-dynamics/lammps/default.nix @@ -1,25 +1,37 @@ -{ stdenv, writeText, fetchurl, - libpng, fftw, - mpiSupport ? false, mpi ? null +{ lib +, bash +, stdenv +, writeText +, fetchFromGitHub +, libpng +, gzip +, fftw +, openblas +, mpiSupport ? false, mpi ? null }: assert mpiSupport -> mpi != null; stdenv.mkDerivation rec { # LAMMPS has weird versioning converted to ISO 8601 format - version = "2016-02-16"; + version = "patch_2Aug2018"; name = "lammps-${version}"; - src = fetchurl { - url = "mirror://sourceforge/lammps/lammps-16Feb16.tar.gz"; - sha256 = "1yzfbkxma3xa1288rnn66h4w0smbmjkwq1fx1y60pjiw0prmk105"; + lammps_packages = "asphere body class2 colloid compress coreshell dipole granular kspace manybody mc misc molecule opt peri qeq replica rigid shock snap srd user-reaxc"; + lammps_includes = "-DLAMMPS_EXCEPTIONS -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64"; + + src = fetchFromGitHub { + owner = "lammps"; + repo = "lammps"; + rev = "${version}"; + sha256 = "1ph9pr7s11wgmspmnhxa55bh1pq2cyl8iimfi62lbpbpl9pr1ilc"; }; passthru = { inherit mpi; }; - buildInputs = [ fftw libpng ] + buildInputs = [ fftw libpng openblas gzip bash ] ++ (stdenv.lib.optionals mpiSupport [ mpi ]); # Must do manual build due to LAMMPS requiring a seperate build for @@ -27,13 +39,19 @@ stdenv.mkDerivation rec { builder = writeText "builder.sh" '' source $stdenv/setup - tar xzf $src - cd lammps-*/src - make mode=exe ${if mpiSupport then "mpi" else "serial"} SHELL=$SHELL LMP_INC="-DLAMMPS_GZIP -DLAMMPS_PNG" FFT_PATH=-DFFT_FFTW3 FFT_LIB=-lfftw3 JPG_LIB=-lpng - make mode=shlib ${if mpiSupport then "mpi" else "serial"} SHELL=$SHELL LMP_INC="-DLAMMPS_GZIP -DLAMMPS_PNG" FFT_PATH=-DFFT_FFTW3 FFT_LIB=-lfftw3 JPG_LIB=-lpng + mkdir lammps + cp -r $src/lib $src/src lammps + chmod -R 755 lammps/src/ + cd lammps/src + for pack in ${lammps_packages}; do make "yes-$pack" SHELL=$SHELL; done + make mode=exe ${if mpiSupport then "mpi" else "serial"} SHELL=$SHELL LMP_INC="${lammps_includes}" FFT_PATH=-DFFT_FFTW3 FFT_LIB=-lfftw3 JPG_LIB=-lpng + make mode=shlib ${if mpiSupport then "mpi" else "serial"} SHELL=$SHELL LMP_INC="${lammps_includes}" FFT_PATH=-DFFT_FFTW3 FFT_LIB=-lfftw3 JPG_LIB=-lpng mkdir -p $out/bin - cp -v lmp_* $out/bin/lammps + cp -v lmp_* $out/bin/ + + mkdir -p $out/include + cp -v *.h $out/include/ mkdir -p $out/lib cp -v liblammps* $out/lib/ @@ -51,5 +69,6 @@ stdenv.mkDerivation rec { homepage = http://lammps.sandia.gov; license = stdenv.lib.licenses.gpl2; platforms = stdenv.lib.platforms.linux; + maintainers = with lib.maintainers; [ costrouc ]; }; } From 90c353d44e6c89cb77d05e5452120386b65fc919 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Fri, 10 Aug 2018 16:36:50 -0400 Subject: [PATCH 02/12] pythonPackages.py-cpuinfo: init at 4.0.0 - fetchFromGitHub to run all tests - all tests pass --- .../python-modules/py-cpuinfo/default.nix | 23 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 pkgs/development/python-modules/py-cpuinfo/default.nix diff --git a/pkgs/development/python-modules/py-cpuinfo/default.nix b/pkgs/development/python-modules/py-cpuinfo/default.nix new file mode 100644 index 000000000000..37cf601695ee --- /dev/null +++ b/pkgs/development/python-modules/py-cpuinfo/default.nix @@ -0,0 +1,23 @@ +{ lib +, fetchFromGitHub +, buildPythonPackage +}: + +buildPythonPackage rec { + pname = "py-cpuinfo"; + version = "4.0.0"; + + src = fetchFromGitHub { + owner = "workhorsy"; + repo = pname; + rev = "v${version}"; + sha256 = "1pp561lj80jnvr2038nrzhmks2akxsbdqxvfrqa6n340x81981lm"; + }; + + meta = { + description = "Get CPU info with pure Python 2 & 3"; + homepage = https://github.com/workhorsy/py-cpuinfo; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index af1895d9d147..c28a824ae348 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -384,6 +384,8 @@ in { PyChromecast = callPackage ../development/python-modules/pychromecast { }; + py-cpuinfo = callPackage ../development/python-modules/py-cpuinfo { }; + pydbus = callPackage ../development/python-modules/pydbus { }; pydocstyle = callPackage ../development/python-modules/pydocstyle { }; From 6e9d37713a867946d299491d241ce16a815dd539 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Fri, 10 Aug 2018 16:37:45 -0400 Subject: [PATCH 03/12] pythonPackages.statistics: init at 1.0.3.5 - package does not come with tests --- .../python-modules/statistics/default.nix | 27 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/development/python-modules/statistics/default.nix diff --git a/pkgs/development/python-modules/statistics/default.nix b/pkgs/development/python-modules/statistics/default.nix new file mode 100644 index 000000000000..4380e592ff56 --- /dev/null +++ b/pkgs/development/python-modules/statistics/default.nix @@ -0,0 +1,27 @@ +{ lib +, fetchPypi +, buildPythonPackage +, docutils +}: + +buildPythonPackage rec { + pname = "statistics"; + version = "1.0.3.5"; + + src = fetchPypi { + inherit pname version; + sha256 = "2dc379b80b07bf2ddd5488cad06b2b9531da4dd31edb04dc9ec0dc226486c138"; + }; + + propagatedBuildInputs = [ docutils ]; + + # statistics package does not have any tests + doCheck = false; + + meta = { + description = "A Python 2.* port of 3.4 Statistics Module"; + homepage = https://github.com/digitalemagine/py-statistics; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c28a824ae348..fdf3e91cbb9a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -509,6 +509,8 @@ in { spglib = callPackage ../development/python-modules/spglib { }; + statistics = callPackage ../development/python-modules/statistics { }; + sumo = callPackage ../development/python-modules/sumo { }; supervise_api = callPackage ../development/python-modules/supervise_api { }; From eb6e376753619cb1fcb57e3ef2075e836ec9dd3e Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Fri, 10 Aug 2018 16:38:38 -0400 Subject: [PATCH 04/12] pythonPackages.pytest-benchmark: init at 3.1.1 - fetchFromGitHub to get all tests - all tests pass - python 2.7, 3+ --- .../pytest-benchmark/default.nix | 31 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/development/python-modules/pytest-benchmark/default.nix diff --git a/pkgs/development/python-modules/pytest-benchmark/default.nix b/pkgs/development/python-modules/pytest-benchmark/default.nix new file mode 100644 index 000000000000..0f3475f715d0 --- /dev/null +++ b/pkgs/development/python-modules/pytest-benchmark/default.nix @@ -0,0 +1,31 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestrunner +, pytest +, py-cpuinfo +, pythonOlder +, pathlib +, statistics +}: + +buildPythonPackage rec { + pname = "pytest-benchmark"; + version = "3.1.1"; + + src = fetchFromGitHub { + owner = "ionelmc"; + repo = pname; + rev = "v${version}"; + sha256 = "1ch079dlc6c9ag74dh4dg6plkmh0h8kn78ari3fgadc75bald71m"; + }; + + propagatedBuildInputs = [ pytest py-cpuinfo ] ++ lib.optional (pythonOlder "3.4") [ pathlib statistics ]; + + meta = { + description = "Py.test fixture for benchmarking code"; + homepage = https://github.com/ionelmc/pytest-benchmark; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fdf3e91cbb9a..c2a1237e4e97 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1844,6 +1844,8 @@ in { pytest-aiohttp = callPackage ../development/python-modules/pytest-aiohttp { }; + pytest-benchmark = callPackage ../development/python-modules/pytest-benchmark { }; + pytestcache = callPackage ../development/python-modules/pytestcache { }; pytest-catchlog = callPackage ../development/python-modules/pytest-catchlog { }; From da136c461865d29d6502c7b4b347552c81185ac3 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Fri, 10 Aug 2018 16:39:53 -0400 Subject: [PATCH 05/12] pythonPackages.docutils: refactored - moved docutils to `python-modules` --- .../python-modules/docutils/default.nix | 35 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 33 ++--------------- 2 files changed, 37 insertions(+), 31 deletions(-) create mode 100644 pkgs/development/python-modules/docutils/default.nix diff --git a/pkgs/development/python-modules/docutils/default.nix b/pkgs/development/python-modules/docutils/default.nix new file mode 100644 index 000000000000..c31cfceebbaa --- /dev/null +++ b/pkgs/development/python-modules/docutils/default.nix @@ -0,0 +1,35 @@ +{ lib +, fetchurl +, buildPythonPackage +, isPy3k +, python +}: + +buildPythonPackage rec { + pname = "docutils"; + version = "0.14"; + + src = fetchurl { + url = "mirror://sourceforge/docutils/${pname}.tar.gz"; + sha256 = "0x22fs3pdmr42kvz6c654756wja305qv6cx1zbhwlagvxgr4xrji"; + }; + + checkPhase = if isPy3k then '' + ${python.interpreter} test3/alltests.py + '' else '' + ${python.interpreter} test/alltests.py + ''; + + # Create symlinks lacking a ".py" suffix, many programs depend on these names + postFixup = '' + (cd $out/bin && for f in *.py; do + ln -s $f $(echo $f | sed -e 's/\.py$//') + done) + ''; + + meta = { + description = "Docutils -- Python Documentation Utilities"; + homepage = http://docutils.sourceforge.net/; + maintainers = with lib.maintainers; [ garbas AndersonTorres ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c2a1237e4e97..8e9ff72c752d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -272,6 +272,8 @@ in { distorm3 = callPackage ../development/python-modules/distorm3 { }; + docutils = callPackage ../development/python-modules/docutils { }; + dogtail = callPackage ../development/python-modules/dogtail { }; diff-match-patch = callPackage ../development/python-modules/diff-match-patch { }; @@ -5006,37 +5008,6 @@ in { }; }; - - docutils = buildPythonPackage rec { - name = "docutils-${version}"; - version = "0.14"; - - src = pkgs.fetchurl { - url = "mirror://sourceforge/docutils/${name}.tar.gz"; - sha256 = "0x22fs3pdmr42kvz6c654756wja305qv6cx1zbhwlagvxgr4xrji"; - }; - - checkPhase = if isPy3k then '' - ${python.interpreter} test3/alltests.py - '' else '' - ${python.interpreter} test/alltests.py - ''; - - # Create symlinks lacking a ".py" suffix, many programs depend on these names - postFixup = '' - (cd $out/bin && for f in *.py; do - ln -s $f $(echo $f | sed -e 's/\.py$//') - done) - ''; - - meta = { - description = "An open-source text processing system for processing plaintext documentation into useful formats, such as HTML or LaTeX"; - homepage = http://docutils.sourceforge.net/; - maintainers = with maintainers; [ garbas AndersonTorres ]; - }; - }; - - dtopt = buildPythonPackage rec { name = "dtopt-0.1"; From 0513a0054dc5e0953cc5123ef1ac11707b059aaf Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Fri, 10 Aug 2018 16:40:45 -0400 Subject: [PATCH 06/12] pythonPackages.pathlib: init at 1.0.1 - python 2.7, 3+ - all tests pass - package is depricated but is required by a package --- .../python-modules/pathlib/default.nix | 28 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 23 ++------------- 2 files changed, 30 insertions(+), 21 deletions(-) create mode 100644 pkgs/development/python-modules/pathlib/default.nix diff --git a/pkgs/development/python-modules/pathlib/default.nix b/pkgs/development/python-modules/pathlib/default.nix new file mode 100644 index 000000000000..d70178dac857 --- /dev/null +++ b/pkgs/development/python-modules/pathlib/default.nix @@ -0,0 +1,28 @@ +{ lib +, buildPythonPackage +, fetchPypi +, python +, pythonAtLeast +}: + +buildPythonPackage rec { + pname = "pathlib"; + version = "1.0.1"; + disabled = pythonAtLeast "3.4"; # Was added to std library in Python 3.4 + + src = fetchPypi { + inherit pname version; + sha256 = "17zajiw4mjbkkv6ahp3xf025qglkj0805m9s41c45zryzj6p2h39"; + }; + + checkPhase = '' + ${python.interpreter} -m unittest discover + ''; + + meta = { + description = "Object-oriented filesystem paths"; + homepage = https://pathlib.readthedocs.org/; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8e9ff72c752d..c8b4a8ace418 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -344,6 +344,8 @@ in { palettable = callPackage ../development/python-modules/palettable { }; + pathlib = callPackage ../development/python-modules/pathlib { }; + pdf2image = callPackage ../development/python-modules/pdf2image { }; pdfminer = callPackage ../development/python-modules/pdfminer_six { }; @@ -9458,27 +9460,6 @@ in { patator = callPackage ../development/python-modules/patator { }; - pathlib = buildPythonPackage rec { - name = "pathlib-${version}"; - version = "1.0.1"; - disabled = pythonAtLeast "3.4"; # Was added to std library in Python 3.4 - - src = pkgs.fetchurl { - url = "mirror://pypi/p/pathlib/${name}.tar.gz"; - sha256 = "17zajiw4mjbkkv6ahp3xf025qglkj0805m9s41c45zryzj6p2h39"; - }; - - checkPhase = '' - ${python.interpreter} -m unittest discover - ''; - - meta = { - description = "Object-oriented filesystem paths"; - homepage = "https://pathlib.readthedocs.org/"; - license = licenses.mit; - }; - }; - pathlib2 = callPackage ../development/python-modules/pathlib2 { }; pathpy = callPackage ../development/python-modules/path.py { }; From 4716facdd18213e1627b0610ef226965ec709cf8 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Fri, 10 Aug 2018 16:41:46 -0400 Subject: [PATCH 07/12] pythonPackage.ase: init at 3.16.2 - tests just hang so skipping tests - python 2.7, 3+ - repository is in gitlab so had to fetchurl --- .../python-modules/ase/default.nix | 36 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/python-modules/ase/default.nix diff --git a/pkgs/development/python-modules/ase/default.nix b/pkgs/development/python-modules/ase/default.nix new file mode 100644 index 000000000000..1f7b9419278e --- /dev/null +++ b/pkgs/development/python-modules/ase/default.nix @@ -0,0 +1,36 @@ +{ lib +, fetchurl +, buildPythonPackage +, numpy +, scipy +, matplotlib +, flask +, pillow +, psycopg2 +}: + +buildPythonPackage rec { + version = "3.16.2"; + pname = "ase"; + + src = fetchurl { + url = "https://gitlab.com/${pname}/${pname}/-/archive/${version}/${pname}-${version}.tar.gz"; + sha256 = "171j3f4a261cfnqjq98px5fldxql65i3jgf60wc945xvh0mbc8ds"; + }; + + propagatedBuildInputs = [ numpy scipy matplotlib flask pillow psycopg2 ]; + + checkPhase = '' + $out/bin/ase test + ''; + + # tests just hang most likely due to something with subprocesses and cli + doCheck = false; + + meta = { + description = "Atomic Simulation Environment"; + homepage = https://wiki.fysik.dtu.dk/ase/; + license = lib.licenses.lgpl21Plus; + maintainers = with lib.maintainers; [ costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c8b4a8ace418..d48741ce8a49 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -182,6 +182,8 @@ in { asana = callPackage ../development/python-modules/asana { }; + ase = callPackage ../development/python-modules/ase { }; + asn1crypto = callPackage ../development/python-modules/asn1crypto { }; aspy-yaml = callPackage ../development/python-modules/aspy.yaml { }; From def307e476da03fa282633abfabfb45578700347 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Fri, 10 Aug 2018 16:42:52 -0400 Subject: [PATCH 08/12] pagmo2: init at 2.8 - c++ headers for library - parallel optimization framework - all tests but 1/55 pass so skipping tests --- pkgs/development/libraries/pagmo2/default.nix | 46 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/development/libraries/pagmo2/default.nix diff --git a/pkgs/development/libraries/pagmo2/default.nix b/pkgs/development/libraries/pagmo2/default.nix new file mode 100644 index 000000000000..367cef46dc44 --- /dev/null +++ b/pkgs/development/libraries/pagmo2/default.nix @@ -0,0 +1,46 @@ +{ lib +, fetchFromGitHub +, stdenv +, cmake +, eigen +, nlopt +, ipopt +, boost +, writeText +}: + +stdenv.mkDerivation rec { + name = "pagmo2-${version}"; + version = "2.8"; + + src = fetchFromGitHub { + owner = "esa"; + repo = "pagmo2"; + rev = "v${version}"; + sha256 = "1xwxamcn3fkwr62jn6bkanrwy0cvsksf75hfwx4fvl56awnbz41z"; + }; + + buildInputs = [ cmake 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_cxx.so" "-DPAGMO_WITH_IPOPT=yes" + "-DCMAKE_CXX_FLAGS='-fuse-ld=gold'" ]; + + checkPhase = '' + ctest + ''; + + # All but one test pass skip for now (tests also take about 30 min to compile) + doCheck = false; + + meta = { + homepage = https://esa.github.io/pagmo2/; + description = "Scientific library for massively parallel optimization"; + license = stdenv.lib.licenses.gpl3Plus; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1340020d5b9c..a4a6f2cbd669 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4419,6 +4419,8 @@ with pkgs; padthv1 = callPackage ../applications/audio/padthv1 { }; + pagmo2 = callPackage ../development/libraries/pagmo2 { }; + pakcs = callPackage ../development/compilers/pakcs {}; pal = callPackage ../tools/misc/pal { }; From ff27546351e00f62dd21d0334a0df2279160d084 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Fri, 10 Aug 2018 16:43:58 -0400 Subject: [PATCH 09/12] pythonPackages.pygmo: init at 2.8 - python 2.7, 3+ - skipping tests becuase none are easy to run (require some parallel workers) - fetchFromgitHub so that running tests in future is possible --- .../python-modules/pygmo/default.nix | 48 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 50 insertions(+) create mode 100644 pkgs/development/python-modules/pygmo/default.nix diff --git a/pkgs/development/python-modules/pygmo/default.nix b/pkgs/development/python-modules/pygmo/default.nix new file mode 100644 index 000000000000..2500121dc9e6 --- /dev/null +++ b/pkgs/development/python-modules/pygmo/default.nix @@ -0,0 +1,48 @@ +{ lib +, fetchFromGitHub +, buildPythonPackage +, cmake +, eigen +, nlopt +, ipopt +, boost +, pagmo2 +, numpy +, cloudpickle +, ipyparallel +, numba +}: + +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 ]; + 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} + + make install + mv $out/lib/python*/site-packages/pygmo wheel + cd wheel + ''; + + # dont do tests + doCheck = false; + + meta = { + description = "Parallel optimisation for Python"; + homepage = https://esa.github.io/pagmo2/; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d48741ce8a49..8399005534f5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -408,6 +408,8 @@ in { pygame_sdl2 = callPackage ../development/python-modules/pygame_sdl2 { }; + pygmo = callPackage ../development/python-modules/pygmo { }; + pygobject2 = callPackage ../development/python-modules/pygobject { }; pygobject3 = callPackage ../development/python-modules/pygobject/3.nix { }; From fb40e62657337f254dcf28157765d86cb60e2183 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Fri, 10 Aug 2018 16:45:38 -0400 Subject: [PATCH 10/12] pythonPackages.pymatgen-lammps: init at 0.4.5 - all tests pass - python 3+ - fetchurl since package is on gitlab --- .../pymatgen-lammps/default.nix | 31 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/development/python-modules/pymatgen-lammps/default.nix diff --git a/pkgs/development/python-modules/pymatgen-lammps/default.nix b/pkgs/development/python-modules/pymatgen-lammps/default.nix new file mode 100644 index 000000000000..dbe9107c7c83 --- /dev/null +++ b/pkgs/development/python-modules/pymatgen-lammps/default.nix @@ -0,0 +1,31 @@ +{ lib +, fetchurl +, buildPythonPackage +, pymatgen +, lammps +, pytestrunner +, pytest +, isPy3k +}: + +buildPythonPackage rec { + pname = "pymatgen-lammps"; + version = "0.4.5"; + disabled = (!isPy3k); + + src = fetchurl { + url = "https://gitlab.com/costrouc/${pname}/-/archive/v${version}/${pname}-v${version}.tar.gz"; + sha256 = "0shldl8is3195jmji7dr3zsh1bzxlahaqrmpr28niks7nnfj80fx"; + }; + + buildInputs = [ pytestrunner ]; + checkInputs = [ pytest ]; + propagatedBuildInputs = [ pymatgen ]; + + meta = { + description = "A LAMMPS wrapper using pymatgen"; + homepage = https://gitlab.com/costrouc/pymatgen-lammps; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8399005534f5..a74d0bc8579a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -439,6 +439,8 @@ in { pymatgen = callPackage ../development/python-modules/pymatgen { }; + pymatgen-lammps = callPackage ../development/python-modules/pymatgen-lammps { }; + pynisher = callPackage ../development/python-modules/pynisher { }; pyparser = callPackage ../development/python-modules/pyparser { }; From dc552ab32e5cf266d3a4592323fbe7196169a1ab Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Fri, 10 Aug 2018 16:46:44 -0400 Subject: [PATCH 11/12] pythonPackages.lammps-cython: init at 0.5.7 - python 3+ - all tests pass - fetchurl since project based in gitlab and to run tests --- .../python-modules/lammps-cython/default.nix | 53 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 ++ 2 files changed, 57 insertions(+) create mode 100644 pkgs/development/python-modules/lammps-cython/default.nix diff --git a/pkgs/development/python-modules/lammps-cython/default.nix b/pkgs/development/python-modules/lammps-cython/default.nix new file mode 100644 index 000000000000..501e4adc21d6 --- /dev/null +++ b/pkgs/development/python-modules/lammps-cython/default.nix @@ -0,0 +1,53 @@ +{ lib +, fetchurl +, buildPythonPackage +, lammps-mpi +, mpi +, mpi4py +, numpy +, cython +, pymatgen +, ase +, pytestrunner +, pytest +, pytestcov +, isPy3k +, openssh +}: + +buildPythonPackage rec { + pname = "lammps-cython"; + version = "0.5.7"; + disabled = (!isPy3k); + + src = fetchurl { + url = "https://gitlab.com/costrouc/${pname}/-/archive/v${version}/${pname}-v${version}.tar.gz"; + sha256 = "1wj9scmjdl00af13b5ihfccrjpikrdgkzd88ialam1nkxvxi42bl"; + }; + + buildInputs = [ cython pytestrunner ]; + checkInputs = [ pytest pytestcov openssh ]; + propagatedBuildInputs = [ mpi4py pymatgen ase numpy ]; + + preBuild = '' + echo "Creating lammps.cfg file..." + cat << EOF > lammps.cfg + [lammps] + lammps_include_dir = ${lammps-mpi}/include + lammps_library_dir = ${lammps-mpi}/lib + lammps_library = lammps_mpi + + [mpi] + mpi_include_dir = ${mpi}/include + mpi_library_dir = ${mpi}/lib + mpi_library = mpi + EOF + ''; + + meta = { + description = "Pythonic Wrapper to LAMMPS using cython"; + homepage = https://gitlab.com/costrouc/lammps-cython; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a74d0bc8579a..f1499b5d42a5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -308,6 +308,10 @@ in { jira = callPackage ../development/python-modules/jira { }; + lammps-cython = callPackage ../development/python-modules/lammps-cython { + mpi = pkgs.openmpi; + }; + lmtpd = callPackage ../development/python-modules/lmtpd { }; logster = callPackage ../development/python-modules/logster { }; From 058e22e0a3bd3bda79ab6bba6421b8d134907ab6 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Fri, 10 Aug 2018 16:47:46 -0400 Subject: [PATCH 12/12] pythonPackages.dftfit: init at 0.4.11 - tests require lfs download so not run - python 3+ - fetchpypi since fetchurl is large download --- .../python-modules/dftfit/default.nix | 47 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/development/python-modules/dftfit/default.nix diff --git a/pkgs/development/python-modules/dftfit/default.nix b/pkgs/development/python-modules/dftfit/default.nix new file mode 100644 index 000000000000..711f4ac1e0ec --- /dev/null +++ b/pkgs/development/python-modules/dftfit/default.nix @@ -0,0 +1,47 @@ +{ lib +, fetchPypi +, buildPythonPackage +, pymatgen +, marshmallow +, pyyaml +, pygmo +, pandas +, scipy +, numpy +, scikitlearn +, lammps-cython +, pymatgen-lammps +, pytestrunner +, pytest +, pytestcov +, pytest-benchmark +, isPy3k +, openssh +}: + +buildPythonPackage rec { + pname = "dftfit"; + version = "0.4.11"; + disabled = (!isPy3k); + + src = fetchPypi { + inherit pname version; + sha256 = "c6e36a793f9f94746bb8a04fb8316404aeacfa918704de07b15e1b4b8b62242d"; + }; + + buildInputs = [ pytestrunner ]; + checkInputs = [ pytest pytestcov pytest-benchmark openssh ]; + propagatedBuildInputs = [ pymatgen marshmallow pyyaml pygmo + pandas scipy numpy scikitlearn + lammps-cython pymatgen-lammps ]; + + # tests require git lfs download. and is quite large so skip tests + doCheck = false; + + meta = { + description = "Ab-Initio Molecular Dynamics Potential Development"; + homepage = https://gitlab.com/costrouc/dftfit; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f1499b5d42a5..8240e7b95578 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -264,6 +264,8 @@ in { dbus = pkgs.dbus; }; + dftfit = callPackage ../development/python-modules/dftfit { }; + discid = callPackage ../development/python-modules/discid { }; discordpy = callPackage ../development/python-modules/discordpy { };