diff --git a/src/config/makefile.h b/src/config/makefile.h index b27d3812c5..191ea8ebbd 100644 --- a/src/config/makefile.h +++ b/src/config/makefile.h @@ -2145,6 +2145,7 @@ ifneq ($(TARGET),LINUX) GOTCLANG= $(shell $(_CC) -dM -E - /dev/null |grep __clang__|head -1|cut -c19) ifeq ($(GOTCLANG),1) COPTIONS += -fPIC + COPTIONS += -Wno-deprecated-non-prototype endif GOTFREEBSD= $(shell uname -o 2>&1|awk ' /FreeBSD/ {print "1";exit}') @@ -2772,7 +2773,10 @@ ifneq ($(TARGET),LINUX) ifeq ($(_FC),crayftn) # Jeff: Cray Fortran supports preprocessing as of version 8.2.2 (at least) # EXPLICITF = FALSE - FOPTIONS += -hsystem_alloc -hoverindex + FOPTIONS += -hoverindex + FOPTIONS += -dC # fix rt-tddft hacking for derived types + FOPTIONS += -ef # create f90 .mod + LDOPTIONS += -hsystem_alloc # workaround for vectorization failures with cce 11 FOPTIONS += -hfp1 ifdef BUILD_OPENBLAS diff --git a/src/libext/openblas/build_openblas.sh b/src/libext/openblas/build_openblas.sh index dc92319a8f..c8fcb3faaf 100755 --- a/src/libext/openblas/build_openblas.sh +++ b/src/libext/openblas/build_openblas.sh @@ -27,6 +27,7 @@ patch -p0 -s -N < ../makesys.patch # patch for pgi/nvfortran missing -march=armv8 patch -p0 -s -N < ../arm64_fopt.patch patch -p1 -s -N < ../9402df5604e69f86f58953e3883f33f98c930baf.patch +patch -p0 -s -N < ../crayftn.patch if [[ -z "${FORCETARGET}" ]]; then FORCETARGET=" " UNAME_S=$(uname -s) @@ -111,20 +112,21 @@ if [[ ${FC} == ftn ]]; then # echo ' ' # echo 'openblas installation not ready for crayftn ' # echo ' ' - if ! [ -x "$(command -v gfortran)" ]; then - echo " please load the gcc module (not prgenv)" - echo " by executing" - echo " module load gcc " - echo " " - exit 1 - fi - FC=gfortran - CCORG=${CC} - CC=clang - export PATH=/opt/cray/pe/cce/default/cce-clang/x86_64/bin:$PATH - FORCETARGET+=' FC=gfortran CC=clang ' +# if ! [ -x "$(command -v gfortran)" ]; then +# echo " please load the gcc module (not prgenv)" +# echo " by executing" +# echo " module load gcc " +# echo " " +# exit 1 +# fi +# FC=gfortran +# CCORG=${CC} +# CC=clang +# export PATH=/opt/cray/pe/cce/default/cce-clang/x86_64/bin:$PATH +# FORCETARGET+=' FC=gfortran CC=clang ' # exit 1 -# exit 1 + # exit 1 + _FC=crayftn fi fi if [[ -n ${FC} ]] && [[ ${FC} == xlf ]] || [[ ${FC} == xlf_r ]] || [[ ${FC} == xlf90 ]]|| [[ ${FC} == xlf90_r ]]; then @@ -134,6 +136,9 @@ if [[ -n ${FC} ]] && [[ ${FC} == xlf ]] || [[ ${FC} == xlf_r ]] || [[ ${FC} == elif [[ -n ${FC} ]] && [[ "${FC}" == "flang" ]] || [[ "${FC}" == "amdflang" ]]; then FORCETARGET+=' F_COMPILER=FLANG ' LAPACK_FPFLAGS_VAL=" -O1 -g -Kieee" +elif [[ "${_FC}" == "crayftn" ]] ; then +# FORCETARGET+=' F_COMPILER=FLANG ' + LAPACK_FPFLAGS_VAL=" -s integer64 -ef " elif [[ -n ${FC} ]] && [[ "${FC}" == "pgf90" ]] || [[ "${FC}" == "nvfortran" ]]; then FORCETARGET+=' F_COMPILER=PGI ' if [[ "${FC}" == "nvfortran" ]]; then @@ -222,7 +227,7 @@ if [[ ! -z "${USE_OPENMP}" ]]; then fi GOTFREEBSD=$(uname -o 2>&1|awk ' /FreeBSD/ {print "1";exit}') MYMAKE=make -MAKEJ=" -j4" +MAKEJ=" -j3 " if [[ "${GOTFREEBSD}" == 1 ]]; then MAKEJ=" " MYMAKE=gmake @@ -240,7 +245,9 @@ else $MYMAKE FC=$FC CC=$CC HOSTCC=gcc $FORCETARGET LAPACK_FPFLAGS="$LAPACK_FPFLAGS_VAL" INTERFACE64="$sixty4_int" BINARY="$binary" NUM_THREADS=128 NO_CBLAS=1 NO_LAPACKE=1 DEBUG=0 USE_THREAD="$THREADOPT" libs netlib $MAKEJ >& openblas.log fi if [[ "$?" != "0" ]]; then - tail -500 openblas.log + echo error code '$?' + ls -l openblas.log + tail -n 500 openblas.log echo " " echo "OpenBLAS compilation failed" echo " " @@ -248,6 +255,9 @@ if [[ "$?" != "0" ]]; then fi mkdir -p ../../lib +if [[ "${_FC}" == "crayftn" ]] ; then + cd lapack-netlib/SRC; ar rUv ../../libopenblas*-*.a la_constants.o ;cd ../.. +fi if [[ $(uname -s) == "Linux" ]]; then if [ -x "$(command -v xx-info)" ]; then MYSTRIP=$(xx-info)-strip diff --git a/src/libext/openblas/crayftn.patch b/src/libext/openblas/crayftn.patch new file mode 100644 index 0000000000..9422ed7df7 --- /dev/null +++ b/src/libext/openblas/crayftn.patch @@ -0,0 +1,10 @@ +--- Makefile.system.org 2023-07-26 19:26:30.000000000 -0700 ++++ Makefile.system 2023-07-26 19:26:54.000000000 -0700 +@@ -1323,6 +1323,7 @@ + ifeq ($(F_COMPILER), CRAY) + CCOMMON_OPT += -DF_INTERFACE_INTEL + FCOMMON_OPT += -hnopattern ++FCOMMON_OPT += -ef + ifdef INTERFACE64 + ifneq ($(INTERFACE64), 0) + FCOMMON_OPT += -s integer64 diff --git a/src/mp2_grad/mp2_make_dip_mom.F b/src/mp2_grad/mp2_make_dip_mom.F index 687553b3f0..fcc96e9298 100644 --- a/src/mp2_grad/mp2_make_dip_mom.F +++ b/src/mp2_grad/mp2_make_dip_mom.F @@ -22,7 +22,7 @@ c double precision mp2y, scfy double precision mp2z, scfz double precision ndip(3) - logical ga_create_atom_blocked + integer ga_create_atom_blocked external ga_create_atom_blocked integer geom c diff --git a/src/nwchem.F b/src/nwchem.F index 6512a199d6..20b2ae6740 100644 --- a/src/nwchem.F +++ b/src/nwchem.F @@ -665,11 +665,11 @@ c & cstatus, & fstatus 3 format(/ - $ ' heap = ', i10,' doubles',' = ',f8.1,' Mbytes',/, - $ ' stack = ', i10,' doubles',' = ',f8.1,' Mbytes',/, - $ ' global = ', i10,' doubles',' = ',f8.1,' Mbytes', + $ ' heap = ', i12,' doubles',' = ',f10.1,' Mbytes',/, + $ ' stack = ', i12,' doubles',' = ',f10.1,' Mbytes',/, + $ ' global = ', i12,' doubles',' = ',f10.1,' Mbytes', & ' ',A,/, - $ ' total = ', i10,' doubles',' = ',f8.1,' Mbytes',/, + $ ' total = ', i12,' doubles',' = ',f10.1,' Mbytes',/, $ ' verify = ', a3,/, $ ' hardfail = ', a3,//) c diff --git a/src/nwdft/grid/grid_quadv0.F b/src/nwdft/grid/grid_quadv0.F index 6632e960c1..bb9700f93e 100644 --- a/src/nwdft/grid/grid_quadv0.F +++ b/src/nwdft/grid/grid_quadv0.F @@ -464,7 +464,7 @@ c DM in last position is the scf DM enddo elseif (adft) then call adft_reduce(nbf_xc, nctrs, int_mb(icetobfr), tmat, ipol, - & dbl_mb(irdens_atom), nbf_xc_mxnbf_ce) + & dbl_mb(irdens_atom)) else call util_ga_mat_reduce(nbf_ao, nctrs, int_mb(icetobfr), g_dens, & ipol, dbl_mb(irdens_atom), 'absmax', @@ -1044,25 +1044,3 @@ c return end - subroutine adft_reduce(nbf, nat, cetobfr, coef, ipol, rdens_atom) - implicit none - integer nbf, nat, ipol, mxnbf - integer cetobfr(2,nat) - double precision rdens_atom(nat,nat,ipol),coef(nbf,ipol) - double precision dabsmax - external dabsmax - - integer iat,istart,iend - - rdens_atom(:,:,:) = 0d0 - - do iat=1,nat - istart = cetobfr(1,iat) - iend = cetobfr(2,iat) - rdens_atom(1,iat,1) = dabsmax(iend-istart+1,coef(istart,1)) - if (ipol.gt.1) then - rdens_atom(1,iat,2) = dabsmax(iend-istart+1,coef(istart,2)) - endif - enddo - - end diff --git a/src/nwdft/util/dft_utilmap.F b/src/nwdft/util/dft_utilmap.F index d17d9d01c2..d45fc17ef8 100644 --- a/src/nwdft/util/dft_utilmap.F +++ b/src/nwdft/util/dft_utilmap.F @@ -327,5 +327,27 @@ c enddo return end + subroutine adft_reduce(nbf, nat, cetobfr, coef, ipol, rdens_atom) + implicit none + integer nbf, nat, ipol, mxnbf + integer cetobfr(2,nat) + double precision rdens_atom(nat,nat,ipol),coef(nbf,ipol) + double precision dabsmax + external dabsmax + + integer iat,istart,iend + + rdens_atom(:,:,:) = 0d0 + + do iat=1,nat + istart = cetobfr(1,iat) + iend = cetobfr(2,iat) + rdens_atom(1,iat,1) = dabsmax(iend-istart+1,coef(istart,1)) + if (ipol.gt.1) then + rdens_atom(1,iat,2) = dabsmax(iend-istart+1,coef(istart,2)) + endif + enddo + + end C> C> @}