From a74ef3e63547ccc05af86ab5ec0f5bf0701653f6 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Wed, 30 Aug 2023 12:38:39 -0400 Subject: [PATCH] Add support for generic x86_64 processor with Intel Fortran --- CHANGELOG.md | 2 ++ compiler/flags/GNU_Fortran.cmake | 1 + compiler/flags/Intel_Fortran.cmake | 3 +++ 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfba046..d472c48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added support for building with Intel Fortran in Rosetta2 (generic x86_64 processor) + ### Changed ## [3.31.1] - 2023-08-03 diff --git a/compiler/flags/GNU_Fortran.cmake b/compiler/flags/GNU_Fortran.cmake index 9140d49..bd4b268 100644 --- a/compiler/flags/GNU_Fortran.cmake +++ b/compiler/flags/GNU_Fortran.cmake @@ -137,6 +137,7 @@ elseif (${proc_description} MATCHES "Intel") set (PREFER_AVX128 "-mprefer-avx128") set (NO_FMA "-mno-fma") elseif ( ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64" ) + message(WARNING "Unknown processor type. Defaulting to a generic x86_64 processor. Performance may be suboptimal.") set (GNU_TARGET_ARCH "x86-64") set (GNU_NATIVE_ARCH "native") else () diff --git a/compiler/flags/Intel_Fortran.cmake b/compiler/flags/Intel_Fortran.cmake index 3c69813..26856c7 100644 --- a/compiler/flags/Intel_Fortran.cmake +++ b/compiler/flags/Intel_Fortran.cmake @@ -72,6 +72,9 @@ elseif (${proc_description} MATCHES "Intel") # Previous versions of GEOS used this flag, which was not portable # for AMD. Keeping here for a few versions for historical purposes. #set (COREAVX2_FLAG "-xCORE-AVX2") +elseif ( ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64" ) + message(WARNING "Unknown processory type. Defaulting to a generic x86_64 processor. Performance may be suboptimal.") + set (COREAVX2_FLAG "") else () message(FATAL_ERROR "Unknown processor. Please file an issue at https://github.com/GEOS-ESM/ESMA_cmake") endif ()