74 lines
2.5 KiB
Ruby
74 lines
2.5 KiB
Ruby
class Nwchem < Formula
|
|
desc "High-performance computational chemistry tools"
|
|
homepage "https://nwchemgit.github.io"
|
|
url "https://github.com/nwchemgit/nwchem/releases/download/v7.0.2-release/nwchem-7.0.2-release.revision-b9985dfa-src.2020-10-12.tar.bz2"
|
|
version "7.0.2"
|
|
sha256 "d9d19d87e70abf43d61b2d34e60c293371af60d14df4a6333bf40ea63f6dc8ce"
|
|
license "ECL-2.0"
|
|
revision 1
|
|
|
|
livecheck do
|
|
url "https://github.com/nwchemgit/nwchem.git"
|
|
regex(/^v?(\d+(?:\.\d+)+)-release$/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any, big_sur: "97b96ea00d1c114e5e01b898f3c3874904bf9fa75325b15f97ea89556a52ab56"
|
|
sha256 cellar: :any, catalina: "f1a523baa98353375c7770fa30b03f8a9bce2c60b9e347e5fe790b0a1274c4fd"
|
|
sha256 cellar: :any, mojave: "53bdde9b33e8a4ff4d954899bb71371e40a9b2e6a495cb57c169f9df65855863"
|
|
end
|
|
|
|
depends_on "gcc" # for gfortran
|
|
depends_on "open-mpi"
|
|
depends_on "openblas"
|
|
depends_on "python@3.9"
|
|
depends_on "scalapack"
|
|
|
|
def install
|
|
pkgshare.install "QA"
|
|
|
|
cd "src" do
|
|
(prefix/"etc").mkdir
|
|
(prefix/"etc/nwchemrc").write <<~EOS
|
|
nwchem_basis_library #{pkgshare}/libraries/
|
|
nwchem_nwpw_library #{pkgshare}/libraryps/
|
|
ffield amber
|
|
amber_1 #{pkgshare}/amber_s/
|
|
amber_2 #{pkgshare}/amber_q/
|
|
amber_3 #{pkgshare}/amber_x/
|
|
amber_4 #{pkgshare}/amber_u/
|
|
spce #{pkgshare}/solvents/spce.rst
|
|
charmm_s #{pkgshare}/charmm_s/
|
|
charmm_x #{pkgshare}/charmm_x/
|
|
EOS
|
|
|
|
inreplace "util/util_nwchemrc.F", "/etc/nwchemrc", "#{etc}/nwchemrc"
|
|
|
|
# needed to use python 3.X to skip using default python2
|
|
ENV["PYTHONVERSION"] = Language::Python.major_minor_version "python3"
|
|
ENV["BLASOPT"] = "-L#{Formula["openblas"].opt_lib} -lopenblas"
|
|
ENV["LAPACK_LIB"] = "-L#{Formula["openblas"].opt_lib} -lopenblas"
|
|
ENV["BLAS_SIZE"] = "4"
|
|
ENV["SCALAPACK"] = "-L#{Formula["scalapack"].opt_prefix}/lib -lscalapack"
|
|
ENV["USE_64TO32"] = "y"
|
|
system "make", "nwchem_config", "NWCHEM_MODULES=all python"
|
|
system "make", "NWCHEM_TARGET=MACX64", "USE_MPI=Y"
|
|
|
|
bin.install "../bin/MACX64/nwchem"
|
|
pkgshare.install "basis/libraries"
|
|
pkgshare.install "nwpw/libraryps"
|
|
pkgshare.install Dir["data/*"]
|
|
end
|
|
end
|
|
|
|
test do
|
|
cp_r pkgshare/"QA", testpath
|
|
cd "QA" do
|
|
ENV["NWCHEM_TOP"] = pkgshare
|
|
ENV["NWCHEM_TARGET"] = "MACX64"
|
|
ENV["NWCHEM_EXECUTABLE"] = "#{bin}/nwchem"
|
|
system "./runtests.mpi.unix", "procs", "0", "dft_he2+", "pyqa3", "prop_mep_gcube", "pspw", "tddft_h2o", "tce_n2"
|
|
end
|
|
end
|
|
end
|