Skip to content

Commit

Permalink
chore: Conservatively raise the minimum supported clang version in CM…
Browse files Browse the repository at this point in the history
…akeList (#2023)

When using the default preset, if my clang version is 10 for example,
barretenberg will fail to build because the minimum supported version is
now 16.

This updates it in CmakeList. gcc has not been changed because
[according to this](https://gcc.gnu.org/projects/cxx-status.html) GCC
version 10 supports concepts which was the reason we had to raise the
minimum supported clang version.
  • Loading branch information
kevaundray authored Sep 6, 2023
1 parent 28a877b commit f49c416
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions circuits/cpp/barretenberg/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if(FUZZING)
endif()

if(UNDEFINED_BEHAVIOUR_SANITIZER)
set(SANITIZER_OPTIONS ${SANITIZER_OPTIONS} -fsanitize=undefined -fno-sanitize=alignment)
set(SANITIZER_OPTIONS ${SANITIZER_OPTIONS} -fsanitize=undefined -fno-sanitize=alignment)
endif()

add_compile_options(-fsanitize=fuzzer-no-link ${SANITIZER_OPTIONS})
Expand Down Expand Up @@ -81,15 +81,15 @@ set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS ON)

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10")
message(WARNING "Clang <10 is not supported")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "14")
message(WARNING "Clang <14 is not supported")
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10")
message(WARNING "GCC <10 is not supported")
endif()
else()
message(WARNING "Unsuported compiler, use Clang >10 or GCC >10")
message(WARNING "Unsuported compiler, use Clang >14 or GCC >10")
endif()

if(COVERAGE)
Expand All @@ -105,13 +105,15 @@ if(COVERAGE)
# Find llvm-profdata
set(PROFDATA_EXECUTABLE_NAME "llvm-profdata-${CLANG_VERSION_MAJOR}")
find_program(PROFDATA_EXECUTABLE ${PROFDATA_EXECUTABLE_NAME})

if(PROFDATA_EXECUTABLE MATCHES "NOTFOUND")
message(FATAL_ERROR "Couldn't find ${PROFDATA_EXECUTABLE_NAME}")
endif()

# Find llvm-cov
set(COV_EXECUTABLE_NAME "llvm-cov-${CLANG_VERSION_MAJOR}")
find_program(COV_EXECUTABLE ${COV_EXECUTABLE_NAME})

if(COV_EXECUTABLE MATCHES "NOTFOUND")
message(FATAL_ERROR "Couldn't find ${COV_EXECUTABLE_NAME}")
endif()
Expand All @@ -121,12 +123,11 @@ if(COVERAGE)

# Add a custom target for creating the report
add_custom_target(create_full_coverage_report
COMMAND "${CMAKE_SOURCE_DIR}/scripts/collect_coverage_information.sh" ${PROFDATA_EXECUTABLE} ${COV_EXECUTABLE}
VERBATIM
COMMAND "${CMAKE_SOURCE_DIR}/scripts/collect_coverage_information.sh" ${PROFDATA_EXECUTABLE} ${COV_EXECUTABLE}
VERBATIM
)
endif()


include(cmake/build.cmake)
include(GNUInstallDirs)
include(cmake/arch.cmake)
Expand Down

0 comments on commit f49c416

Please sign in to comment.