Fixes for Bluegene/Q
authorMark Abraham <mark.j.abraham@gmail.com>
Fri, 26 Jul 2013 08:36:35 +0000 (10:36 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sun, 25 Aug 2013 11:50:11 +0000 (13:50 +0200)
* Moved suffixing code to after where gmxManageBlueGene sets
  GMX_MPI. Since nothing depends on the suffixing until the calls to
  add_subdirectory(), this is safe. There is a complication from the
  way that GMX_MPI means "real MPI" for most of CMake and "real or
  thread MPI" in the source code; that is managed by GMX_THREAD_MPI=ON
  causing GMX_MPI=ON at a certain point. To cope with this, we add the
  "_mpi" suffix in response to GMX_LIB_MPI=on, which is how things
  should have been done back when GMX_MPI was co-opted, except that
  the suffixing was probably being done too early... Altogether, this
  change means that real-MPI binaries are always built with the _mpi
  suffix, like users have come to expect.
* Added compiler suppression for a useless information message that
  is otherwise issued for almost every source file
* Made the C and CXX platform files identical; I'd originally
  thought they could be combined on the command line, but
  that is not true

Change-Id: I26cb782a1b47cf48f47b80ec8c8d0a53db338872

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

index 29cb127eb830844f048b488244e8c671bac77098..f6a45a83e440bf2cca0aec973c70f6b3215a4f2b 100644 (file)
@@ -320,37 +320,6 @@ if(CMAKE_C_COMPILER_ID MATCHES "Intel" AND C_COMPILER_VERSION VERSION_LESS "12.0
     message(WARNING "Intel compilers before 12.0.0 are not routinely tested, so there may be problems. Version 11.1 with SSE4.1 is known to produce incorrect results. It is highly recommended to use a more up-to-date compiler. If you choose to use this version, make sure you run the regressiontests.")
 endif()
 
-########################################################################
-# Set up binary and library suffixing 
-########################################################################
-set(GMX_BINARY_SUFFIX "" CACHE STRING "Suffix for GROMACS binaries (default: _d for double, _mpi for MPI, _mpi_d for MPI and double).")
-set(GMX_LIBS_SUFFIX "" 
-  CACHE STRING "Suffix for GROMACS libs (default: _d for double, _mpi for MPI, _mpi_d for MPI and double).")
-if (GMX_DEFAULT_SUFFIX)
-  set(GMX_BINARY_SUFFIX "")
-  set(GMX_LIBS_SUFFIX "")
-  if (GMX_MPI)
-    set(GMX_BINARY_SUFFIX "_mpi")
-    set(GMX_LIBS_SUFFIX "_mpi")
-  endif(GMX_MPI)
-  if (GMX_DOUBLE)
-    set (GMX_BINARY_SUFFIX "${GMX_BINARY_SUFFIX}_d")
-    set (GMX_LIBS_SUFFIX "${GMX_LIBS_SUFFIX}_d")
-  endif(GMX_DOUBLE)
-  mark_as_advanced(FORCE GMX_BINARY_SUFFIX GMX_LIBS_SUFFIX)
-  if (NOT SUFFIX_QUIETLY)
-    message(STATUS "Using default binary suffix: \"${GMX_BINARY_SUFFIX}\"")
-    message(STATUS "Using default library suffix: \"${GMX_LIBS_SUFFIX}\"")
-  endif (NOT SUFFIX_QUIETLY)
-else(GMX_DEFAULT_SUFFIX)
-  mark_as_advanced(CLEAR GMX_BINARY_SUFFIX GMX_LIBS_SUFFIX)
-  if (NOT SUFFIX_QUIETLY)
-    message(STATUS "Using manually set binary suffix: \"${GMX_BINARY_SUFFIX}\"")
-    message(STATUS "Using manually set library suffix: \"${GMX_LIBS_SUFFIX}\"")
-  endif (NOT SUFFIX_QUIETLY)
-endif(GMX_DEFAULT_SUFFIX)
-set(SUFFIX_QUIETLY TRUE CACHE INTERNAL "")
-
 set(PKG_CFLAGS "")
 if(GMX_DOUBLE)
     set(PKG_CFLAGS "${PKG_CFLAGS} -DGMX_DOUBLE")
@@ -1165,6 +1134,37 @@ set(INCL_INSTALL_DIR ${GMX_INSTALL_PREFIX}include)
 
 set(GMXLIBDIR        ${DATA_INSTALL_DIR}/top)
 
+########################################################################
+# Set up binary and library suffixing
+########################################################################
+set(GMX_BINARY_SUFFIX "" CACHE STRING "Suffix for GROMACS binaries (default: _d for double, _mpi for MPI, _mpi_d for MPI and double).")
+set(GMX_LIBS_SUFFIX ""
+  CACHE STRING "Suffix for GROMACS libs (default: _d for double, _mpi for MPI, _mpi_d for MPI and double).")
+if (GMX_DEFAULT_SUFFIX)
+  set(GMX_BINARY_SUFFIX "")
+  set(GMX_LIBS_SUFFIX "")
+  if (GMX_LIB_MPI)
+    set(GMX_BINARY_SUFFIX "_mpi")
+    set(GMX_LIBS_SUFFIX "_mpi")
+  endif()
+  if (GMX_DOUBLE)
+    set (GMX_BINARY_SUFFIX "${GMX_BINARY_SUFFIX}_d")
+    set (GMX_LIBS_SUFFIX "${GMX_LIBS_SUFFIX}_d")
+  endif(GMX_DOUBLE)
+  mark_as_advanced(FORCE GMX_BINARY_SUFFIX GMX_LIBS_SUFFIX)
+  if (NOT SUFFIX_QUIETLY)
+    message(STATUS "Using default binary suffix: \"${GMX_BINARY_SUFFIX}\"")
+    message(STATUS "Using default library suffix: \"${GMX_LIBS_SUFFIX}\"")
+  endif (NOT SUFFIX_QUIETLY)
+else(GMX_DEFAULT_SUFFIX)
+  mark_as_advanced(CLEAR GMX_BINARY_SUFFIX GMX_LIBS_SUFFIX)
+  if (NOT SUFFIX_QUIETLY)
+    message(STATUS "Using manually set binary suffix: \"${GMX_BINARY_SUFFIX}\"")
+    message(STATUS "Using manually set library suffix: \"${GMX_LIBS_SUFFIX}\"")
+  endif (NOT SUFFIX_QUIETLY)
+endif(GMX_DEFAULT_SUFFIX)
+set(SUFFIX_QUIETLY TRUE CACHE INTERNAL "")
+
 ##################################################################
 # Shared library settings - Darwin uses INSTALL_NAME_DIR instead!
 ##################################################################
index bc7a622201e790fa5a0771476065f7584f67b16e..f602d6d70d7a75040150477f6135d97f6736ec94 100644 (file)
 
 include(BlueGeneQ-static)
 __BlueGeneQ_set_static_flags(XL C)
+__BlueGeneQ_set_static_flags(XL CXX)
 
-set(CMAKE_SYSTEM_NAME BlueGeneQ-static)
+# This suppression stops the following information message from
+# almost every source file at -O3:
+#   1500-036: (I) The NOSTRICT option (default at OPT(3)) has the potential to alter the semantics of a program.  Please refer to documentation on the STRICT/NOSTRICT option for more information.
+set(COMPILER_SUPPRESSION "-qsuppress=1500-036")
+
+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_C_FLAGS_RELEASE "-O3 -DNDEBUG ${COMPILER_SUPPRESSION}" 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")
+set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG ${COMPILER_SUPPRESSION}" CACHE STRING "Compiler optimization flags")
 
 mark_as_advanced(CMAKE_XL_CreateExportList) # No idea what spams this
index 3b19959ef45213a6b4dc6ba0a603f46a507d40c5..f602d6d70d7a75040150477f6135d97f6736ec94 100644 (file)
 #  License text for the above reference.)
 
 include(BlueGeneQ-static)
+__BlueGeneQ_set_static_flags(XL C)
 __BlueGeneQ_set_static_flags(XL CXX)
 
+# This suppression stops the following information message from
+# almost every source file at -O3:
+#   1500-036: (I) The NOSTRICT option (default at OPT(3)) has the potential to alter the semantics of a program.  Please refer to documentation on the STRICT/NOSTRICT option for more information.
+set(COMPILER_SUPPRESSION "-qsuppress=1500-036")
+
 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_C_FLAGS_RELEASE "-O3 -DNDEBUG ${COMPILER_SUPPRESSION}" 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")
+set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG ${COMPILER_SUPPRESSION}" CACHE STRING "Compiler optimization flags")
 
 mark_as_advanced(CMAKE_XL_CreateExportList) # No idea what spams this