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