Skip to content

Commit

Permalink
add user-friendly compiler checks to the CMakelists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
haichangsi committed Nov 7, 2023
1 parent 7db7b6c commit 86368b2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,25 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)

project(
distributed_ranges_tutorial
LANGUAGES CXX
VERSION 0.1
DESCRIPTION "Distributed ranges tutorial")

if(NOT DEFINED ENV{CXX})
message(FATAL_ERROR "CXX environment variable is not defined")
endif()

if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "IntelLLVM")
message(FATAL_ERROR "ICPX compiler is required. Please set CXX to icpx.")
endif()

include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-fsycl COMPILER_SUPPORTS_FSYCL)

if(NOT COMPILER_SUPPORTS_FSYCL)
message(FATAL_ERROR "A compiler with SYCL support is required.")
endif()

find_package(MPI REQUIRED)

add_subdirectory(src)
Expand Down

0 comments on commit 86368b2

Please sign in to comment.