flang-new-17 aka flang-17

This commit is contained in:
edoapra 2023-10-11 17:51:47 -07:00
parent 8c89904f80
commit 7f2006dc49
No known key found for this signature in database
GPG key ID: 48E12DA1EDE9E1B0
4 changed files with 38 additions and 10 deletions

View file

@ -365,6 +365,12 @@ jobs:
armci_network: MPI-TS
nwchem_modules: "nwdft driver solvation mp2_grad mcscf ccsd rimp2 fcidump nwc_columbus"
fc: ifx
- os: ubuntu-22.04
experimental: true
mpi_impl: mpich
armci_network: MPI-TS
nwchem_modules: "nwdft driver solvation"
fc: flang-new-17
fail-fast: false
env:
MPI_IMPL: ${{ matrix.mpi_impl }}

View file

@ -2184,7 +2184,9 @@ ifneq ($(TARGET),LINUX)
FOPTIONS += -w
COPTIONS += -w
else
FOPTIMIZE += -Wuninitialized
ifneq ($(USE_FLANG),1)
FOPTIMIZE += -Wuninitialized
endif
ifeq ($(_CC),$(findstring $(_CC),gcc clang))
COPTIONS += -Wall
endif
@ -2193,20 +2195,28 @@ ifneq ($(TARGET),LINUX)
FOPTIMIZE += -Wno-maybe-uninitialized
endif
else
FOPTIONS += -Wuninitialized
ifneq ($(USE_FLANG),1)
FOPTIONS += -Wuninitialized
endif
endif
endif
DEFINES += -DGFORTRAN
DEFINES += -DCHKUNDFLW -DGCC4
ifeq ($(USE_FLANG),1)
GNU_GE_4_6=true
FOPTIONS+=-mcmodel=medium
FOPTIONS+=-mcmodel=medium -fno-backslash
COPTIONS+=-mcmodel=medium
CFLAGS_FORGA = -mcmodel=medium
FFLAGS_FORGA = -mcmodel=medium
FOPTIONS+=-fno-backslash
FLANG_VERSION=$(shell $(FC) --version |head -1 |cut -d ' ' -f 4 |cut -d . -f 1)
FLANG_LT_17 = $(shell [ $(FLANG_VERSION) -lt 17 ] && echo true)
ifeq ($(FLANG_LT_17),true)
FOPTIONS+=-mcmodel=medium
COPTIONS+=-mcmodel=medium
CFLAGS_FORGA = -mcmodel=medium
FFLAGS_FORGA = -mcmodel=medium
else
DEFINES += -D__FLANG
endif
else
GNUMAJOR=$(shell $(FC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC__ |cut -c18-)
ifdef GNUMAJOR
@ -2707,7 +2717,9 @@ ifneq ($(TARGET),LINUX)
LINK.f = $(FC) $(LDFLAGS)
FOPTIMIZE += -O3
FOPTIMIZE += -mfpmath=sse #
ifneq ($(USE_FLANG),1)
FOPTIMIZE += -mfpmath=sse #
endif
ifeq ($(GNU_GE_6),true)
FOPTIMIZE += -fno-tree-dominator-opts # solvation/hnd_cosmo_lib breaks
@ -2753,7 +2765,9 @@ ifneq ($(TARGET),LINUX)
ifeq ($(GNU_GE_4_6),true)
ifeq ($(shell $(CNFDIR)/check_env.sh $(USE_HWOPT)),1)
FOPTIMIZE += -mtune=native
ifneq ($(USE_FLANG),1)
FOPTIMIZE += -mtune=native
endif
endif
ifdef GFORTRAN_MARCH
FOPTIMIZE += -march=$(GFORTRAN_MARCH)

View file

@ -7,6 +7,8 @@ elif [[ "$1" == *cc* ]] && [[ ! -z $_CC ]]; then
echo $_CC
elif [[ "$1" == *gfortran* ]] ; then
echo gfortran
elif [[ "$1" == *flang* ]] ; then
echo flang
else
echo $(basename -- $1 | cut -d \- -f 1 | sed 's/[0-9]*//g')
fi

View file

@ -214,6 +214,12 @@ if [[ "$os" == "Linux" ]]; then
icc -V
fi
if [[ "$FC" == "flang-new-17" ]]; then
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17
syudo apt-get -y install flang-17
fi
if [[ "$FC" == "flang" ]]; then
if [[ "USE_AOMP" == "Y" ]]; then
aomp_major=16