@@ -41,9 +41,14 @@ class Nwchem(Package):
4141 url = "https://github.com/nwchemgit/nwchem/releases/download/v7.0.2-release/nwchem-7.0.2-release.revision-b9985dfa-srconly.2020-10-12.tar.bz2" ,
4242 )
4343
44- depends_on ("c" , type = "build" ) # generated
45- depends_on ("cxx" , type = "build" ) # generated
46- depends_on ("fortran" , type = "build" ) # generated
44+ resource (
45+ name = "dftd3.tgz" ,
46+ url = "https://www.chemie.uni-bonn.de/grimme/de/software/dft-d3/dftd3.tgz" ,
47+ destination = "" ,
48+ placement = "dft-d3" ,
49+ sha256 = "d97cf9758f61aa81fd85425448fbf4a6e8ce07c12e9236739831a3af32880f59" ,
50+ expand = False ,
51+ )
4752
4853 variant ("openmp" , default = False , description = "Enables OpenMP support" )
4954 variant ("f90allocatable" , default = False , description = "Use F90 allocatable instead of MA" )
@@ -80,10 +85,10 @@ class Nwchem(Package):
8085 # https://github.com/nwchemgit/nwchem/commit/c89fc9d1eca6689bce12564a63fdea95d962a123
8186 # Prior versions of NWChem, including 7.0.2, were not able to link with FFTW
8287 patch ("fftw_splans.patch" , when = "@7.2.0:7.2.3 +fftw3" )
83- # This patch is for including a working link for dft-d3 download as existing link
84- # https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3//dftd3.tgz is not active
85- # Same is mentioned in https://metadata.ftp-master.debian.org/changelogs/main/n/nwchem/unstable_changelog
86- patch ( "dft-d3_url.patch " , when = "@7.2.0:7.2.2 " )
88+
89+ depends_on ( "c" , type = "build" )
90+ depends_on ( "cxx" , type = "build" )
91+ depends_on ( "fortran " , type = "build " )
8792
8893 depends_on ("blas" )
8994 depends_on ("lapack" )
@@ -96,10 +101,18 @@ class Nwchem(Package):
96101 depends_on ("fftw-api@3" , when = "+fftw3" )
97102 depends_on ("libxc" , when = "+libxc" )
98103 depends_on ("elpa" , when = "+elpa" )
99- depends_on ("python@3 :3.9" , type = ("build" , "link" , "run" ), when = "@:7.0.2" )
104+ depends_on ("python@:3.9" , type = ("build" , "link" , "run" ), when = "@:7.0.2" )
100105 depends_on ("python@3" , type = ("build" , "link" , "run" ), when = "@7.2.0:" )
101106
107+ depends_on ("gmake" , type = "build" )
108+ # for the dftd3 resource (bash is also required, not listed here)
109+ depends_on ("tar" , type = "build" )
110+ depends_on ("patch" , type = "build" )
111+
102112 def install (self , spec , prefix ):
113+ # move the dft-d3/dftd3.tgz resource
114+ os .rename ("dft-d3/dftd3.tgz" , "src/nwpw/nwpwlib/nwpwxc/dftd3.tgz" )
115+
103116 scalapack = spec ["scalapack" ].libs
104117 lapack = spec ["lapack" ].libs
105118 blas = spec ["blas" ].libs
0 commit comments