added BUILD_PLUMED to trigger static Plumed install

This commit is contained in:
edoapra 2022-05-04 16:51:12 -07:00
parent 8239d02d44
commit c0e9ddc3fc
No known key found for this signature in database
GPG key ID: 48E12DA1EDE9E1B0
4 changed files with 102 additions and 6 deletions

View file

@ -3604,6 +3604,15 @@ ifdef USE_SIMINT
endif
ifdef BUILD_PLUMED
NW_CORE_SUBDIRS += libext
PATH := $(NWCHEM_TOP)/src/libext/bin:$(PATH)
LD_LIBRARY_PATH := $(NWCHEM_TOP)/src/libext/lib:$(LD_LIBRARY_PATH)
DEFINES += -DUSE_PLUMED
PLUMED_HOME=$(NWCHEM_TOP)/src/libext
PLUMED_DYNAMIC_LIBS=$(shell test -x $(NWCHEM_TOP)/src/libext/bin/plumed && $(NWCHEM_TOP)/src/libext/bin/plumed info --configuration|egrep DYNAMIC_LIBS| cut -c 14-)
PLUMED_HASMPI = $(shell test -x $(NWCHEM_TOP)/src/libext/bin/plumed && $(NWCHEM_TOP)/src/libext/bin/plumed info --configuration|grep program_can_run_mpi|cut -c 21-21)
endif
ifdef USE_PLUMED
DEFINES += -DUSE_PLUMED
#check presence of plumed command. TODO
@ -3618,13 +3627,8 @@ ifdef USE_PLUMED
PLUMED_HOME = $(shell plumed info --configuration|egrep prefix=|head -1|cut -c 8-)
PLUMED_DYNAMIC_LIBS = $(shell plumed info --configuration|egrep DYNAMIC_LIBS| cut -c 14-)
PLUMED_HASMPI = $(plumed info --configuration|grep program_can_run_mpi|cut -c 21-21)
ifeq ($(PLUMED_HASMPI),y)
DEFINES += -DPLUMED_HASMPI
endif
#PLUMED_LOAD= /home/edo/tahoma/apps/plumed262.intel20u2/lib/libplumed.a -ldl -lstdc++ -lfftw3 -lz -ldl -llapack -lblas -rdynamic -Wl,-Bsymbolic -fopenmp
ifdef PLUMED_DYNAMIC_LIBS
EXTRA_LIBS += -L$(PLUMED_HOME)/lib -lplumed $(PLUMED_DYNAMIC_LIBS)
else
ifndef PLUMED_DYNAMIC_LIBS
errorplumed:
$(info )
$(info PLUMED info command not returning the expected output)
@ -3632,6 +3636,12 @@ ifdef USE_PLUMED
$(info )
endif
endif
ifdef PLUMED_DYNAMIC_LIBS
EXTRA_LIBS += -L$(PLUMED_HOME)/lib -lplumed $(PLUMED_DYNAMIC_LIBS)
endif
ifeq ($(PLUMED_HASMPI),y)
DEFINES += -DPLUMED_HASMPI
endif
#TBLITE

View file

@ -25,6 +25,9 @@ endif
ifdef USE_TBLITE
SUBDIRS += tblite
endif
ifdef BUILD_PLUMED
SUBDIRS += plumed
endif
include ../config/makelib.h

View file

@ -0,0 +1,19 @@
#$Id$
# makefile,v 1.8 1994/12/05 20:37:08 og845 Exp
# $Id: GNUmakefile 26876 2015-02-24 06:32:05Z edo $
include ../../config/makefile.h
../lib/libplumed.a:
./build_plumed.sh
LIB_TARGETS += scalapack
include ../../config/makelib.h
clean:
@rm -rf plumed* ../lib/libplu* ../bin/plumed* ../include/plumed*

View file

@ -0,0 +1,64 @@
#!/usr/bin/env bash
#set -ex
if [[ -z "${NWCHEM_TOP}" ]]; then
dir3=$(dirname `pwd`)
dir2=$(dirname "$dir3")
NWCHEM_TOP=$(dirname "$dir2")
fi
if [[ "$BLAS_SIZE" == 4 ]] && [[ -z "$USE_64TO32" ]] ; then
if [[ "$NWCHEM_TARGET" != "LINUX" ]] && [[ "$NWCHEM_TARGET" != "MACX" ]] ; then
echo USE_64TO32 must be set when BLAS_SIZE=4 on 64-bit architectures
exit 1
fi
fi
if [[ ! -z "$BUILD_OPENBLAS" ]] ; then
BLASOPT="-L`pwd`/../lib -lnwc_openblas -lpthread"
fi
plumed_branch=cvhd
githubuser=edoapra
#plumed_branch=master
#githubuser=plumed
#rm -rf plumed2
echo executing git clone --depth=1 -b "$plumed_branch" https://github.com/"$githubuser"/plumed2 plumed2
git clone --depth=1 -b $plumed_branch https://github.com/$githubuser/plumed2 plumed2
cd plumed2
if [[ -z "${FC}" ]]; then
FC=gfortran
fi
FC_EXTRA=$(${NWCHEM_TOP}/src/config/strip_compiler.sh ${FC})
pkg-config --exists fftw3
if [[ "$?" == 0 ]]; then
LDFLAGS_EXTRA+=`pkg-config --libs fftw3`
fi
if [[ "${FC_EXTRA}" == "gfortran" ]]; then
LDFLAGS_EXTRA+=" -L"`${FC} -print-file-name=libgfortran.a|sed -e s/libgfortran.a//`" -lgfortran"
fi
if [[ "$BLAS_SIZE" == 8 ]]; then
ILP64=--enable-ilp64
else
ILP64=" "
fi
echo LDFLAGS_EXTRA is "$LDFLAGS_EXTRA"
MODULES_EXTRA="--enable-modules=+cvhd"
echo executing the command \
./configure "$MODULES_EXTRA" --disable-mpi --disable-gsl --disable-shared \
"$ILP64" \
LDFLAGS="$BLASOPT $LDFLAGS_EXTRA" \
LIBS="$BLASOPT $LDFLAGS_EXTRA" \
--prefix=$NWCHEM_TOP/src/libext
./configure "$MODULES_EXTRA" --disable-mpi --disable-gsl --disable-shared\
"$ILP64" \
LDFLAGS="$BLASOPT $LDFLAGS_EXTRA" \
LIBS="$BLASOPT $LDFLAGS_EXTRA" \
--prefix=$NWCHEM_TOP/src/libext
make -j4
if [[ "$?" != "0" ]]; then
echo " "
echo "compilation failed"
echo " "
exit 1
fi
make install
cd ..
#cp lib/libscalapack.a ../../../lib/libnwc_scalapack.a