Merge branch 'nosolver' into 'develop'

Compilation with make for MBD simplified

See merge request QEF/q-e!1751
This commit is contained in:
Ye Luo 2022-02-05 20:04:05 +00:00
commit 75b0e51aaf
6 changed files with 54 additions and 15 deletions

View File

@ -1,5 +0,0 @@
Archive contains the tarballs of external libraries and codes used by "make"
to build QE. Note that "CMake" stores such packages in external/ instead.
In the future, these files should be removed or replaced as follows:
- libmbd-0.10.3-non-cmake-makefiles.tar.gz (patches for libmbd-0.10.3.tar.gz to add non-cmake support)

49
external/mbd.make vendored Normal file
View File

@ -0,0 +1,49 @@
.SUFFIXES : .o .f90 .F90
%.o: %.f90
$(FXX) $(FXXOPT) -c $<
%.o: %.F90
$(FXX) $(FXXOPT) -c $<
OBJS := mbd.o mbd_c_api.o mbd_constants.o mbd_coulomb.o mbd_damping.o mbd_dipole.o mbd_formulas.o mbd_geom.o mbd_gradients.o mbd_hamiltonian.o mbd_lapack.o mbd_linalg.o mbd_matrix.o mbd_methods.o mbd_rpa.o mbd_scs.o mbd_ts.o mbd_utils.o mbd_vdw_param.o
ifeq ($(LIBMBD_C_API),0)
OBJS := $(filter-out mbd_c_api.o,$(OBJS))
endif
libmbd.a: $(OBJS)
ar -r $@ $^
mbd.o: mbd_constants.o mbd_damping.o mbd_formulas.o mbd_geom.o mbd_gradients.o mbd_methods.o mbd_ts.o mbd_utils.o mbd_vdw_param.o fallback_version
mbd_c_api.o: mbd_constants.o mbd_coulomb.o mbd_damping.o mbd_dipole.o mbd_geom.o mbd_gradients.o mbd_matrix.o mbd_methods.o mbd_ts.o mbd_utils.o
mbd_constants.o:
mbd_coulomb.o: mbd_constants.o mbd_damping.o mbd_dipole.o mbd_geom.o mbd_lapack.o mbd_linalg.o mbd_matrix.o
mbd_damping.o: mbd_constants.o mbd_gradients.o mbd_utils.o
mbd_dipole.o: mbd_constants.o mbd_damping.o mbd_geom.o mbd_gradients.o mbd_lapack.o mbd_linalg.o mbd_matrix.o mbd_utils.o
mbd_formulas.o: mbd_constants.o mbd_gradients.o mbd_utils.o
mbd_geom.o: mbd_constants.o mbd_lapack.o mbd_utils.o mbd_vdw_param.o
mbd_gradients.o: mbd_constants.o
mbd_hamiltonian.o: mbd_constants.o mbd_damping.o mbd_dipole.o mbd_geom.o mbd_gradients.o mbd_matrix.o mbd_utils.o
mbd_lapack.o: mbd_constants.o mbd_utils.o
mbd_linalg.o: mbd_constants.o
mbd_matrix.o: mbd_constants.o mbd_lapack.o mbd_utils.o
mbd_methods.o: mbd_constants.o mbd_damping.o mbd_formulas.o mbd_geom.o mbd_gradients.o mbd_hamiltonian.o mbd_lapack.o mbd_rpa.o mbd_scs.o mbd_utils.o
mbd_rpa.o: mbd_constants.o mbd_damping.o mbd_dipole.o mbd_formulas.o mbd_geom.o mbd_matrix.o mbd_utils.o
mbd_scs.o: mbd_constants.o mbd_damping.o mbd_dipole.o mbd_formulas.o mbd_geom.o mbd_gradients.o mbd_matrix.o mbd_utils.o
mbd_ts.o: mbd_constants.o mbd_damping.o mbd_geom.o mbd_utils.o
mbd_utils.o: mbd_constants.o mbd_gradients.o
mbd_vdw_param.o: mbd_constants.o mbd_utils.o
fallback_version:
echo '#define MBD_VERSION_MAJOR 0' > version.h
echo '#define MBD_VERSION_MINOR 10'>> version.h
echo '#define MBD_VERSION_PATCH 0' >> version.h
echo '#define MBD_VERSION "0.10.0"' >> version.h
.PHONY: clean distclean
clean:
rm -f *.o
distclean: clean
rm -f *.mod
rm -f $(LIB)

2
install/configure vendored
View File

@ -4347,8 +4347,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
then then
# CUDA toolkit v < 10.1: cusolver not available # CUDA toolkit v < 10.1: cusolver not available
as_fn_error $? "Unsupported CUDA Toolkit, too old" "$LINENO" 5 as_fn_error $? "Unsupported CUDA Toolkit, too old" "$LINENO" 5
else
try_dflags="$try_dflags -D__USE_CUSOLVER"
fi fi
# ----------------------------------------- # -----------------------------------------
# C flags # C flags

View File

@ -99,20 +99,19 @@ libmbd:
$(call update_submodule,external,mbd) $(call update_submodule,external,mbd)
if test ! -d ../MBD; then \ if test ! -d ../MBD; then \
mkdir ../MBD; \ mkdir ../MBD; \
cd $(TOPDIR)/external/mbd; \ cd $(TOPDIR)/external/mbd/src; \
tar -xzvf $(TOPDIR)/archive/libmbd-0.10.3-non-cmake-makefiles.tar.gz --strip-components=1; \ export FXX=$(F90); export FXXOPT="$(F90FLAGS)"; \
cd src; export FXX=$(F90); export FXXOPT="$(F90FLAGS)"; \ $(MAKE) -f ../../mbd.make; cp *.mod *.a $(TOPDIR)/MBD; cd ../../.. ;fi
cp serial.make Makefile; $(MAKE) ; cp *.mod *.a $(TOPDIR)/MBD; cd ../../.. ;fi
libmbd_clean: libmbd_clean:
if test -d ../MBD; then (rm -R -f ../MBD); fi if test -d ../MBD; then (rm -R -f ../MBD); fi
if test -d $(TOPDIR)/external/mbd/src; then cd $(TOPDIR)/external/mbd/src; \ if test -d $(TOPDIR)/external/mbd/src; then cd $(TOPDIR)/external/mbd/src; \
(if test -f ./serial.make; then $(MAKE) clean; fi); fi $(MAKE) -f ../../mbd.make clean; fi
libmbd_distclean: libmbd_distclean:
if test -d ../MBD; then (rm -R -f ../MBD); fi if test -d ../MBD; then (rm -R -f ../MBD); fi
if test -d $(TOPDIR)/external/mbd/src; then cd $(TOPDIR)/external/mbd/src; \ if test -d $(TOPDIR)/external/mbd/src; then cd $(TOPDIR)/external/mbd/src; \
(if test -f ./serial.make; then $(MAKE) distclean; fi); fi $(MAKE) -f ../../mbd.make distclean; fi
################################### ###################################
# cleaning # cleaning

View File

@ -106,8 +106,6 @@ then
then then
# CUDA toolkit v < 10.1: cusolver not available # CUDA toolkit v < 10.1: cusolver not available
AC_MSG_ERROR([Unsupported CUDA Toolkit, too old]) AC_MSG_ERROR([Unsupported CUDA Toolkit, too old])
else
try_dflags="$try_dflags -D__USE_CUSOLVER"
fi fi
# ----------------------------------------- # -----------------------------------------
# C flags # C flags