Skip to content

Commit

Permalink
Merge pull request #41 from ORNL-Fusion/hdf5_precision
Browse files Browse the repository at this point in the history
Add CMake option HDF5_PRECISION
  • Loading branch information
quantumsteve authored May 28, 2024
2 parents 14f3833 + 676367b commit 6459e1f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ option (USE_ACC "Use OpenACC" OFF)
option (USE_PSPLINE "Use PSPLINE interpolation" ON)
option (USE_FIO "Use FIO interpolation support" OFF)

set (VALID_PRECISIONS "FLOAT" "DOUBLE")
set (HDF5_PRECISION "DOUBLE" CACHE STRING "FLOAT,DOUBLE")
set_property (CACHE HDF5_PRECISION PROPERTY STRINGS ${VALID_PRECISIONS})

if (HDF5_PRECISION STREQUAL "DOUBLE")
add_compile_options(-DHDF5_DOUBLE_PRESICION)
elseif (HDF5_PRECISION STREQUAL "FLOAT")
add_compile_options(-DHDF5_FLOAT_PRESICION)
else ()
message (FATAL_ERROR "HDF5_PRECISION value \"${HDF5_PRECISION}\" option set to something other than FLOAT or DOUBLE.")
endif ()

#-------------------------------------------------------------------------------
# Sanitizer options
#-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cmake -DCMAKE_BUILD_TYPE:String=$BUILD_TYPE \
-DUSE_PSPLINE=ON \
-DUSE_FIO=OFF \
-DKORC_TEST=OFF \
-DCMAKE_Fortran_FLAGS="-DHDF5_DOUBLE_PRESICION -malign-double -fconvert='big-endian'" \
-DCMAKE_Fortran_FLAGS="-malign-double -fconvert='big-endian'" \
-DCMAKE_C_FLAGS="-malign-double" \
-DCMAKE_CXX_FLAGS="-malign-double" \
-DCMAKE_Fortran_FLAGS_DEBUG="-g3 -ffpe-trap=zero,overflow -fbacktrace" \
Expand Down

0 comments on commit 6459e1f

Please sign in to comment.