Skip to content

Commit

Permalink
Change build type from debug to testing (could also use release), rem…
Browse files Browse the repository at this point in the history
…oved problematic bounds check, removed -ffast-math and -ffloat-store as one of these causes a calculation error
  • Loading branch information
Rod-Persky committed Oct 21, 2016
1 parent 7be7f16 commit 5616631
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
15 changes: 7 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
cmake_minimum_required(VERSION 3.3)
SET(CMAKE_BUILD_TYPE Debug)
SET(CMAKE_BUILD_TYPE TESTING)

project(RGPTableGen Fortran)


if (NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
endif()

if (NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
endif()

if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
endif()


Expand All @@ -26,18 +26,17 @@ if (NOT REFPROP_FLAGS_ADDED)
if(NOT CMAKE_Fortran_COMPILER_SUPPORTS_F90)
MESSAGE(FATAL_ERROR "Fortran compiler does not support F90")
else()
SET (CMAKE_BUILD_TYPE "DEBUG" CACHE INTERNAL "Set test build")
SET (CMAKE_BUILD_TYPE "TESTING" CACHE INTERNAL "Set test build")
INCLUDE("${CMAKE_MODULE_PATH}/SetFortranFlags.cmake")
INCLUDE("${CMAKE_MODULE_PATH}/SetCompileFlag.cmake")
endif()

SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}" Fortran "-fpic")
SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}" Fortran "-ffast-math")
SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}" Fortran "-fno-common")
SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}" Fortran "-ffloat-store")
SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}" Fortran "-fall-intrinsics")

message(STATUS "${CMAKE_Fortran_FLAGS_RELEASE}")
# SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}" Fortran "-ffast-math")
# SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}" Fortran "-ffloat-store")
endif()


Expand Down
2 changes: 1 addition & 1 deletion RGP.for
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ contains
write(10,901)TRIM(lfluid)//' from NIST'!character*50(description of the material)
write(10,901)'NAME'
write(10,901)TRIM(lfluid) !character*8(material name, same as $$$<component>)
write(10,901)'inDEX'
write(10,901)'INDEX'
write(10,901)TRIM(lfluid) !character*50 (index into clients RGDB program)
write(10,901)'MODEL'
write(10,*)3 !integer (level of property info available 1,2,or 3)
Expand Down
14 changes: 7 additions & 7 deletions cmake/Modules/SetFortranFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG}"
)

# Check array bounds
SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG}"
Fortran "-check bounds" # Intel
"/check:bounds" # Intel Windows
"-fcheck=bounds" # GNU (New style)
"-fbounds-check" # GNU (Old style)
"-Mbounds" # Portland Group
)
#SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG}"
# Fortran "-check bounds" # Intel
# "/check:bounds" # Intel Windows
# "-fcheck=bounds" # GNU (New style)
# "-fbounds-check" # GNU (Old style)
# "-Mbounds" # Portland Group
# )

#####################
### TESTING FLAGS ###
Expand Down

0 comments on commit 5616631

Please sign in to comment.