#!/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 $