Skip to content

Commit

Permalink
Merge branch 'develop' into maintenance/start-next-release
Browse files Browse the repository at this point in the history
  • Loading branch information
gardner48 authored Jun 22, 2024
2 parents 44f0bcc + 9e7a8ff commit b967507
Show file tree
Hide file tree
Showing 28 changed files with 123 additions and 180 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ set(sundialslib_SOVERSION "${PACKAGE_VERSION_MAJOR}")

# Prohibit in-source build
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
print_error("In-source build prohibited.")
message(FATAL_ERROR "In-source build prohibited.")
endif()

# Organize targets into folders when using an IDE
Expand Down
2 changes: 1 addition & 1 deletion cmake/SundialsBuildOptionsPre.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ sundials_option(BUILD_FORTRAN_MODULE_INTERFACE BOOL "${DOCSTR}" OFF)
if(BUILD_FORTRAN_MODULE_INTERFACE)
# F2003 interface only supports double precision
if(NOT (SUNDIALS_PRECISION MATCHES "DOUBLE"))
print_error("F2003 interface is not compatible with ${SUNDIALS_PRECISION} precision")
message(FATAL_ERROR "F2003 interface is not compatible with ${SUNDIALS_PRECISION} precision")
endif()

# Allow a user to set where the Fortran modules will be installed
Expand Down
78 changes: 36 additions & 42 deletions cmake/SundialsDeprecated.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
#

if(DEFINED F2003_INTERFACE_ENABLE)
print_warning("The CMake option F2003_INTERFACE_ENABLE is deprecated"
"Use BUILD_FORTRAN_MODULE_INTERFACE instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option F2003_INTERFACE_ENABLE is deprecated. "
"Use BUILD_FORTRAN_MODULE_INTERFACE instead.")
set(BUILD_FORTRAN_MODULE_INTERFACE ${F2003_INTERFACE_ENABLE} CACHE BOOL "Enable Fortran 2003 module interfaces")
endif()

Expand All @@ -30,120 +29,115 @@ unset(F2003_INTERFACE_ENABLE CACHE)
#

if(DEFINED MPI_ENABLE)
print_warning("The CMake option MPI_ENABLE is deprecated" "Use ENABLE_MPI instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option MPI_ENABLE is deprecated. "
"Use ENABLE_MPI instead.")
set(ENABLE_MPI ${MPI_ENABLE} CACHE BOOL "Enable MPI support" FORCE)
unset(MPI_ENABLE CACHE)
endif()

if(DEFINED OPENMP_ENABLE)
print_warning("The CMake option OPENMP_ENABLE is deprecated" "Use ENABLE_OPENMP instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option OPENMP_ENABLE is deprecated. "
"Use ENABLE_OPENMP instead.")
set(ENABLE_OPENMP ${OPENMP_ENABLE} CACHE BOOL "Enable OpenMP support" FORCE)
unset(OPENMP_ENABLE CACHE)
endif()

if(DEFINED OPENMP_DEVICE_ENABLE)
print_warning("The CMake option OPENMP_DEVICE_ENABLE is deprecated"
"Use ENABLE_OPENMP_DEVICE instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option OPENMP_DEVICE_ENABLE is deprecated. "
"Use ENABLE_OPENMP_DEVICE instead.")
set(ENABLE_OPENMP_DEVICE ${OPENMP_DEVICE_ENABLE} CACHE BOOL
"Enable OpenMP device offloading support" FORCE)
unset(OPENMP_DEVICE_ENABLE CACHE)
endif()

if(DEFINED SKIP_OPENMP_DEVICE_CHECK)
print_warning("The CMake option SKIP_OPENMP_DEVICE_CHECK is deprecated"
"Use OPENMP_DEVICE_WORKS instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option SKIP_OPENMP_DEVICE_CHECK is deprecated. "
"Use OPENMP_DEVICE_WORKS instead.")
set(OPENMP_DEVICE_WORKS ${SKIP_OPENMP_DEVICE_CHECK} CACHE BOOL
"Skip the compiler check for OpenMP device offloading" FORCE)
unset(SKIP_OPENMP_DEVICE_CHECK CACHE)
endif()

if(DEFINED PTHREAD_ENABLE)
print_warning("The CMake option PTHREAD_ENABLE is deprecated" "Use ENABLE_PTHREAD instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option PTHREAD_ENABLE is deprecated. "
"Use ENABLE_PTHREAD instead")
set(ENABLE_PTHREAD ${PTHREAD_ENABLE} CACHE BOOL "Enable Pthreads support" FORCE)
unset(PTHREAD_ENABLE CACHE)
endif()

if(DEFINED CUDA_ENABLE)
print_warning("The CMake option CUDA_ENABLE is deprecated" "Use ENABLE_CUDA instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option CUDA_ENABLE is deprecated. "
"Use ENABLE_CUDA instead.")
set(ENABLE_CUDA ${CUDA_ENABLE} CACHE BOOL "Enable CUDA support" FORCE)
unset(CUDA_ENABLE CACHE)
endif()

if(DEFINED LAPACK_ENABLE)
print_warning("The CMake option LAPACK_ENABLE is deprecated" "Use ENABLE_LAPACK instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option LAPACK_ENABLE is deprecated. "
"Use ENABLE_LAPACK instead.")
set(ENABLE_LAPACK ${LAPACK_ENABLE} CACHE BOOL "Enable LAPACK support" FORCE)
unset(LAPACK_ENABLE CACHE)
endif()

if(DEFINED SUPERLUDIST_ENABLE)
print_warning("The CMake option SUPERLUDIST_ENABLE is deprecated"
"Use ENABLE_SUPERLUDIST instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option SUPERLUDIST_ENABLE is deprecated. "
"Use ENABLE_SUPERLUDIST instead.")
set(ENABLE_SUPERLUDIST ${SUPERLUDIST_ENABLE} CACHE BOOL "Enable SuperLU_DIST support" FORCE)
unset(SUPERLUDIST_ENABLE CACHE)
endif()

# Deprecated with SUNDIALS 6.4.0
if(DEFINED SUPERLUDIST_LIBRARY_DIR)
print_warning("The CMake option SUPERLUDIST_LIBRARY_DIR is deprecated"
"Use SUPERLUDIST_DIR instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option SUPERLUDIST_LIBRARY_DIR is deprecated. "
"Use SUPERLUDIST_DIR instead.")
set(SUPERLUDIST_DIR "${SUPERLUDIST_LIBRARY_DIR}/../" CACHE BOOL "SuperLU_DIST root directory" FORCE)
unset(SUPERLUDIST_LIBRARY_DIR CACHE)
endif()
if(DEFINED SUPERLUDIST_INCLUDE_DIR)
print_warning("The CMake option SUPERLUDIST_INCLUDE_DIR is deprecated"
"Use SUPERLUDIST_INCLUDE_DIRS instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option SUPERLUDIST_INCLUDE_DIR is deprecated. "
"Use SUPERLUDIST_INCLUDE_DIRS instead.")
set(SUPERLUDIST_INCLUDE_DIRS "${SUPERLUDIST_INCLUDE_DIR}" CACHE BOOL "SuperLU_DIST include directoroes" FORCE)
unset(SUPERLUDIST_INCLUDE_DIR CACHE)
endif()

if(DEFINED SUPERLUMT_ENABLE)
print_warning("The CMake option SUPERLUMT_ENABLE is deprecated" "Use ENABLE_SUPERLUMT instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option SUPERLUMT_ENABLE is deprecated. "
"Use ENABLE_SUPERLUMT instead.")
set(ENABLE_SUPERLUMT ${SUPERLUMT_ENABLE} CACHE BOOL "Enable SuperLU_MT support" FORCE)
unset(SUPERLUMT_ENABLE CACHE)
endif()

if(DEFINED KLU_ENABLE)
print_warning("The CMake option KLU_ENABLE is deprecated" "Use ENABLE_KLU instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option KLU_ENABLE is deprecated. "
"Use ENABLE_KLU instead.")
set(ENABLE_KLU ${KLU_ENABLE} CACHE BOOL "Enable KLU support" FORCE)
unset(KLU_ENABLE CACHE)
endif()

if(DEFINED HYPRE_ENABLE)
print_warning("The CMake option HYPRE_ENABLE is deprecated" "Use ENABLE_HYPRE instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option HYPRE_ENABLE is deprecated. "
"Use ENABLE_HYPRE instead.")
set(ENABLE_HYPRE ${HYPRE_ENABLE} CACHE BOOL "Enable HYPRE support" FORCE)
unset(HYPRE_ENABLE CACHE)
endif()

if(DEFINED PETSC_ENABLE)
print_warning("The CMake option PETSC_ENABLE is deprecated" "Use ENABLE_PETSC instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option PETSC_ENABLE is deprecated. "
"Use ENABLE_PETSC instead.")
set(ENABLE_PETSC ${PETSC_ENABLE} CACHE BOOL "Enable PETSC support" FORCE)
unset(PETSC_ENABLE CACHE)
endif()

if(DEFINED Trilinos_ENABLE)
print_warning("The CMake option Trilinos_ENABLE is deprecated" "Use ENABLE_TRILINOS instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option Trilinos_ENABLE is deprecated. "
"Use ENABLE_TRILINOS instead.")
set(ENABLE_TRILINOS ${Trilinos_ENABLE} CACHE BOOL "Enable Trilinos support" FORCE)
unset(Trilinos_ENABLE CACHE)
endif()

if(DEFINED RAJA_ENABLE)
print_warning("The CMake option RAJA_ENABLE is deprecated" "Use ENABLE_RAJA instead"
MODE DEPRECATION)
message(DEPRECATION "The CMake option RAJA_ENABLE is deprecated. "
"Use ENABLE_RAJA instead.")
set(ENABLE_RAJA ${RAJA_ENABLE} CACHE BOOL "Enable RAJA support" FORCE)
unset(RAJA_ENABLE CACHE)
endif()
Expand All @@ -153,8 +147,8 @@ endif()
#

if(DEFINED CUDA_ARCH)
print_warning("The CMake option CUDA_ARCH is deprecated" "Use CMAKE_CUDA_ARCHITECTURES instead"
MODE DEPRECATION)
print_warning("The CMake option CUDA_ARCH is deprecated. "
"Use CMAKE_CUDA_ARCHITECTURES instead.")
# convert sm_** to just **
string(REGEX MATCH "[0-9]+" arch_name "${CUDA_ARCH}")
set(CMAKE_CUDA_ARCHITECTURES ${arch_name} CACHE STRING "CUDA Architectures" FORCE)
Expand Down
12 changes: 6 additions & 6 deletions cmake/SundialsExampleOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ if(BUILD_FORTRAN_MODULE_INTERFACE)

# Fortran 2003 examples only support double precision
if(EXAMPLES_ENABLE_F2003 AND (NOT (SUNDIALS_PRECISION MATCHES "DOUBLE")))
print_warning("F2003 examples are not compatible with ${SUNDIALS_PRECISION} precision. "
"Setting EXAMPLES_ENABLE_F2003 to OFF.")
message(WARNING "F2003 examples are not compatible with ${SUNDIALS_PRECISION} precision. "
"Setting EXAMPLES_ENABLE_F2003 to OFF.")
force_variable(EXAMPLES_ENABLE_F2003 BOOL "${DOCSTR}" OFF)
endif()
else()

# set back to OFF (in case it was ON)
if(EXAMPLES_ENABLE_F2003)
print_warning("EXAMPLES_ENABLE_F2003 is ON but BUILD_FORTRAN_MODULE_INTERFACE is OFF. "
"Setting EXAMPLES_ENABLE_F2003 to OFF.")
message(WARNING "EXAMPLES_ENABLE_F2003 is ON but BUILD_FORTRAN_MODULE_INTERFACE is OFF. "
"Setting EXAMPLES_ENABLE_F2003 to OFF.")
force_variable(EXAMPLES_ENABLE_F2003 BOOL "${DOCSTR}" OFF)
endif()

Expand All @@ -75,8 +75,8 @@ sundials_option(EXAMPLES_INSTALL_PATH PATH "Output directory for installing exam

# If examples are to be exported, check where we should install them.
if(EXAMPLES_INSTALL AND NOT EXAMPLES_INSTALL_PATH)
print_warning("The example installation path is empty. "
"Example installation path was reset to its default value")
message(WARNING "The example installation path is empty. Example installation "
"path was reset to its default value")
set(EXAMPLES_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/examples" CACHE STRING
"Output directory for installing example files" FORCE)
endif()
Expand Down
12 changes: 5 additions & 7 deletions cmake/SundialsIndexSize.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ if(SUNDIALS_INDEX_SIZE MATCHES "64")
endforeach()

if(NOT SUNDIALS_CINDEX_TYPE)
print_error("No integer type of size 8 was found.\n\
Tried ${POSSIBLE_INT64}.\n\
Try setting the advanced option SUNDIALS_INDEX_TYPE.")
message(FATAL_ERROR "No integer type of size 8 was found. Tried "
"${POSSIBLE_INT64}. Try setting the advanced option SUNDIALS_INDEX_TYPE.")
endif()

# set Fortran integer size too
Expand All @@ -70,13 +69,12 @@ elseif(SUNDIALS_INDEX_SIZE MATCHES "32")
endforeach()

if(NOT SUNDIALS_CINDEX_TYPE)
print_error("No integer type of size 4 was found.\n\
Tried ${POSSIBLE_INT32}\n\
Try setting the advanced option SUNDIALS_INDEX_TYPE.")
message(FATAL_ERROR "No integer type of size 4 was found. Tried "
"${POSSIBLE_INT32}. Try setting the advanced option SUNDIALS_INDEX_TYPE.")
endif()

# set Fortran integer size too
set(SUNDIALS_FINDEX_TYPE "4")
else()
print_error("Invalid index size.")
message(FATAL_ERROR "Invalid index size.")
endif()
14 changes: 7 additions & 7 deletions cmake/SundialsSetupCompilers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,12 @@ sundials_option(SUNDIALS_LAPACK_UNDERSCORES STRING

# If used, both case and underscores must be set
if((NOT SUNDIALS_LAPACK_CASE) AND SUNDIALS_LAPACK_UNDERSCORES)
print_error("If SUNDIALS_LAPACK_UNDERSCORES is set, "
"SUNDIALS_LAPACK_CASE must also be set.")
message(FATAL_ERROR "If SUNDIALS_LAPACK_UNDERSCORES is set, "
"SUNDIALS_LAPACK_CASE must also be set.")
endif()
if(SUNDIALS_LAPACK_CASE AND (NOT SUNDIALS_LAPACK_UNDERSCORES))
print_error("If SUNDIALS_LAPACK_CASE is set, "
"SUNDIALS_LAPACK_UNDERSCORES must also be set.")
message(FATAL_ERROR "If SUNDIALS_LAPACK_CASE is set, "
"SUNDIALS_LAPACK_UNDERSCORES must also be set.")
endif()

# Did the user provide a name-mangling scheme?
Expand All @@ -324,7 +324,7 @@ if(SUNDIALS_LAPACK_CASE AND SUNDIALS_LAPACK_UNDERSCORES)
set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## __")
set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## __")
else()
print_error("Invalid SUNDIALS_LAPACK_UNDERSCORES option.")
message(FATAL_ERROR "Invalid SUNDIALS_LAPACK_UNDERSCORES option.")
endif()
elseif(SUNDIALS_LAPACK_CASE MATCHES "UPPER")
if(SUNDIALS_LAPACK_UNDERSCORES MATCHES "NONE")
Expand All @@ -337,10 +337,10 @@ if(SUNDIALS_LAPACK_CASE AND SUNDIALS_LAPACK_UNDERSCORES)
set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## __")
set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## __")
else()
print_error("Invalid SUNDIALS_LAPACK_UNDERSCORES option.")
message(FATAL_ERROR "Invalid SUNDIALS_LAPACK_UNDERSCORES option.")
endif()
else()
print_error("Invalid SUNDIALS_LAPACK_CASE option.")
message(FATAL_ERROR "Invalid SUNDIALS_LAPACK_CASE option.")
endif()

# name-mangling scheme has been manually set
Expand Down
2 changes: 1 addition & 1 deletion cmake/SundialsSetupFortran.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if(BUILD_FORTRAN_MODULE_INTERFACE)
message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports F2003 -- no")
message(STATUS "Check output:")
message("${COMPILE_OUTPUT}")
print_error("BUILD_FORTRAN_MODULE_INTERFACE is set to ON, but the CMAKE_Fortran_COMPILER does not support F2003")
message(FATAL_ERROR "BUILD_FORTRAN_MODULE_INTERFACE is set to ON, but the CMAKE_Fortran_COMPILER does not support F2003")
endif()
else()
message(STATUS "Skipped F2003 tests, assuming ${CMAKE_Fortran_COMPILER} supports the f2003 standard. To rerun the F2003 tests, set F2003_FOUND to FALSE.")
Expand Down
2 changes: 1 addition & 1 deletion cmake/SundialsSetupHIP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ set(CMAKE_PREFIX_PATH "${ROCM_PATH};${HIP_PATH}")
find_package(HIP REQUIRED)

if("${HIP_COMPILER}" STREQUAL "hcc")
print_error("Deprecated HCC compiler is not supported" "Please update ROCm")
message(FATAL_ERROR "Deprecated HCC compiler is not supported" "Please update ROCm")
endif()

message(STATUS "HIP version: ${HIP_VERSION}")
Expand Down
4 changes: 2 additions & 2 deletions cmake/SundialsSetupTesting.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (SUNDIALS_TEST_DEVTESTS OR BUILD_BENCHMARKS)
# look for the testRunner script in the test directory
find_program(TESTRUNNER testRunner PATHS test NO_DEFAULT_PATH)
if(NOT TESTRUNNER)
print_error("Could not locate testRunner. Set SUNDIALS_TEST_DEVTESTS=OFF or BUILD_BENCHMARKS=OFF to continue.")
message(FATAL_ERROR "Could not locate testRunner. Set SUNDIALS_TEST_DEVTESTS=OFF or BUILD_BENCHMARKS=OFF to continue.")
endif()
message(STATUS "Found testRunner: ${TESTRUNNER}")
set(TESTRUNNER ${TESTRUNNER} CACHE INTERNAL "")
Expand Down Expand Up @@ -56,7 +56,7 @@ if(SUNDIALS_TEST_DEVTESTS)
if(SUNDIALS_TEST_ANSWER_DIR)
message(STATUS "Using non-default test answer directory: ${SUNDIALS_TEST_ANSWER_DIR}")
if(NOT EXISTS ${SUNDIALS_TEST_ANSWER_DIR})
print_error("SUNDIALS_TEST_ANSWER_DIR does not exist!")
message(FATAL_ERROR "SUNDIALS_TEST_ANSWER_DIR does not exist!")
endif()
endif()

Expand Down
49 changes: 0 additions & 49 deletions cmake/macros/SundialsCMakeMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,55 +40,6 @@ macro(ADD_PREFIX prefix rootlist)
set(${rootlist} ${outlist})
endmacro(ADD_PREFIX)

# Macro to print warnings.

macro(print_warning message action)
set(options )
set(oneValueArgs MODE)
set(multiValueArgs )

# parse inputs and create variables print_warning_<keyword>
cmake_parse_arguments(print_warning "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )

if(print_warning_MODE)
set(_mode ${print_warning_MODE})
else()
set(_mode WARNING)
endif()

set(MSG
"------------------------------------------------------------------------\n"
"WARNING: ${message}\n"
"${action}\n"
"------------------------------------------------------------------------")

message(${_mode} ${MSG})
endmacro()

# Macro to print error messages.

macro(print_error message)
set(options )
set(oneValueArgs MODE)
set(multiValueArgs )

# parse inputs and create variables print_warning_<keyword>
cmake_parse_arguments(print_error "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )

if(print_error_MODE)
set(_mode ${print_error_MODE})
else()
set(_mode FATAL_ERROR)
endif()

set(MSG
"************************************************************************\n"
"ERROR: ${message}\n"
"************************************************************************")

message(${_mode} ${MSG})
endmacro()

# Returns an unquoted string. Note that CMake will readily turn such
# strings back into lists, due to the duality of lists and
# semicolon-separated strings. So be careful how you use it.
Expand Down
Loading

0 comments on commit b967507

Please sign in to comment.