Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default to clang for faster CPU performance #666

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion icicle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ project(icicle)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# Select the C++ compiler
find_program(CLANG_COMPILER clang++)
find_program(CLANG_C_COMPILER clang)

if(CLANG_COMPILER AND CLANG_C_COMPILER)
set(CMAKE_CXX_COMPILER ${CLANG_COMPILER} CACHE STRING "Clang++ compiler" FORCE)
set(CMAKE_C_COMPILER ${CLANG_C_COMPILER} CACHE STRING "Clang compiler" FORCE)
message(STATUS "Using Clang++ as the C++ compiler: ${CLANG_COMPILER}")
message(STATUS "Using Clang as the C compiler: ${CLANG_C_COMPILER}")
else()
message(WARNING "ICICLE CPU works best with clang++ and clang. Defaulting to ${CLANG_COMPILER}")
endif()



include(cmake/field.cmake)
include(cmake/curve.cmake)
include(cmake/hash.cmake)
Expand All @@ -19,7 +34,7 @@ endif()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")

# Prevent build if both SANITIZE and CUDA_BACKEND are enabled
if(SANITIZE AND CUDA_BACKEND)
if(SANITIZE AND CUDA_BACKEND)
message(FATAL_ERROR "Address sanitizer and Cuda cannot be enabled at the same time.")
endif()

Expand Down
Loading