You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
2.3 KiB
86 lines
2.3 KiB
#!/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 $</. $@
|
|
find $@ -type d -exec chmod 755 '{}' \;
|
|
find $@ -type f -exec chmod 644 '{}' \;
|
|
if [ "x$(ROOT_USER)" = xyes ]; then chown -R root.root $@; fi
|
|
endef
|
|
|
|
$(DATADIR): $(BUILD_DIR)/src/data
|
|
$(proc_install_tree)
|
|
|
|
$(DATADIR)/libraries: $(BUILD_DIR)/src/basis/libraries
|
|
$(proc_install_tree)
|
|
|
|
$(DATADIR)/libraryps: $(BUILD_DIR)/src/nwpw/libraryps
|
|
$(proc_install_tree)
|
|
|
|
# Undocumented. See:
|
|
# nwpw/pspw/lib/exchange-correlation/vdw-DF/vdw_DF_get_qmesh_filename.F
|
|
$(DATADIR)/nwpw/xc/vdw-DF/vdw_qmesh.dat: $(BUILD_DIR)/src/nwpw/pspw/lib/exchange-correlation/vdw-DF/vdw_qmesh.dat
|
|
mkdir -p -v $$(dirname "$@")
|
|
$(INSTALL) -m 644 -p $< $@
|
|
if [ "x$(ROOT_USER)" = xyes ]; then chown -R root.root $@; fi
|
|
|
|
|