Merge pull request #916 from edoapra/flaccid-fraction

makefile updates
This commit is contained in:
NWChem: Open Source High-Performance Computational Chemistry 2023-11-29 18:29:59 -08:00 committed by GitHub
commit 118d5ffa8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 156 additions and 192 deletions

View file

@ -183,8 +183,8 @@ clear_dbl_to_sngl:
directories:
test \! -f 64_to_32 -o \! -f 32_to_64 || rm -f 64_to_32 32_to_64
test -d $(LIBDIR) || $(MKDIR) -p $(LIBDIR)
test -d $(BINDIR) || $(MKDIR) -p $(BINDIR)
test -d $(LIBDIR) || mkdir -p $(LIBDIR)
test -d $(BINDIR) || mkdir -p $(BINDIR)
./util/util_nwchem_version.bash
auxiliary:

View file

@ -463,7 +463,7 @@ ifeq ($(USE_ARUR),Y)
ARFLAGS = rU
endif
ifndef SKIP_COMPILERS
# strip long paths when FC and/or CC are set from user
ifneq ($(FC),f77)
_FC = $(notdir $(FC))
@ -3480,124 +3480,6 @@ endif
# All machine dependent sections should be above here, otherwise #
# some of the definitions below will be 'lost' #
###################################################################
#the new GA uses ARMCI library
ifdef OLD_GA
ORE_LIBS += -larmci
else
ifeq ($(ARMCI_NETWORK),ARMCI)
ifdef EXTERNAL_ARMCI_PATH
CORE_LIBS += -L$(EXTERNAL_ARMCI_PATH)/lib -larmci
else
CORE_LIBS += -larmci
endif
else
CORE_LIBS +=
endif
endif
# MPI version requires tcgmsg-mpi library
ifdef USE_MPI
#ifeq ($(FC),$(findstring $(FC),mpifrt mpfort mpif77 mpxlf mpif90 ftn scorep-ftn))
ifeq ($(FC),$(findstring $(FC), ftn scorep-ftn))
NWLIBMPI =
NWMPI_INCLUDE =
NWMPI_LIB =
else ifdef BUILD_MPICH
NW_CORE_SUBDIRS += libext
PATH := $(NWCHEM_TOP)/src/libext/bin:$(PATH)
NWMPI_INCLUDE = $(shell PATH=$(NWCHEM_TOP)/src/libext/bin:$(PATH) $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_include)
NWMPI_LIB = $(shell PATH=$(NWCHEM_TOP)/src/libext/bin:$(PATH) $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_lib)
NWLIBMPI = $(shell PATH=$(NWCHEM_TOP)/src/libext/bin:$(PATH) $(NWCHEM_TOP)/src/tools/guess-mpidefs --libmpi)
NWLIBMPI += $(shell pkg-config --libs-only-L hwloc 2> /dev/null)
ifeq ($(NWCHEM_TARGET),MACX64)
GOT_BREW = $(shell command -v brew 2> /dev/null)
ifdef GOT_BREW
NWLIBMPI += -L$(shell brew --prefix)/lib
endif
endif
else ifdef FORCE_MPI_ENV
ifndef MPI_INCLUDE
errormpi1:
$(info )
$(info FORCE_MPI_ENV set but MPI_INCLUDE not set)
$(info )
$(error )
else
NWMPI_INCLUDE = $(MPI_INCLUDE)
endif
ifndef MPI_LIB
errormpi2:
$(info )
$(info FORCE_MPI_ENV set but MPI_LIB not set)
$(info )
$(error )
else
NWMPI_LIB = $(MPI_LIB)
endif
ifndef LIBMPI
errormpi3:
$(info )
$(info FORCE_MPI_ENV set but LIBMPI not set)
$(info )
$(error )
else
NWLIBMPI = $(LIBMPI)
endif
else
ifeq ($(shell pwd), $(NWCHEM_TOP)/src)
ifndef FORCE_MPI_ENV
ifdef LIBMPI
$(info ***warning LIBMPI ignored since FORCE_MPI_ENV not set***)
endif
ifdef MPI_LIB
$(info ***warning MPI_LIB ignored since FORCE_MPI_ENV not set***)
endif
ifdef MPI_INCLUDE
$(info ***warning MPI_INCLUDE ignored since FORCE_MPI_ENV not set***)
endif
endif
endif
# check if mpif90 is present
MPIF90YN = $(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_include)
ifeq ($(MPIF90YN),mpif90notfound)
errormpif90:
$(info )
$(info mpif90 not found. Please add its location to PATH)
$(info e.g. export PATH=/usr/local/bin:/usr/lib64/openmpi/bin:...)
$(info )
$(error )
endif
NWMPI_INCLUDE = $(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_include)
NWMPI_LIB = $(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_lib)
NWLIBMPI = $(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --libmpi)
endif
ifdef NWMPI_INCLUDE
LIB_INCLUDES += $(patsubst -I-I%,-I%,-I$(NWMPI_INCLUDE))
endif
ifdef NWMPI_LIB
CORE_LIBS += $(patsubst -L-L%,-L%,-L$(NWMPI_LIB))
endif
ifdef OLD_GA
CORE_LIBS += -ltcgmsg-mpi $(NWLIBMPI)
else
CORE_LIBS += $(NWLIBMPI)
endif
else
errornousempi:
$(info )
$(info please set the env. variable USE_MPI)
$(info and provide a working MPI installation)
$(info )
$(error )
ifdef OLD_GA
CORE_LIBS += -ltcgmsg
else
CORE_LIBS +=
endif
endif
# FFTW3 library inclusion
ifdef USE_FFTW3
@ -3695,6 +3577,8 @@ endif
DEFINES += -DPLUMED_HASMPI
endif
#endif #SKIP_COMPILERS
#TBLITE
ifeq ("$(wildcard $(NWCHEM_TOP)/src/config/NWCHEM_CONFIG)","")
@ -3718,17 +3602,9 @@ ifdef USE_TBLITE
DEFINES += -DUSE_TBLITE
EXTRA_LIBS += -L$(NWCHEM_TOP)/src/libext/lib
ifdef TBLITE_MESON
TBLITE_MODS=$(NWCHEM_TOP)/src/libext/tblite/tblite/_build/libtblite.so.0.2.0.p
MCTC_MODS=$(NWCHEM_TOP)/src/libext/tblite/tblite/_build/subprojects/mctc-lib/libmctc-lib.a.p
EXTRA_LIBS += -ltblite
else
EXTRA_LIBS += -ltblite -ltoml-f -ldftd4 -lmulticharge -ls-dftd3 -lmctc-lib
TBLITE_MODS=$(NWCHEM_TOP)/src/libext/include/tblite
MCTC_MODS=$(sort $(dir $(wildcard $(NWCHEM_TOP)/src/libext/include/mctc-lib/*/)))
MCHR_MODS=$(sort $(dir $(wildcard $(NWCHEM_TOP)/src/libext/include/multicharge/*/)))
TOMLF_MODS=$(sort $(dir $(wildcard $(NWCHEM_TOP)/src/libext/include/toml-f/*/)))
DFTD3_MODS=$(sort $(dir $(wildcard $(NWCHEM_TOP)/src/libext/include/s-dftd3/*/)))
DFTD4_MODS=$(sort $(dir $(wildcard $(NWCHEM_TOP)/src/libext/include/dftd4/*/)))
endif
EXTRA_LIBS += $(LAPACK_LIB) $(BLASOPT)
endif
@ -3837,15 +3713,9 @@ else
CFLAGS += $(EXTRA_COPTIONS) $(EXTRA_CDEBUG)
endif
INCLUDES = -I. $(LIB_INCLUDES) -I$(INCDIR) $(INCPATH)
CPPFLAGS = $(INCLUDES) $(DEFINES) $(LIB_DEFINES)
LDFLAGS = $(LDOPTIONS) -L$(LIBDIR) $(LIBPATH)
LIBS = $(NW_MODULE_LIBS) $(CORE_LIBS)
# I think this will work everywhere, but it might have to become
# machine-dependent
MKDIR = mkdir
#extract defines to be used with linear algebra libraries
ifdef USE_INTERNALBLAS
DEFINES += -DBLAS_NOTHREADS
@ -3943,6 +3813,133 @@ ifeq ($(BLAS_SIZE),8)
LIB_DEFINES += -DUSE_INTEGER8
endif
endif #SKIP_COMPILERS
#the new GA uses ARMCI library
ifdef OLD_GA
CORE_LIBS += -larmci
else
ifeq ($(ARMCI_NETWORK),ARMCI)
ifdef EXTERNAL_ARMCI_PATH
CORE_LIBS += -L$(EXTERNAL_ARMCI_PATH)/lib -larmci
else
CORE_LIBS += -larmci
endif
else
CORE_LIBS +=
endif
endif
# MPI version requires tcgmsg-mpi library
ifdef USE_MPI
#ifeq ($(FC),$(findstring $(FC),mpifrt mpfort mpif77 mpxlf mpif90 ftn scorep-ftn))
ifeq ($(FC),$(findstring $(FC), ftn scorep-ftn))
NWLIBMPI =
NWMPI_INCLUDE =
NWMPI_LIB =
else ifdef BUILD_MPICH
NW_CORE_SUBDIRS += libext
PATH := $(NWCHEM_TOP)/src/libext/bin:$(PATH)
NWMPI_INCLUDE = $(shell PATH=$(NWCHEM_TOP)/src/libext/bin:$(PATH) $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_include)
NWMPI_LIB = $(shell PATH=$(NWCHEM_TOP)/src/libext/bin:$(PATH) $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_lib)
NWLIBMPI = $(shell PATH=$(NWCHEM_TOP)/src/libext/bin:$(PATH) $(NWCHEM_TOP)/src/tools/guess-mpidefs --libmpi)
NWLIBMPI += $(shell pkg-config --libs-only-L hwloc 2> /dev/null)
ifeq ($(NWCHEM_TARGET),MACX64)
GOT_BREW = $(shell command -v brew 2> /dev/null)
ifdef GOT_BREW
NWLIBMPI += -L$(shell brew --prefix)/lib
endif
endif
else ifdef FORCE_MPI_ENV
ifndef MPI_INCLUDE
errormpi1:
$(info )
$(info FORCE_MPI_ENV set but MPI_INCLUDE not set)
$(info )
$(error )
else
NWMPI_INCLUDE = $(MPI_INCLUDE)
endif
ifndef MPI_LIB
errormpi2:
$(info )
$(info FORCE_MPI_ENV set but MPI_LIB not set)
$(info )
$(error )
else
NWMPI_LIB = $(MPI_LIB)
endif
ifndef LIBMPI
errormpi3:
$(info )
$(info FORCE_MPI_ENV set but LIBMPI not set)
$(info )
$(error )
else
NWLIBMPI = $(LIBMPI)
endif
else
ifeq ($(shell pwd), $(NWCHEM_TOP)/src)
ifndef FORCE_MPI_ENV
ifdef LIBMPI
$(info ***warning LIBMPI ignored since FORCE_MPI_ENV not set***)
endif
ifdef MPI_LIB
$(info ***warning MPI_LIB ignored since FORCE_MPI_ENV not set***)
endif
ifdef MPI_INCLUDE
$(info ***warning MPI_INCLUDE ignored since FORCE_MPI_ENV not set***)
endif
endif
endif
# check if mpif90 is present
MPIF90YN = $(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_include)
ifeq ($(MPIF90YN),mpif90notfound)
errormpif90:
$(info )
$(info mpif90 not found. Please add its location to PATH)
$(info e.g. export PATH=/usr/local/bin:/usr/lib64/openmpi/bin:...)
$(info )
$(error )
endif
NWMPI_INCLUDE = $(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_include)
NWMPI_LIB = $(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_lib)
NWLIBMPI = $(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --libmpi)
endif
ifdef NWMPI_INCLUDE
LIB_INCLUDES += $(patsubst -I-I%,-I%,-I$(NWMPI_INCLUDE))
endif
ifdef NWMPI_LIB
CORE_LIBS += $(patsubst -L-L%,-L%,-L$(NWMPI_LIB))
endif
ifdef OLD_GA
CORE_LIBS += -ltcgmsg-mpi $(NWLIBMPI)
else
CORE_LIBS += $(NWLIBMPI)
endif
else
ifneq ($(MAKECMDGOALS),$(findstring $(MAKECMDGOALS), clean realclean distclean dependencies include_stamp deps_stamp directories $(BINDIR)/depend.x))
errornousempi:
$(info )
$(info MAKECMDGOALS $(MAKECMDGOALS))
$(info please set the env. variable USE_MPI)
$(info and provide a working MPI installation)
$(info )
$(error )
ifdef OLD_GA
CORE_LIBS += -ltcgmsg
else
CORE_LIBS +=
endif
endif
endif
INCLUDES = -I. $(LIB_INCLUDES) -I$(INCDIR) $(INCPATH)
CPPFLAGS = $(INCLUDES) $(DEFINES) $(LIB_DEFINES)
LDFLAGS = $(LDOPTIONS) -L$(LIBDIR) $(LIBPATH)
LIBS = $(NW_MODULE_LIBS) $(CORE_LIBS)
#
# Define known suffixes mostly so that .p files don\'t cause pc to be invoked
#
@ -4074,5 +4071,4 @@ else
.f.o:; flint $(CPPFLAGS) -g -f -u $(SRCDIR)/nwchem.lbt $<
endif
endif

View file

@ -763,7 +763,7 @@ clean:
@test -e $(BUILDDIR)/Makefile && { cd $(BUILDDIR) && $(MAKE) clean; } || echo "Not configured"
realclean:
@rm -rf $(BUILDDIR) $(INSTALLDIR)
@rm -rf $(BUILDDIR) $(INSTALLDIR) *amp
# remove all files that are not .o objects (eg lib*.a) from libga.a
cleanlibga:
mkdir -p ob

View file

@ -2,6 +2,21 @@ ifndef USE_TBLITE
$(error USE_TBLITE must be set in order to use xTB methods)
endif
ifdef USE_TBLITE
DEFINES += -DUSE_TBLITE
ifdef TBLITE_MESON
TBLITE_MODS=$(NWCHEM_TOP)/src/libext/tblite/tblite/_build/libtblite.so.0.2.0.p
MCTC_MODS=$(NWCHEM_TOP)/src/libext/tblite/tblite/_build/subprojects/mctc-lib/libmctc-lib.a.p
else
TBLITE_MODS=$(NWCHEM_TOP)/src/libext/include/tblite
MCTC_MODS=$(sort $(dir $(wildcard $(NWCHEM_TOP)/src/libext/include/mctc-lib/*/)))
MCHR_MODS=$(sort $(dir $(wildcard $(NWCHEM_TOP)/src/libext/include/multicharge/*/)))
TOMLF_MODS=$(sort $(dir $(wildcard $(NWCHEM_TOP)/src/libext/include/toml-f/*/)))
DFTD3_MODS=$(sort $(dir $(wildcard $(NWCHEM_TOP)/src/libext/include/s-dftd3/*/)))
DFTD4_MODS=$(sort $(dir $(wildcard $(NWCHEM_TOP)/src/libext/include/dftd4/*/)))
endif
endif
OBJ = xtb_energy.o xtb_input.o xtb_energy_gradient.o \
xtb_rdinput.o xtb_guess.o xtb_spinpol.o xtb_print_param.o \
xtb_restart_read.o xtb_restart_write.o

View file

@ -175,7 +175,7 @@ if [[ "$os" == "Linux" ]]; then
fi
echo pkg to install: gfortran python3-dev make perl python3 rsync $mpi_libdev $mpi_bin $pkg_extra
tries=0 ; until [ "$tries" -ge 10 ] ; do \
$MYSUDO apt-get -y install gfortran python3-dev make perl python3 rsync $mpi_libdev $mpi_bin $pkg_extra \
$MYSUDO apt-get -y install gfortran python3-dev python-dev-is-python3 make perl python3 rsync $mpi_libdev $mpi_bin $pkg_extra \
&& break ;\
tries=$((tries+1)) ; echo attempt no. $tries ; sleep 30 ; done

View file

@ -106,77 +106,30 @@ fi
#compilation
if [[ "$os" == "Darwin" ]]; then
# if [[ "$NWCHEM_MODULES" == "tce" ]]; then
# FOPT="-O1 -fno-aggressive-loop-optimizations"
# fi
if [[ ! -z "$USE_SIMINT" ]] ; then
SIMINT_BUILD_TYPE=Debug
if [[ "$arch" != "x86_64" ]]; then
SIMINT_VECTOR=scalar
fi
echo SIMINT_VECTOR is $SIMINT_VECTOR
# export PATH="/usr/local/bin:$PATH"
# export LDFLAGS="-L/usr/local/opt/python@3.7/lib:$LDFLAGS"
fi
if [[ -z "$TRAVIS_HOME" ]]; then
env
mkdir -p ../bin/MACX64
gcc -o ../bin/MACX64/depend.x config/depend.c
make nwchem_config
cd libext && make V=-1 && cd ..
cd tools && make V=-1 && cd ..
make USE_INTERNALBLAS=y deps_stamp >& deps.log
grep -i hess deps.log
echo tail deps.log '@@@'
tail -10 deps.log
echo done tail deps.log '@@@'
export QUICK_BUILD=1
if [[ -z "$FOPT" ]]; then
make V=0 -j3
else
make V=0 FOPTIMIZE="$FOPT" -j3
fi
else
../travis/sleep_loop.sh make V=1 FOPTIMIZE="$FOPT" -j3
fi
unset QUICK_BUILD
cd $TRAVIS_BUILD_DIR/src/64to32blas
make
cd $TRAVIS_BUILD_DIR/src
../contrib/getmem.nwchem 1000
otool -L ../bin/MACX64/nwchem
# printenv DYLD_LIBRARY_PATH
# ls -lrt $DYLD_LIBRARY_PATH
# tail -120 make.log
elif [[ "$os" == "Linux" ]]; then
export MAKEFLAGS=-j3
echo "$FOPT$FDOPT"
if [[ -z "$TRAVIS_HOME" ]]; then
mkdir -p ../bin/LINUX64
gcc -o ../bin/LINUX64/depend.x config/depend.c
export MAKEFLAGS=-j3
echo "$FOPT$FDOPT"
mkdir -p ../bin/$NWCHEM_TARGET
gcc -o ../bin/$NWCHEM_TARGET/depend.x config/depend.c
make nwchem_config
cd libext && make V=-1 && cd ..
cd tools && make V=-1 && cd ..
make USE_INTERNALBLAS=y deps_stamp >& deps.log
make SKIP_COMPILERS=1 deps_stamp >& deps.log
echo tail deps.log '11@@@'
tail -10 deps.log
echo done tail deps.log '11@@@'
cd 64to32blas && make SKIP_COMPILERS=1 dependencies include_stamp && cd ..
make directories
export QUICK_BUILD=1
if [[ -z "$FOPT" ]]; then
make V=0 -j3
else
make V=0 FOPTIMIZE="$FOPT" -j3
fi
else
../travis/sleep_loop.sh make V=1 FOPTIMIZE="$FOPT" -j3
fi
unset QUICK_BUILD
cd $TRAVIS_BUILD_DIR/src/64to32blas
make
cd $TRAVIS_BUILD_DIR/src
$TRAVIS_BUILD_DIR/contrib/getmem.nwchem 1000
fi
#caching
mkdir -p $TRAVIS_BUILD_DIR/.cachedir/binaries/$NWCHEM_TARGET $TRAVIS_BUILD_DIR/.cachedir/files
cp $TRAVIS_BUILD_DIR/bin/$NWCHEM_TARGET/nwchem $NWCHEM_EXECUTABLE