Skip to content

Commit b262974

Browse files
committed
update CmakeList
1 parent f597dbe commit b262974

File tree

1 file changed

+24
-27
lines changed

1 file changed

+24
-27
lines changed

CMakeLists.txt

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22
# Project settings
33
#------------------------------------------------------------------------------#
44

5-
cmake_minimum_required(VERSION 3.9)
5+
cmake_minimum_required(VERSION 3.12)
66
include(CheckLanguage)
77

88
project(VertexCFD LANGUAGES CXX)
9-
check_language(CUDA)
10-
if (CMAKE_CUDA_COMPILER)
11-
enable_language(CUDA)
12-
endif ()
139
set(PROJECT_VERSION "0.0-dev" )
1410

1511
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
@@ -26,6 +22,12 @@ include(GNUInstallDirs)
2622

2723
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
2824

25+
# Set the exodiff path relative to Trilinos installation path
26+
set(EXODIFF_PATH ${Trilinos_ROOT}/bin/exodiff)
27+
28+
# Set the Trilinos lib path relative to Trilinos installation path
29+
set(TRILINOS_LIB ${Trilinos_ROOT}/lib64)
30+
2931
option(NO_PARMETIS_SUPPORT "No parmetis support" ON)
3032
add_compile_definitions(NO_PARMETIS_SUPPORT)
3133

@@ -46,31 +48,19 @@ find_package(YAPF)
4648
find_package(MPI REQUIRED)
4749

4850
find_package(Trilinos REQUIRED)
49-
if (Trilinos_VERSION VERSION_LESS 13 OR Trilinos_VERSION VERSION_GREATER_EQUAL 17)
50-
message(FATAL_ERROR "Incompatible Trilinos version ${Trilinos_VERSION}. Only Trilinos versions 13 and 14 are supported.")
51+
if (Trilinos_VERSION VERSION_LESS 16 OR Trilinos_VERSION VERSION_GREATER_EQUAL 17)
52+
message(FATAL_ERROR "Incompatible Trilinos version ${Trilinos_VERSION}. Only Trilinos version 16 and above are supported.")
5153
endif ()
5254

53-
if (VertexCFD_ENABLE_HYPRE)
54-
find_package(HYPRE REQUIRED)
55-
if (HYPRE_FOUND)
56-
message( STATUS "Found HYPRE: ${HYPRE_DIR}" )
57-
endif()
58-
find_package(HYPREDRV REQUIRED)
59-
if (HYPREDRV_FOUND)
60-
message( STATUS "Found HYPREDrive: ${HYPREDRV_DIR}" )
61-
endif()
62-
add_compile_definitions(VERTEXCFD_HAVE_HYPRE)
55+
# FIXME Tacho requires rocblas, rocsparse, and rocsolver with HIP but doesn't
56+
# enforce this dependency explicitly through version 16.0.0
57+
if(Kokkos_ENABLE_HIP AND NOT (ShyLU_NodeTacho_ENABLE_ROCSOLVER AND ShyLU_NodeTacho_ENABLE_ROCSPARSE AND ShyLU_NodeTacho_ENABLE_ROCBLAS))
58+
message(FATAL_ERROR "ShyLU_NodeTacho wasn't configured with the ROC* TPLs enabled!")
6359
endif()
6460

6561
if (VertexCFD_ENABLE_HYPRE)
6662
find_package(HYPRE REQUIRED)
67-
if (HYPRE_FOUND)
68-
message( STATUS "Found HYPRE: ${HYPRE_DIR}" )
69-
endif()
7063
find_package(HYPREDRV REQUIRED)
71-
if (HYPREDRV_FOUND)
72-
message( STATUS "Found HYPREDrive: ${HYPREDRV_DIR}" )
73-
endif()
7464
add_compile_definitions(VERTEXCFD_HAVE_HYPRE)
7565
endif()
7666

@@ -92,6 +82,8 @@ endif()
9282
# therefore is not accessible here which would have been perferable.
9383
if (Kokkos_ENABLE_CUDA)
9484
set(VERTEXCFD_KOKKOS_DEVICE_TYPE "CUDA")
85+
elseif (Kokkos_ENABLE_HIP)
86+
set(VERTEXCFD_KOKKOS_DEVICE_TYPE "HIP")
9587
elseif (Kokkos_ENABLE_OPENMP)
9688
set(VERTEXCFD_KOKKOS_DEVICE_TYPE "OPENMP")
9789
elseif (Kokkos_ENABLE_SERIAL)
@@ -111,10 +103,6 @@ endif()
111103
# output Phalanx/Panzer device type
112104
message( STATUS "Phalanx/Panzer Kokkos device type: ${VERTEXCFD_KOKKOS_DEVICE_TYPE}" )
113105

114-
if (CMAKE_CUDA_COMPILER)
115-
find_package(CUDAToolkit)
116-
endif ()
117-
118106
#------------------------------------------------------------------------------#
119107
# Tests and Documentation
120108
#------------------------------------------------------------------------------#
@@ -179,6 +167,15 @@ add_subdirectory(examples)
179167

180168
file(COPY regression_test DESTINATION .)
181169

170+
# Delete the unwanted file from the destination
171+
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/regression_test/vertexcfd_test.py.in)
172+
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/regression_test/rename_variables_exodus.py.in)
173+
174+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/regression_test/vertexcfd_test.py.in
175+
${CMAKE_CURRENT_BINARY_DIR}/regression_test/vertexcfd_test.py)
176+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/regression_test/rename_variables_exodus.py.in
177+
${CMAKE_CURRENT_BINARY_DIR}/regression_test/rename_variables_exodus.py)
178+
182179
##---------------------------------------------------------------------------##
183180
## Package Configuration
184181
##---------------------------------------------------------------------------##

0 commit comments

Comments
 (0)