AOCC support for QE 6.7 (#22664)

Adding qe_6.7_aocc_support
This commit is contained in:
AMD Toolchain Support 2021-03-31 21:04:21 +05:30 committed by GitHub
parent 802f5afac0
commit 1144666c09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 86 additions and 1 deletions

View file

@ -0,0 +1,58 @@
--- spack-src/install/configure.orig 2021-02-11 13:56:58.900212951 +0530
+++ spack-src/install/configure 2021-02-11 15:19:54.726403962 +0530
@@ -3203,6 +3203,7 @@
nagfor_version=`$mpif90 -v 2>&1 | grep "NAG Fortran"`
xlf_version=`$mpif90 -v 2>&1 | grep "xlf"`
armflang_version=`$mpif90 -v 2>&1 | grep "Arm C/C++/Fortran Compiler version"`
+ aoccflang_version=`$mpif90 -v 2>&1 | grep "AMD clang version"`
#
if test "$ifort_version" != ""
then
@@ -3227,6 +3228,12 @@
f90_minor_version=`echo $version | cut -d. -f2`
echo "${ECHO_T}gfortran $f90_major_version.$f90_minor_version"
f90_in_mpif90="gfortran"
+ elif test "$aoccflang_version" != ""
+ then
+ version=`echo $aoccflang_version | cut -d" " -f 5`
+ echo "${ECHO_T}mpif90 $version"
+ f90_in_mpif90="mpif90"
+ try_foxflags="-D__PGI"
elif test "$nagfor_version" != ""
then
# NAG 6.0 has the codename attached to version number... annoying
@@ -3327,6 +3334,8 @@
f90_flavor=ifort
elif $f90 -V 2>&1 | grep -q "^pgf" ; then
f90_flavor=pgf
+ elif $f90 -v 2>&1 | grep -q "AMD clang version" ; then
+ f90_flavor=mpif90
elif $f90 -v 2>&1 | grep -q "gcc version" ; then
f90_flavor=gfortran
elif $f90 -V 2>&1 | grep -q "Cray Fortran" ; then
@@ -3385,6 +3394,9 @@
*:pgf90 )
try_cc="pgcc $try_cc"
;;
+*:mpif90 )
+ try_cc="mpicc $try_cc"
+ ;;
cray*:* )
try_cc="cc"
;;
@@ -4017,6 +4029,15 @@
try_dflags="$try_dflags -D__PGI"
have_cpp=1
;;
+*:*mpif90 )
+ try_fflags="-O3 -g"
+ try_fflags_openmp="-fopenmp"
+ try_f90flags="\$(FFLAGS) -cpp"
+ try_fflags_noopt="-O0 -g"
+ try_ldflags="-g"
+ try_ldflags_openmp="-pthread -fopenmp"
+ try_ldflags_static="-static"
+ ;;
*:*gfortran )
try_fflags="-O3 -g"
if test "$f90_major_version" -ge "10"; then

View file

@ -266,6 +266,9 @@ class QuantumEspresso(Package):
sha256='bbceba1fb08d01d548d4393bbcaeae966def13f75884268a0f84448457b8eaa3',
when='+patch@6.4.1:6.5.0')
# Configure updated to work with AOCC compilers
patch('configure_aocc.patch', when='@6.7 %aocc')
# Configure updated to work with NVIDIA compilers
patch('nvhpc.patch', when='@6.5 %nvhpc')
@ -346,6 +349,15 @@ def install(self, spec, prefix):
fftw_ld_flags = spec['fftw'].libs.ld_flags
options.append('FFT_LIBS={0}'.format(fftw_ld_flags))
if '^amdfftw' in spec:
fftw_prefix = spec['amdfftw'].prefix
options.append('FFTW_INCLUDE={0}'.format(fftw_prefix.include))
if '+openmp' in spec:
fftw_ld_flags = spec['amdfftw:openmp'].libs.ld_flags
else:
fftw_ld_flags = spec['amdfftw'].libs.ld_flags
options.append('FFT_LIBS={0}'.format(fftw_ld_flags))
# External BLAS and LAPACK requires the correct link line into
# BLAS_LIBS, do no use LAPACK_LIBS as the autoconf scripts indicate
# that this variable is largely ignored/obsolete.
@ -394,6 +406,21 @@ def install(self, spec, prefix):
options.extend([
'--with-elpa-include={0}'.format(elpa_include),
'--with-elpa-version={0}'.format(elpa.version.version[0]),
])
elpa_suffix = '_openmp' if '+openmp' in elpa else ''
# Currently AOCC support only static libraries of ELPA
if '%aocc' in spec:
options.extend([
'--with-elpa-lib={0}'.format(
join_path(elpa.prefix.lib,
'libelpa{elpa_suffix}.a'
.format(elpa_suffix=elpa_suffix)))
])
else:
options.extend([
'--with-elpa-lib={0}'.format(elpa.libs[0])
])