From 87815d7e0c6182973d98155c23d2f60b7c66314c Mon Sep 17 00:00:00 2001 From: Alex Orlow Date: Tue, 22 Aug 2023 10:34:57 -0400 Subject: [PATCH] chore: update bootstrap.sh in Barretenberg to check for clang 16 (#1717) As per #1542 clang 16 is needed so a proposed solution is to check version in bootstrap.sh --------- Co-authored-by: ludamad --- circuits/cpp/barretenberg/cpp/bootstrap.sh | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/circuits/cpp/barretenberg/cpp/bootstrap.sh b/circuits/cpp/barretenberg/cpp/bootstrap.sh index e9f41cba246..9d2d0bbcdf2 100755 --- a/circuits/cpp/barretenberg/cpp/bootstrap.sh +++ b/circuits/cpp/barretenberg/cpp/bootstrap.sh @@ -1,5 +1,26 @@ #!/bin/bash -set -eu +set -u + +# Get the clang version string +clang_version_string=$(clang --version 2>/dev/null) + +# Check if clang is installed +if [ $? -ne 0 ]; then + echo "Error: clang is not installed." + exit 1 +fi + +# Extract the major version number +major_version=$(echo $clang_version_string | awk -F' ' '/clang version/{print $3}' | awk -F'.' '{print $1}') + +if [ "$major_version" -ge 16 ]; then + echo "clang version $major_version is good." +else + echo "Error: clang version 16 or greater is required." + exit 1 +fi + +set -e # Clean. rm -rf ./build