diff options
author | AMD Toolchain Support <73240730+amd-toolchain-support@users.noreply.github.com> | 2021-07-30 14:37:57 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 11:07:57 +0200 |
commit | bbfaf4e8165df32f6e739e298f642dda4a610c8f (patch) | |
tree | 53babc2a324e087effc062a59366152c13be4eb6 /var | |
parent | 54e8e19a60640ce6877f19d0159c775adb5abc88 (diff) | |
download | spack-bbfaf4e8165df32f6e739e298f642dda4a610c8f.tar.gz spack-bbfaf4e8165df32f6e739e298f642dda4a610c8f.tar.bz2 spack-bbfaf4e8165df32f6e739e298f642dda4a610c8f.tar.xz spack-bbfaf4e8165df32f6e739e298f642dda4a610c8f.zip |
quantum-espresso: update patch for AOCC support (#25144)
Co-authored-by: mohan002 <mohbabul@amd.com>
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/quantum-espresso/configure_aocc.patch | 106 |
1 files changed, 60 insertions, 46 deletions
diff --git a/var/spack/repos/builtin/packages/quantum-espresso/configure_aocc.patch b/var/spack/repos/builtin/packages/quantum-espresso/configure_aocc.patch index 69d5293ab8..fcfae27854 100644 --- a/var/spack/repos/builtin/packages/quantum-espresso/configure_aocc.patch +++ b/var/spack/repos/builtin/packages/quantum-espresso/configure_aocc.patch @@ -1,58 +1,72 @@ ---- 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 @@ +diff --git a/install/configure b/install/configure_aocc +index 66337d1..d2c04af 100755 +--- a/install/configure ++++ b/install/configure_aocc +@@ -3203,6 +3203,7 @@ case "$arch" in 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"` ++ 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" != "" +@@ -3215,6 +3216,12 @@ case "$arch" in + version=`echo $nvfortran_version | cut -d ' ' -f2` + echo "${ECHO_T}nvfortran $version" + f90_in_mpif90="nvfortran" ++ 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 "$pgf_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" + version=`echo $pgf_version | cut -d ' ' -f2` +@@ -3397,6 +3404,9 @@ ppc64-bg*:*xlf90_r ) + ppc64-bg*:*xlf90 ) + try_cc="bgxlc" ;; +*:mpif90 ) -+ try_cc="mpicc $try_cc" -+ ;; - cray*:* ) - try_cc="cc" ++ try_cc="mpicc $try_cc" ++ ;; + ppc64:*xlf* | ppc64le:*xlf* ) + try_cc="xlc_r $try_cc" ;; -@@ -4017,6 +4029,15 @@ - try_dflags="$try_dflags -D__PGI" - have_cpp=1 +@@ -3779,6 +3789,10 @@ necsx:* ) + ppc64le:* ) + try_cflags="-O3" + ;; ++x86_64:* ) ++ try_cflags="-Ofast -Mstack_arrays" ++ try_dflags="-D__OPENMP" ++ ;; + ppc64-bg:* ) + try_cflags="-O3 -q32" + ;; +@@ -3915,6 +3929,16 @@ crayxt*:cray* ) + try_dflags="$try_dflags -D__CRAY" + have_cpp=0 ;; +*:*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 ++ try_fflags="-Ofast -Mstack_arrays" ++ try_fflags_openmp="-fopenmp" ++ try_f90flags=" \$(FFLAGS) -cpp -Ofast -Mpreprocess -Mstack_arrays" ++ try_foxflags="-D__PGI" ++ try_fflags_noopt="-O0" ++ try_ldflags="" ++ try_ldflags_openmp="-fopenmp" ++ try_ldflags_static="-static" ++ ;; + crayxt*:pgf* ) + # see comment above for pgf* + try_fflags_nomain="-Mnomain" +@@ -7815,7 +7839,7 @@ $as_echo "$as_me: WARNING: *** HDF5 version must be 1.8.16 or later" >&2;}; + if test $with_hdf5_libs -eq 1; then + hdf5_libs=$with_hdf5_libline + else +- hdf5_libs=`$with_hdf5_path/bin/h5pfc -show | awk -F'-L' '{$1=""; for (i=2; i<=NF;i++) $i="-L"$i; print $0}'` ++ hdf5_libs=`$with_hdf5_path/bin/h5pfc -show | awk -F'-L' '{$1=""; for (i=2; i<=NF;i++) $i="-L"$i; print $0}' | xargs` + fi + elif command -v h5pfc >/dev/null; then + if test $with_hdf5_libs -eq 1; then |