From 8dcfef49b822700b4ac5b0b78ba7c573de8087dd Mon Sep 17 00:00:00 2001 From: julie Date: Sun, 6 Mar 2011 20:02:06 +0000 Subject: [PATCH] Added compiler options needed for HP Fortran - Chuck Atkins (Kitware) --- CMAKE/CheckLAPACKCompilerFlags.cmake | 21 +++++++++++++++++++++ CTestCustom.cmake.in | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/CMAKE/CheckLAPACKCompilerFlags.cmake b/CMAKE/CheckLAPACKCompilerFlags.cmake index d22f824..77026a6 100644 --- a/CMAKE/CheckLAPACKCompilerFlags.cmake +++ b/CMAKE/CheckLAPACKCompilerFlags.cmake @@ -50,6 +50,27 @@ elseif( (CMAKE_Fortran_COMPILER_ID STREQUAL "VisualAge" ) OR # CMake 2.6 CACHE STRING "Flags for Fortran compiler." FORCE ) endif() +# HP Fortran +elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "HP" ) + if( "${CMAKE_Fortran_FLAGS}" MATCHES "\\+fp_exception" ) + set( FPE_EXIT TRUE ) + endif() + + if( NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "\\+fltconst_strict") ) + message( STATUS "Enabling strict float conversion with +fltconst_strict" ) + set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} +fltconst_strict" + CACHE STRING "Flags for Fortran compiler." FORCE ) + endif() + + # Most versions of cmake don't have good default options for the HP compiler + set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -g" + CACHE STRING "Flags used by the compiler during debug builds" FORCE ) + set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_MINSIZEREL} +Osize" + CACHE STRING "Flags used by the compiler during release minsize builds" FORCE ) + set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_RELEASE} +O2" + CACHE STRING "Flags used by the compiler during release builds" FORCE ) + set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO} +O2 -g" + CACHE STRING "Flags used by the compiler during release with debug info builds" FORCE ) else() endif() diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index 9e0aed6..6388415 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -37,4 +37,8 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION # Harmless warnings from the Intel compiler on Windows "ipo: warning #11010: file format not recognized for .*\\.exe\\.embed\\.manifest\\.res" "LINK : warning LNK4224: /INCREMENTAL:YES is no longer supported; ignored" + + # Warnings caused by string truncation in the test code. The truncation is + # intentional + "Character string truncated to length 1 on assignment" ) -- 2.7.4