Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ccb2dead1bce
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2823b5e698cb
Choose a head ref
  • 4 commits
  • 5 files changed
  • 2 contributors

Commits on Oct 15, 2018

  1. dl-poly-classic: init 1.10

    only mpi version provided
    costrouc committed Oct 15, 2018
    Copy the full SHA
    7717a2b View commit details
  2. lammps: patch_2Aug2018 -> stable_22Aug2018

    nix derivation was cleaned significantly to follow nixpkgs better
    costrouc committed Oct 15, 2018
    Copy the full SHA
    397e15f View commit details

Commits on Oct 30, 2018

  1. hoomd-blue: init at 2.3.4

    costrouc committed Oct 30, 2018
    Copy the full SHA
    ae66a92 View commit details

Commits on Nov 13, 2018

  1. Merge pull request #46667 from costrouc/costrouc/lammps-update

    lammps: update, hoomd-blue, dl_poly: init
    markuskowa authored Nov 13, 2018
    Copy the full SHA
    2823b5e View commit details
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{ stdenv, fetchurl
, gfortran, mpi
}:

stdenv.mkDerivation rec {
version = "1.10";
name = "DL_POLY_Classic-${version}";

src = fetchurl {
url = "https://ccpforge.cse.rl.ac.uk/gf/download/frsrelease/574/8924/dl_class_1.10.tar.gz";
sha256 = "1r76zvln3bwycxlmqday0sqzv5j260y7mdh66as2aqny6jzd5ld7";
};

buildInputs = [ mpi gfortran ];

configurePhase = ''
cd source
cp -v ../build/MakePAR Makefile
'';

buildPhase = ''
make dlpoly
'';

installPhase = ''
mkdir -p $out/bin
cp -v ../execute/DLPOLY.X $out/bin
'';

meta = with stdenv.lib; {
homepage = https://www.ccp5.ac.uk/DL_POLY_C;
description = "DL_POLY Classic is a general purpose molecular dynamics simulation package";
license = licenses.bsdOriginal;
platforms = [ "x86_64-linux" ];
maintainers = [ maintainers.costrouc ];
};
}
71 changes: 32 additions & 39 deletions pkgs/applications/science/molecular-dynamics/lammps/default.nix
Original file line number Diff line number Diff line change
@@ -1,63 +1,56 @@
{ lib
, bash
, stdenv
, writeText
, fetchFromGitHub
, libpng
, gzip
, fftw
, openblas
, mpiSupport ? false, mpi ? null
{ stdenv, fetchFromGitHub
, libpng, gzip, fftw, openblas
, mpi ? null
}:

assert mpiSupport -> mpi != null;

let 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";
withMPI = (mpi != null);
in
stdenv.mkDerivation rec {
# LAMMPS has weird versioning converted to ISO 8601 format
version = "patch_2Aug2018";
version = "stable_22Aug2018";
name = "lammps-${version}";

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";
sha256 = "1dlifm9wm1jcw2zwal3fnzzl41ng08c7v48w6hx2mz84zljg1nsj";
};

passthru = {
inherit mpi;
inherit packages;
};

buildInputs = [ fftw libpng openblas gzip bash ]
++ (stdenv.lib.optionals mpiSupport [ mpi ]);
buildInputs = [ fftw libpng openblas gzip ]
++ (stdenv.lib.optionals withMPI [ mpi ]);

configurePhase = ''
cd src
for pack in ${stdenv.lib.concatStringsSep " " packages}; do make "yes-$pack" SHELL=$SHELL; done
'';

# Must do manual build due to LAMMPS requiring a seperate build for
# the libraries and executable
builder = writeText "builder.sh" ''
source $stdenv/setup
# the libraries and executable. Also non-typical make script
buildPhase = ''
make mode=exe ${if withMPI then "mpi" else "serial"} SHELL=$SHELL LMP_INC="${lammps_includes}" FFT_PATH=-DFFT_FFTW3 FFT_LIB=-lfftw3 JPG_LIB=-lpng
make mode=shlib ${if withMPI then "mpi" else "serial"} SHELL=$SHELL LMP_INC="${lammps_includes}" 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
installPhase = ''
mkdir -p $out/bin $out/include $out/lib
mkdir -p $out/bin
cp -v lmp_* $out/bin/
mkdir -p $out/include
cp -v *.h $out/include/
mkdir -p $out/lib
cp -v liblammps* $out/lib/
'';

meta = {
meta = with stdenv.lib; {
description = "Classical Molecular Dynamics simulation code";
longDescription = ''
LAMMPS is a classical molecular dynamics simulation code designed to
@@ -67,8 +60,8 @@ stdenv.mkDerivation rec {
under the terms of the GNU Public License (GPL).
'';
homepage = http://lammps.sandia.gov;
license = stdenv.lib.licenses.gpl2;
platforms = stdenv.lib.platforms.linux;
maintainers = with lib.maintainers; [ costrouc ];
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = [ maintainers.costrouc ];
};
}
67 changes: 67 additions & 0 deletions pkgs/development/python-modules/hoomd-blue/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{ stdenv, buildPythonPackage, fetchgit
, cmake, pkgconfig
, python
, mpi ? null
}:

let components = {
cgcmm = true;
depreciated = true;
hpmc = true;
md = true;
metal = true;
testing = false;
};
onOffBool = b: if b then "ON" else "OFF";
withMPI = (mpi != null);
in
stdenv.mkDerivation rec {
version = "2.3.4";
name = "hoomd-blue-${version}";

src = fetchgit {
url = "https://bitbucket.org/glotzer/hoomd-blue";
rev = "v${version}";
sha256 = "0in49f1dvah33nl5n2qqbssfynb31pw1ds07j8ziryk9w252j1al";
};

passthru = {
inherit components mpi;
};

nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = stdenv.lib.optionals withMPI [ mpi ];
propagatedBuildInputs = [ python.pkgs.numpy ]
++ stdenv.lib.optionals withMPI [ python.pkgs.mpi4py ];

enableParallelBuilding = true;

dontAddPrefix = true;
cmakeFlags = [
"-DENABLE_MPI=${onOffBool withMPI}"
"-DBUILD_CGCMM=${onOffBool components.cgcmm}"
"-DBUILD_DEPRECIATED=${onOffBool components.depreciated}"
"-DBUILD_HPMC=${onOffBool components.hpmc}"
"-DBUILD_MD=${onOffBool components.md}"
"-DBUILD_METAL=${onOffBool components.metal}"
"-DBUILD_TESTING=${onOffBool components.testing}"
];

preConfigure = ''
# Since we can't expand $out in `cmakeFlags`
cmakeFlags="$cmakeFlags -DCMAKE_INSTALL_PREFIX=$out/${python.sitePackages}"
'';

# tests fail but have tested that package runs properly
doCheck = false;
checkTarget = "test";

meta = with stdenv.lib; {
homepage = http://glotzerlab.engin.umich.edu/hoomd-blue/;
description = "HOOMD-blue is a general-purpose particle simulation toolkit";
license = licenses.bsdOriginal;
platforms = [ "x86_64-linux" ];
maintainers = [ maintainers.costrouc ];
};

}
7 changes: 5 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -21378,12 +21378,15 @@ with pkgs;

### SCIENCE/MOLECULAR-DYNAMICS

dl-poly-classic-mpi = callPackage ../applications/science/molecular-dynamics/dl-poly-classic {
mpi = openmpi;
};

lammps = callPackage ../applications/science/molecular-dynamics/lammps {
fftw = fftw;
};

lammps-mpi = appendToName "mpi" (lammps.override {
mpiSupport = true;
lammps-mpi = lowPrio (lammps.override {
mpi = openmpi;
});

4 changes: 4 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
@@ -392,6 +392,10 @@ in {

hdmedians = callPackage ../development/python-modules/hdmedians { };

hoomd-blue = toPythonModule (callPackage ../development/python-modules/hoomd-blue {
inherit python;
});

httpsig = callPackage ../development/python-modules/httpsig { };

i3ipc = callPackage ../development/python-modules/i3ipc { };