From 621e086136a176088d2531d583aff8384ed4d4da Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Fri, 5 May 2023 12:43:59 +0200 Subject: [PATCH 1/3] nwchem: 7.0.2 -> 7.2.0 --- .../science/chemistry/nwchem/default.nix | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/science/chemistry/nwchem/default.nix b/pkgs/applications/science/chemistry/nwchem/default.nix index 1e76a3059534..4fd60259ca61 100644 --- a/pkgs/applications/science/chemistry/nwchem/default.nix +++ b/pkgs/applications/science/chemistry/nwchem/default.nix @@ -2,7 +2,6 @@ , stdenv , pkgs , fetchFromGitHub -, fetchpatch , which , openssh , gcc @@ -23,36 +22,27 @@ assert blas.isILP64 == lapack.isILP64; let - versionGA = "5.7.2"; # Fixed by nwchem + versionGA = "5.8.2"; # Fixed by nwchem ga_src = fetchFromGitHub { owner = "GlobalArrays"; repo = "ga"; rev = "v${versionGA}"; - sha256 = "0c1y9a5jpdw9nafzfmvjcln1xc2gklskaly0r1alm18ng9zng33i"; + hash = "sha256-2ffQIg9topqKX7ygnWaa/UunL9d0Lj9qr9xucsjLuoY="; }; in stdenv.mkDerivation rec { pname = "nwchem"; - version = "7.0.2"; + version = "7.2.0"; src = fetchFromGitHub { owner = "nwchemgit"; repo = "nwchem"; rev = "v${version}-release"; - sha256 = "1ckhcjaw1hzdsmm1x2fva27c4rs3r0h82qivg72v53idz880hbp3"; + hash = "sha256-/biwHOSMGpdnYRGrGlDounKKLVaG2XkBgCmpE0IKR/Y="; }; - patches = [ - # Fix Python 3.10 compatibility - (fetchpatch { - name = "python3.10"; - url = "https://github.com/nwchemgit/nwchem/commit/638401361c6f294164a4f820ff867a62ac836fd5.patch"; - sha256 = "sha256-yUZb3wWYZm1dX0HwvffksFwhVdb7ix1p8ooJnqiSgEg="; - }) - ]; - nativeBuildInputs = [ perl automake @@ -114,11 +104,17 @@ stdenv.mkDerivation rec { export LAPACK_LIB="-L${lapack}/lib -llapack" export BLAS_SIZE=${if blas.isILP64 then "8" else "4"} + # Requires DFT-D3 tgz file + # See nwchem/src/nwpw/nwpwlib/nwpwxc/build_dftd3a.sh + export NO_NWPWXC_VDW3A=1 + # extra TCE related options export MRCC_METHODS="y" export EACCSD="y" export IPCCSD="y" + export CCSDTQ="y" + export NWCHEM_TOP="$(pwd)" runHook postConfigure From d6b6fd9544629e01a57cc5908ae2e8a5511a074a Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Mon, 8 May 2023 13:14:52 +0200 Subject: [PATCH 2/3] nwchem: enable new features (dftd3, libxc, plumed) --- .../science/chemistry/nwchem/default.nix | 38 +++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/science/chemistry/nwchem/default.nix b/pkgs/applications/science/chemistry/nwchem/default.nix index 4fd60259ca61..82daf5f85e74 100644 --- a/pkgs/applications/science/chemistry/nwchem/default.nix +++ b/pkgs/applications/science/chemistry/nwchem/default.nix @@ -2,6 +2,7 @@ , stdenv , pkgs , fetchFromGitHub +, fetchurl , which , openssh , gcc @@ -24,13 +25,31 @@ assert blas.isILP64 == lapack.isILP64; let versionGA = "5.8.2"; # Fixed by nwchem - ga_src = fetchFromGitHub { + gaSrc = fetchFromGitHub { owner = "GlobalArrays"; repo = "ga"; rev = "v${versionGA}"; hash = "sha256-2ffQIg9topqKX7ygnWaa/UunL9d0Lj9qr9xucsjLuoY="; }; + dftd3Src = fetchurl { + url = "https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3/dftd3.tgz"; + hash = "sha256-2Xz5dY9hqoH9hUJUSPv0pujOB8EukjZzmDGjrzKID1k="; + }; + + versionLibxc = "6.1.0"; + libxcSrc = fetchurl { + url = "https://gitlab.com/libxc/libxc/-/archive/${versionLibxc}/libxc-${versionLibxc}.tar.gz"; + hash = "sha256-9ZN0X6R+v7ndxGeqr9wvoSdfDXJQxpLOl2E4mpDdjq8="; + }; + + plumedSrc = fetchFromGitHub { + owner = "edoapra"; + repo = "plumed2"; + rev = "e7c908da50bde1c6399c9f0e445d6ea3330ddd9b"; + hash = "sha256-CNlb6MTEkD977hj3xonYqZH1/WlQ1EdVD7cvL//heRM="; + }; + in stdenv.mkDerivation rec { pname = "nwchem"; @@ -63,8 +82,17 @@ stdenv.mkDerivation rec { propagatedUserEnvPkgs = [ mpi ]; postUnpack = '' - cp -r ${ga_src}/ source/src/tools/ga-${versionGA} + # These run 'configure' in source tree and + # require a writable directory + cp -r ${gaSrc}/ source/src/tools/ga-${versionGA} chmod -R u+w source/src/tools/ga-${versionGA} + + cp -r ${plumedSrc} source/src/libext/plumed/plumed2 + chmod -R u+w source/src/libext/plumed/plumed2 + + # Provide tarball in expected location + ln -s ${dftd3Src} source/src/nwpw/nwpwlib/nwpwxc/dftd3.tgz + ln -s ${libxcSrc} source/src/libext/libxc/libxc-${versionLibxc}.tar.gz ''; postPatch = '' @@ -104,10 +132,6 @@ stdenv.mkDerivation rec { export LAPACK_LIB="-L${lapack}/lib -llapack" export BLAS_SIZE=${if blas.isILP64 then "8" else "4"} - # Requires DFT-D3 tgz file - # See nwchem/src/nwpw/nwpwlib/nwpwxc/build_dftd3a.sh - export NO_NWPWXC_VDW3A=1 - # extra TCE related options export MRCC_METHODS="y" export EACCSD="y" @@ -123,7 +147,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; preBuild = '' - ln -s ${ga_src} src/tools/ga-${versionGA}.tar.gz + ln -s ${gaSrc} src/tools/ga-${versionGA}.tar.gz cd src make nwchem_config ${lib.optionalString (!blas.isILP64) "make 64_to_32"} From f4bd6710d77aa40dea748142efdb56c1e702b01a Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Mon, 8 May 2023 13:44:40 +0200 Subject: [PATCH 3/3] nwchem: build with ILP64 support --- pkgs/top-level/all-packages.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4a252b887935..6f08a91985fd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -37126,7 +37126,10 @@ with pkgs; mopac = callPackage ../applications/science/chemistry/mopac { }; - nwchem = callPackage ../applications/science/chemistry/nwchem { }; + nwchem = callPackage ../applications/science/chemistry/nwchem { + blas = blas-ilp64; + lapack = lapack-ilp64; + }; octopus = callPackage ../applications/science/chemistry/octopus { };