Define both C and C++ compilers in BGQ toolchains; use -O3
authorJeff Hammond <jeff.science@gmail.com>
Sun, 16 Jun 2013 19:59:47 +0000 (19:59 +0000)
committerMark Abraham <mark.j.abraham@gmail.com>
Sun, 16 Jun 2013 22:07:25 +0000 (00:07 +0200)
When using either the C or C++ toolchain, the complimentary compiler is
not properly identified, rather /usr/bin/g{cc,++} is, which may cause
configuration problems.  this patch fixes this issue.

ALCF strongly recommends the use of -O3 unless there is clear evidence
that higher optimization has a (positive) effect on the quality of the
code generation from XL.  we find that XL frequently generates no faster
and even slower code with -O4 and -O5 unless the code is specifically
designed to be optimized for BGQ.

Fixes #1283

Change-Id: If32a507c6394e23106555741bdefbc0d554c3765

cmake/Platform/BlueGeneQ-static-XL-C.cmake
cmake/Platform/BlueGeneQ-static-XL-CXX.cmake

index bf369d558777bd57c44438a2f90519d3fca01bd4..bc7a622201e790fa5a0771476065f7584f67b16e 100644 (file)
@@ -21,6 +21,8 @@ set(CMAKE_SYSTEM_NAME BlueGeneQ-static)
 # xl.ndebug is appropriate for production calculations. For debugging,
 # use xl to add back error checks and assertions
 set(CMAKE_C_COMPILER /bgsys/drivers/ppcfloor/comm/xl.ndebug/bin/mpixlc_r)
-set(CMAKE_C_FLAGS_RELEASE "-O4 -DNDEBUG" CACHE STRING "Compiler optimization flags")
+set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "Compiler optimization flags")
+set(CMAKE_CXX_COMPILER /bgsys/drivers/ppcfloor/comm/xl.ndebug/bin/mpixlcxx_r)
+set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "Compiler optimization flags")
 
 mark_as_advanced(CMAKE_XL_CreateExportList) # No idea what spams this
index 98cac37f8403993871da8a258cf7f12d2eea69f0..3b19959ef45213a6b4dc6ba0a603f46a507d40c5 100644 (file)
@@ -20,7 +20,9 @@ __BlueGeneQ_set_static_flags(XL CXX)
 set(CMAKE_SYSTEM_NAME BlueGeneQ-static CACHE STRING "Cross-compiling for BlueGene/Q" FORCE)
 # xl.ndebug is appropriate for production calculations. For debugging,
 # use xl to add back error checks and assertions
+set(CMAKE_C_COMPILER /bgsys/drivers/ppcfloor/comm/xl.ndebug/bin/mpixlc_r)
+set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "Compiler optimization flags")
 set(CMAKE_CXX_COMPILER /bgsys/drivers/ppcfloor/comm/xl.ndebug/bin/mpixlcxx_r)
-set(CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG" CACHE STRING "Compiler optimization flags")
+set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "Compiler optimization flags")
 
 mark_as_advanced(CMAKE_XL_CreateExportList) # No idea what spams this