Skip to content

Commit

Permalink
move bigendian setting to sp tests only
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderRichert-NOAA committed Nov 3, 2023
1 parent 8754fa3 commit f202411
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ endif()

# Set compiler flags.
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_Fortran_FLAGS "-g -traceback -convert big_endian -assume byterecl -fp-model strict -fpp -auto ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS "-g -traceback -assume byterecl -fp-model strict -fpp -auto ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check all -warn all")
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(IntelLLVM)$")
# Avoid Intel OneAPI 2023.2.1 bug
Expand All @@ -60,7 +60,7 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(fortran_d_flags "-r8")
set(fortran_8_flags "-i8 -r8")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
set(CMAKE_Fortran_FLAGS "-g -fbacktrace -cpp -fconvert=big-endian ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS "-g -fbacktrace -cpp ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -ggdb -Wall -Wno-unused-dummy-argument -Wsurprising -Wextra -fcheck=all")
set(fortran_d_flags "-fdefault-real-8")
set(fortran_8_flags "-fdefault-integer-8 -fdefault-real-8")
Expand Down
6 changes: 5 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ function(create_sp_test name kind timeout)
target_link_libraries(${name}_${kind} PRIVATE OpenMP::OpenMP_Fortran)
endif()
target_link_libraries(${name}_${kind} PRIVATE ip::ip_${kind})
set_target_properties(${name}_${kind} PROPERTIES COMPILE_FLAGS "${fortran_${kind}_flags}")
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set_target_properties(${name}_${kind} PROPERTIES COMPILE_FLAGS "-convert big_endian ${fortran_${kind}_flags}")
elif(${CMAKE_Fortran_COMPILER_ID} MATCHES "^(GNU)$")
set_target_properties(${name}_${kind} PROPERTIES COMPILE_FLAGS "-fconvert=big-endian ${fortran_${kind}_flags}")
endif()
add_test(NAME ${name}_${kind} COMMAND ${name}_${kind})
target_compile_definitions(${name}_${kind} PRIVATE KIND_${kind})
if(TEST_TIME_LIMIT)
Expand Down

0 comments on commit f202411

Please sign in to comment.