mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-12 16:26:23 +00:00
Donwloading kokkos and installing tbb is now automatic
This commit is contained in:
44
cmake/preReq.cmake
Normal file
44
cmake/preReq.cmake
Normal file
@ -0,0 +1,44 @@
|
||||
if(pFlow_STD_Parallel_Alg)
|
||||
# Check if libtbb-dev is installed
|
||||
execute_process(
|
||||
COMMAND dpkg -s libtbb-dev
|
||||
RESULT_VARIABLE TBB_IS_INSTALLED
|
||||
OUTPUT_QUIET
|
||||
ERROR_QUIET)
|
||||
|
||||
if(NOT TBB_IS_INSTALLED EQUAL 0)
|
||||
message(STATUS "libtbb-dev not found. Installing libtbb-dev...")
|
||||
execute_process(
|
||||
COMMAND sudo apt-get update
|
||||
COMMAND sudo apt-get install -y libtbb-dev
|
||||
RESULT_VARIABLE TBB_INSTALL_RESULT)
|
||||
|
||||
if(NOT TBB_INSTALL_RESULT EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to install libtbb-dev")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "libtbb-dev is already installed.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
cmake_policy(SET CMP0169 OLD)
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
kokkos
|
||||
GIT_REPOSITORY https://github.com/kokkos/kokkos.git
|
||||
GIT_TAG 4.3.01
|
||||
)
|
||||
|
||||
FetchContent_GetProperties(kokkos)
|
||||
if(NOT kokkos_POPULATED)
|
||||
message(STATUS "Kokkos source directory not found. Downloading Kokkos version 4.3.01 ...")
|
||||
FetchContent_Populate(kokkos)
|
||||
set(Kokkos_Source_DIR ${kokkos_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
message(STATUS "Kokkos source directory is ${Kokkos_Source_DIR}")
|
||||
add_subdirectory(${Kokkos_Source_DIR} ./kokkos)
|
||||
#Kokkos_cmake_settings()
|
||||
|
Reference in New Issue
Block a user