From f9d350aa7c3e42a7a8bca69068aec68030d10deb Mon Sep 17 00:00:00 2001 From: Wirawan Purwanto Date: Tue, 20 Apr 2021 00:29:27 -0400 Subject: [PATCH] * Added make-based install procedure for nwchem 7.0.0. --- wahab/builds/nwchem/Install-nwchem.mak | 86 ++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100755 wahab/builds/nwchem/Install-nwchem.mak diff --git a/wahab/builds/nwchem/Install-nwchem.mak b/wahab/builds/nwchem/Install-nwchem.mak new file mode 100755 index 0000000..e5d6a14 --- /dev/null +++ b/wahab/builds/nwchem/Install-nwchem.mak @@ -0,0 +1,86 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# +# Installer for nwchem +# 20210415 +# Wirawan Purwanto +# +# CAUTION: This is a GNU makefile. + +NWCHEM_VERSION = 7.0.0 +INSTALL_ROOT_DIR = /shared/apps/manual/nwchem/7.0.0 +TOOLCHAIN_COMBO = gcc7.3-openmpi3.1.4 +BUILD_VARIANT = LINUX64.OPENIB.internalblas +DESTDIR = $(INSTALL_ROOT_DIR)/$(TOOLCHAIN_COMBO)/$(BUILD_VARIANT) +DATADIR = $(INSTALL_ROOT_DIR)/data + +# FIXME: not same flexibility as above +# FIXME: need to build on a dedicated (symlinked) dir +# `/shared/apps/manual/nwchem/7.0.0/_BUILD` because one of the functions +# in nwchem is not flexible. +BUILD_DIR = /scratch/$(USER)/BUILD/nwchem7/$(TOOLCHAIN_COMBO)/prod-nwchem.OPENIB + + +# commands +INSTALL = install -o root -g root +INSTALL = install +RSYNC = rsync + + +# Detect if we are running as ROOT +ROOT_USER := $(shell if [ "`id -ur`" = 0 ]; then echo yes; else echo no; fi) + + +# default target +all-install all: nwchem-bin nwchem-data + + +# Install instruction: +# https://nwchemgit.github.io/Compiling-NWChem.html#general-site-installation + +nwchem-bin: $(DESTDIR)/bin/nwchem + +$(DESTDIR)/bin/nwchem: $(BUILD_DIR)/bin/LINUX64/nwchem + mkdir -p -v $$(dirname "$@") + $(INSTALL) -m 755 -p $< $@ + if [ "x$(ROOT_USER)" = xyes ]; then chown -R root.root $@; fi + +NWCHEM_DATA_FILES = \ + $(DATADIR) \ + $(DATADIR)/libraries \ + $(DATADIR)/libraryps \ + + +nwchem-data: $(NWCHEM_DATA_FILES) + +# We have to use rsync because install can't be used to copy +# a directory tree. +# Args: +# $@ = destination directory +# $< = source directory +# +# CAVEAT: By default all regular files will have 644 attr and directories 755. +define proc_install_tree + mkdir -p $@ + $(RSYNC) -av $