Skip to content

Commit 060f945

Browse files
authored
Merge pull request #893 from edoapra/flaccid-fraction
compilation updates
2 parents d1110a5 + 39afa0f commit 060f945

File tree

10 files changed

+53
-39
lines changed

10 files changed

+53
-39
lines changed

src/ccsd/ccsd_trpdrv.F

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,15 @@ subroutine ccsd_getdjka(djka,
361361
integer av,klo,khi,j
362362
c
363363
integer k,l_kk,k_kk,lenk,start,end,iptr,i,startc
364+
double precision mem_avail
364365
logical failed
365366
c
366367
start = 1 + (j-1)*nvir + (klo-1)*lnov
367368
end = (j-1)*nvir + (khi)*lnov
368369
lenk=end-start+1
369-
lenk=min(lenk,(ma_inquire_avail(MT_DBL)*66)/100)
370+
c protect from integer overflowing on 32bit archs
371+
mem_avail=0.66d0*dble(ma_inquire_avail(MT_DBL))
372+
lenk=min(lenk,int(mem_avail))
370373
crestrict to 5M to avoid OOMs
371374
lenk=min(lenk,5000000)
372375
1 continue

src/config/makefile.h

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
23
# $Id$
34
#
45

@@ -1321,8 +1322,7 @@ ifeq ($(TARGET),MACX64)
13211322
USE_FLANG=1
13221323
endif
13231324
ifeq ($(USE_FLANG),1)
1324-
FLANG_VERSION=$(shell $(FC) --version |head -1 | sed 's/^.*\(version\)//'|cut -d . -f 1)
1325-
FLANG_LT_16 = $(shell [ $(FLANG_VERSION) -lt 16 ] && echo true || echo false)
1325+
FLANG_NEW = $(shell [ $(shell $(FC) --help |head -1| cut -d " " -f 2 ) == flang ] && echo true || echo false)
13261326
endif
13271327

13281328
ifeq ($(_FC),gfortran)
@@ -1344,8 +1344,7 @@ ifeq ($(TARGET),MACX64)
13441344
ifeq ($(USE_FLANG),1)
13451345
GNU_GE_4_6=true
13461346
FOPTIONS+=-fno-backslash
1347-
DEFINES += -D__FLANG
1348-
ifeq ($(FLANG_LT_16),false)
1347+
ifeq ($(FLANG_NEW),true)
13491348
# FOPTIONS+=-fstack-arrays
13501349
endif
13511350
else
@@ -2098,13 +2097,11 @@ ifneq ($(TARGET),LINUX)
20982097
endif
20992098

21002099
ifeq ($(USE_FLANG),1)
2101-
FLANG_VERSION=$(shell $(FC) --version |head -1 | sed 's/^.*\(version\)//'|cut -d . -f 1)
2102-
FLANG_LT_16 = $(shell [ $(FLANG_VERSION) -lt 16 ] && echo true || echo false)
2100+
FLANG_NEW = $(shell [ $(shell $(FC) --help |head -1| cut -d " " -f 2 ) == flang ] && echo true || echo false)
21032101
endif
21042102

21052103
#@info
2106-
#@info flv $(FLANG_VERSION)
2107-
#@info FLANG_LT_16 $(FLANG_LT_16)
2104+
#@info FLANG_NEW $(FLANG_NEW)
21082105
#@info
21092106

21102107
ifeq ($(CC),clang)
@@ -2155,23 +2152,18 @@ ifneq ($(TARGET),LINUX)
21552152

21562153
FOPTIMIZE = -O2
21572154

2158-
ifeq ($(_CPU),aarch64)
2155+
ifeq ($(_CPU),$(findstring $(_CPU),aarch64 mips64 loongarch64 riscv64 alpha ia64 hppa))
21592156
DONTHAVEM64OPT=Y
21602157
endif
21612158

21622159
ifeq ($(_CPU),mips64)
2163-
DONTHAVEM64OPT=Y
21642160
COPTIONS = -mabi=64
21652161
FOPTIONS = -mabi=64
21662162
FFLAGS_FORGA = -mabi=64
21672163
CFLAGS_FORGA = -mabi=64
21682164
endif
21692165

2170-
ifeq ($(_CPU),loongarch64)
2171-
DONTHAVEM64OPT=Y
2172-
endif
21732166
ifeq ($(_CPU),riscv64)
2174-
DONTHAVEM64OPT=Y
21752167
COPTIONS = -march=rv64gc -mabi=lp64d
21762168
FOPTIONS = -march=rv64gc -mabi=lp64d
21772169
FFLAGS_FORGA = -march=rv64gc -mabi=lp64d
@@ -2220,7 +2212,7 @@ ifneq ($(TARGET),LINUX)
22202212
FOPTIONS += -ffast-math #-Wunused
22212213
endif
22222214
ifeq ($(V),-1)
2223-
ifeq ($(FLANG_LT_16),true)
2215+
ifeq ($(FLANG_NEW),false)
22242216
FOPTIONS += -w
22252217
endif
22262218
COPTIONS += -w
@@ -2246,13 +2238,11 @@ ifneq ($(TARGET),LINUX)
22462238

22472239
GNU_GE_4_6=true
22482240
FOPTIONS+=-fno-backslash
2249-
ifeq ($(FLANG_LT_16),true)
2241+
ifeq ($(FLANG_NEW),false)
22502242
FOPTIONS+=-mcmodel=medium
22512243
COPTIONS+=-mcmodel=medium
22522244
CFLAGS_FORGA = -mcmodel=medium
22532245
FFLAGS_FORGA = -mcmodel=medium
2254-
else
2255-
DEFINES += -D__FLANG
22562246
endif
22572247
else
22582248
GNUMAJOR=$(shell $(FC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC__ |cut -c18-)

src/geom/GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
include ../config/makefile.h
1616
include ../config/makelib.h
1717

18-
ifeq ($(FLANG_LT_16),false)
18+
ifeq ($(FLANG_NEW),true)
1919
FOPTIONS += -fno-automatic
2020
endif
2121
ifeq ($(_FC),pgf90)

src/inp/inp.F

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ block data inp_data
1515
data errmsg /' '/
1616
data input_line /0/
1717
data xblnk /' '/
18-
#if defined(CRAY) || defined(HPUX) || defined(WIN32) || defined(PSCALE) || defined(__FLANG) || ( __GNUC__ >= 4) || defined(FUJITSU)
18+
#if defined(CRAY) || defined(HPUX) || defined(WIN32) || defined(PSCALE) || defined(__FLANG) || defined(__flang__) || ( __GNUC__ >= 4) || defined(FUJITSU)
1919
data xtab /' '/ ! Tab ... no backslash necessary
2020
#elif (defined(LINUX) || defined(MACX)) && !defined(PGLINUX) && !defined(XLFLINUX) &&!( __GNUC__ >= 4)
2121
data xtab /9/ ! Tab ... g77 has trouble with escape sequence

src/libext/openblas/build_openblas.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,7 @@ elif [[ -n ${FC} ]] && [[ $(../../../config/strip_compiler.sh "${FC}") == "flan
152152
if [[ ${BLAS_SIZE} == 8 ]]; then
153153
LAPACK_FPFLAGS_VAL+=" -fdefault-integer-8"
154154
fi
155-
FLANG_VERSION=$(${FC} --version |head -1 | sed 's/^.*\(version\)//'|cut -d . -f 1)
156-
if [[ ${FLANG_VERSION} -lt 17 ]]; then
157-
FLANG_GE_17="false"
158-
else
159-
FLANG_GE_17="true"
160-
fi
155+
FLANG_NEW=$( [ $( ${FC} --help |head -1| cut -d " " -f 2 ) == flang ] && echo true || echo false)
161156
elif [[ "${_FC}" == "crayftn" ]] ; then
162157
# FORCETARGET+=' F_COMPILER=FLANG '
163158
LAPACK_FPFLAGS_VAL=" -s integer64 -ef "
@@ -260,7 +255,9 @@ echo output redirected to libext/openblas/OpenBLAS/openblas.log
260255
echo
261256
if [[ ${_FC} == xlf ]]; then
262257
$MYMAKE FC="xlf -qextname" $FORCETARGET LAPACK_FPFLAGS="$LAPACK_FPFLAGS_VAL" INTERFACE64="$sixty4_int" BINARY="$binary" NUM_THREADS=$MYNTS NO_CBLAS=1 NO_LAPACKE=1 DEBUG=0 USE_THREAD="$THREADOPT" libs netlib $MAKEJ >& openblas.log
263-
elif [[ ${FLANG_GE_17} == "true" ]]; then
258+
elif [[ ${FLANG_NEW} == "true" ]]; then
259+
echo FLANG_NEW
260+
echo $MYMAKE FC=$FC CC=$CC HOSTCC=gcc $FORCETARGET FCOMMON_OPT="$LAPACK_FPFLAGS_VAL" 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
264261
$MYMAKE FC=$FC CC=$CC HOSTCC=gcc $FORCETARGET FCOMMON_OPT="$LAPACK_FPFLAGS_VAL" 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
265262
else
266263
$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

src/nwdft/scf_dft/dft_scf.F

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,8 @@ logical function dft_scf(rtdb, Etold, Enuc, iVcoul_opt, iVxc_opt,
893893
& .true.)
894894
c check if movecs read has failed
895895
if(movecs_in_org.ne.movecs_in) then
896-
if(ga_nodeid().eq.0) then
896+
if(ga_nodeid().eq.0.and.
897+
A util_print('movecs_info', print_high)) then
897898
write(luout,*) ' WARNING: movecs_in_org=',
898899
c movecs_in_org(1:inp_strlen(movecs_in_org)),
899900
c ' not equal to movecs_in=',

src/tools/autoconf_patch.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
rm -f autoconf.patch
3+
cat > autoconf.patch <<EOF
4+
--- $1/configure.org 2022-11-03 14:47:40.000000000 -0700
5+
+++ $1/configure 2023-10-20 15:36:29.516676155 -0700
6+
@@ -21699 +21698,0 @@
7+
- s/\/.*\/lib.*\.a//p ;
8+
@@ -21811 +21809,0 @@
9+
- s/\/.*\/lib.*\.a//p ;
10+
@@ -22145 +22142,0 @@
11+
- s/\/.*\/lib.*\.a//p ;
12+
@@ -22257 +22253,0 @@
13+
- s/\/.*\/lib.*\.a//p ;
14+
EOF
15+
patch -p0 -s -N < ./autoconf.patch
16+
echo autoconf.patch applied

src/tools/get-tools-github

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ if [[ -d "ga-5.8.2" ]]; then
206206
./peigstubs_patch.sh $GA_DIR
207207
./mpipr-too-many_patch.sh $GA_DIR
208208
./ga_ma_align_patch.sh $GA_DIR
209+
if [ $(uname -s) != "Darwin" ]; then
210+
./autoconf_patch.sh $GA_DIR
211+
fi
209212
echo patched
210213
touch ga-5.8.2/patched581
211214
fi

travis/build_env.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,23 +222,27 @@ if [[ "$os" == "Linux" ]]; then
222222
fi
223223
if [[ "$FC" == "flang" ]]; then
224224
if [[ "USE_AOMP" == "Y" ]]; then
225-
aomp_major=16
226-
aomp_minor=0-3
225+
aomp_major=18
226+
aomp_minor=0-0
227227
wget -nv https://github.com/ROCm-Developer-Tools/aomp/releases/download/rel_"$aomp_major"."$aomp_minor"/aomp_Ubuntu2004_"$aomp_major"."$aomp_minor"_amd64.deb
228228
$MYSUDO dpkg -i aomp_Ubuntu2004_"$aomp_major"."$aomp_minor"_amd64.deb
229229
export PATH=/usr/lib/aomp_"$aomp_major"."$aomp_minor"/bin/:$PATH
230230
export LD_LIBRARY_PATH=/usr/lib/aomp_"$aomp_major"."$aomp_minor"/lib:$LD_LIBRARY_PATH
231231
ls -lrt /usr/lib | grep aomp ||true
232232
else
233-
aocc_version=4.0.0
234-
aocc_dir=aocc-compiler-${aocc_version}
233+
aocc_major=4
234+
aocc_minor=1
235+
aocc_patch=0
236+
aocc_version=${aocc_major}.${aocc_minor}.${aocc_patch}
237+
aocc_dir=aocc-${aocc_major}-${aocc_minor}
238+
aocc_file=aocc-compiler-${aocc_version}
235239
# curl -sS -LJO https://developer.amd.com/wordpress/media/files/${aocc_dir}.tar
236240
tries=0 ; until [ "$tries" -ge 10 ] ; do \
237-
curl -sS -LJO https://download.amd.com/developer/eula/aocc-compiler/${aocc_dir}.tar \
241+
curl -sS -LJO https://download.amd.com/developer/eula/aocc/${aocc_dir}/${aocc_file}.tar \
238242
&& break ; \
239243
tries=$((tries+1)) ; echo attempt no. $tries ; sleep 30 ; done
240-
tar xf ${aocc_dir}.tar
241-
./${aocc_dir}/install.sh
244+
tar xf ${aocc_file}.tar
245+
./${aocc_file}/install.sh
242246
source setenv_AOCC.sh
243247
pwd
244248
fi
@@ -247,7 +251,7 @@ if [[ "$os" == "Linux" ]]; then
247251
fi
248252
if [[ "$FC" == "amdflang" ]]; then
249253
$MYSUDO apt-get install -y wget gnupg2 coreutils dialog tzdata
250-
rocm_version=5.4.3
254+
rocm_version=5.6.1
251255
tries=0 ; until [ "$tries" -ge 10 ] ; do \
252256
wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | $MYSUDO apt-key add - \
253257
&& break ; \

travis/nwchem.bashrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ echo NWCHEM_TOP is $NWCHEM_TOP
2525
export USE_MPI=y
2626
if [[ "$FC" == "flang" ]]; then
2727
if [[ "USE_AOMP" == "Y" ]]; then
28-
aomp_major=16
29-
aomp_minor=0-3
28+
aomp_major=18
29+
aomp_minor=0-0
3030
export PATH=/usr/lib/aomp_"$aomp_major"."$aomp_minor"/bin/:$PATH
3131
export LD_LIBRARY_PATH=/usr/lib/aomp_"$aomp_major"."$aomp_minor"/lib:$LD_LIBRARY_PATH
3232
else

0 commit comments

Comments
 (0)