From d57b4bb756f494818a07275afec7d7105988faa3 Mon Sep 17 00:00:00 2001 From: Ye Luo Date: Wed, 17 Jan 2018 12:18:07 -0600 Subject: [PATCH] Avoid GNU/Clang adding -march on PowerPC. --- CMake/ClangCompilers.cmake | 10 +++++----- CMake/GNUCompilers.cmake | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMake/ClangCompilers.cmake b/CMake/ClangCompilers.cmake index 00698102d..2c885e3dc 100644 --- a/CMake/ClangCompilers.cmake +++ b/CMake/ClangCompilers.cmake @@ -34,10 +34,10 @@ SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffast-math" ) SET( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ffast-math" ) SET( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -ffast-math" ) -#------------------------ -# Not on Cray's machine -#------------------------ -IF(NOT $ENV{CRAYPE_VERSION} MATCHES ".") +#-------------------------------------- +# Neither on Cray's machine nor PowerPC +#-------------------------------------- +IF((NOT $ENV{CRAYPE_VERSION} MATCHES ".") AND (NOT CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")) #check if the user has already specified -march=XXXX option for cross-compiling. if(CMAKE_CXX_FLAGS MATCHES "-march=" OR CMAKE_C_FLAGS MATCHES "-march=") @@ -52,7 +52,7 @@ else() #(CMAKE_CXX_FLAGS MATCHES "-march=" OR CMAKE_C_FLAGS MATCHES "-march=") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") endif() #(CMAKE_CXX_FLAGS MATCHES "-march=" OR CMAKE_C_FLAGS MATCHES "-march=") -ENDIF(NOT $ENV{CRAYPE_VERSION} MATCHES ".") +ENDIF((NOT $ENV{CRAYPE_VERSION} MATCHES ".") AND (NOT CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")) # Add static flags if necessary IF(QMC_BUILD_STATIC) diff --git a/CMake/GNUCompilers.cmake b/CMake/GNUCompilers.cmake index dd5ff6b6f..3fe57c2e2 100755 --- a/CMake/GNUCompilers.cmake +++ b/CMake/GNUCompilers.cmake @@ -27,10 +27,10 @@ SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffast-math" ) SET( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ffast-math" ) SET( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -ffast-math" ) -#------------------------ -# Not on Cray's machine -#------------------------ -IF(NOT $ENV{CRAYPE_VERSION} MATCHES ".") +#-------------------------------------- +# Neither on Cray's machine nor PowerPC +#-------------------------------------- +IF((NOT $ENV{CRAYPE_VERSION} MATCHES ".") AND (NOT CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")) #check if the user has already specified -march=XXXX option for cross-compiling. if(CMAKE_CXX_FLAGS MATCHES "-march=" OR CMAKE_C_FLAGS MATCHES "-march=") @@ -45,7 +45,7 @@ else() #(CMAKE_CXX_FLAGS MATCHES "-march=" OR CMAKE_C_FLAGS MATCHES "-march=") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") endif() #(CMAKE_CXX_FLAGS MATCHES "-march=" OR CMAKE_C_FLAGS MATCHES "-march=") -ENDIF(NOT $ENV{CRAYPE_VERSION} MATCHES ".") +ENDIF((NOT $ENV{CRAYPE_VERSION} MATCHES ".") AND (NOT CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")) # Add static flags if necessary IF(QMC_BUILD_STATIC)