From 890a93bbcdf2a933ec5636ed7a9b38cd62c75c04 Mon Sep 17 00:00:00 2001 From: h-denpo <57649496+h-denpo@users.noreply.github.com> Date: Mon, 1 Mar 2021 17:06:08 +0900 Subject: [PATCH] gchp: patch for aarch64 (#22010) --- .../builtin/packages/gchp/for_aarch64.patch | 24 +++++++++++++++++++ .../repos/builtin/packages/gchp/package.py | 3 +++ 2 files changed, 27 insertions(+) create mode 100644 var/spack/repos/builtin/packages/gchp/for_aarch64.patch diff --git a/var/spack/repos/builtin/packages/gchp/for_aarch64.patch b/var/spack/repos/builtin/packages/gchp/for_aarch64.patch new file mode 100644 index 0000000000..53af837784 --- /dev/null +++ b/var/spack/repos/builtin/packages/gchp/for_aarch64.patch @@ -0,0 +1,24 @@ +diff -uprN spack-src.org/ESMA_cmake/GNU.cmake spack-src/ESMA_cmake/GNU.cmake +--- spack-src.org/ESMA_cmake/GNU.cmake 2021-02-25 11:28:42.856054566 +0900 ++++ spack-src/ESMA_cmake/GNU.cmake 2021-02-25 10:38:06.556356960 +0900 +@@ -125,7 +125,7 @@ set (GEOS_Fortran_Debug_FPE_Flags "${com + + # GEOS Release + # ------------ +-set (GEOS_Fortran_Release_Flags "${FOPT3} -march=westmere -mtune=generic -funroll-loops ${DEBINFO}") ++set (GEOS_Fortran_Release_Flags "${FOPT3} -funroll-loops ${DEBINFO}") + set (GEOS_Fortran_Release_FPE_Flags "${common_Fortran_fpe_flags}") + + # GEOS Vectorize +diff -uprN spack-src.org/src/GCHP_GridComp/HEMCO_GridComp/HEMCO/CMakeLists.txt spack-src/src/GCHP_GridComp/HEMCO_GridComp/HEMCO/CMakeLists.txt +--- spack-src.org/src/GCHP_GridComp/HEMCO_GridComp/HEMCO/CMakeLists.txt 2021-02-25 11:33:57.897033867 +0900 ++++ spack-src/src/GCHP_GridComp/HEMCO_GridComp/HEMCO/CMakeLists.txt 2021-02-25 11:22:06.224802880 +0900 +@@ -64,7 +64,7 @@ set(HEMCO_Fortran_FLAGS_DEBUG_Intel + + set(HEMCO_Fortran_FLAGS_GNU + -cpp -w -std=legacy -fautomatic -fno-align-commons -fconvert=big-endian +- -fno-range-check -mcmodel=medium -fbacktrace -g -DLINUX_GFORTRAN ++ -fno-range-check -mcmodel=small -fbacktrace -g -DLINUX_GFORTRAN + -ffree-line-length-none + CACHE STRING "HEMCO compiler flags for all build types with GNU compilers" + ) diff --git a/var/spack/repos/builtin/packages/gchp/package.py b/var/spack/repos/builtin/packages/gchp/package.py index acbc3786e3..cd2bd3d44b 100644 --- a/var/spack/repos/builtin/packages/gchp/package.py +++ b/var/spack/repos/builtin/packages/gchp/package.py @@ -17,6 +17,9 @@ class Gchp(CMakePackage): version('13.0.0-rc.0', git='https://github.com/geoschem/GCHP.git', commit='4bd15316faf4e5f06517d3a6b1df1986b1126d90', submodules=True) + + patch('for_aarch64.patch', when='target=aarch64:') + # NOTE: Post-13.0.0-rc.0 versions will have fix that # allows these ESMF variants to be enabled depends_on('esmf@8.0.1: -lapack -pio -pnetcdf -xerces')