From 2fd3ceb2c36ff4da2c24a610733c5e8e2025a2c8 Mon Sep 17 00:00:00 2001 From: Charlie Lye Date: Tue, 3 Oct 2023 19:27:00 +0000 Subject: [PATCH] Make target architecture configurable, target westmere in GA. --- .github/workflows/publish-bb.yml | 2 +- barretenberg/cpp/CMakePresets.json | 26 +++++++++++++++----------- barretenberg/cpp/cmake/arch.cmake | 3 ++- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish-bb.yml b/.github/workflows/publish-bb.yml index 28ddb777e5b..00fa792ba6a 100644 --- a/.github/workflows/publish-bb.yml +++ b/.github/workflows/publish-bb.yml @@ -51,7 +51,7 @@ jobs: run: | cd barretenberg/cpp - cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert + cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert -DTARGET_ARCH=westmere cmake --build --preset default --target bb - name: Tar and GZip bb Binary (Ubuntu) diff --git a/barretenberg/cpp/CMakePresets.json b/barretenberg/cpp/CMakePresets.json index 0b50ba0871c..ec0889e64eb 100644 --- a/barretenberg/cpp/CMakePresets.json +++ b/barretenberg/cpp/CMakePresets.json @@ -16,6 +16,9 @@ "CC": "clang", "CXX": "clang++", "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" + }, + "cacheVariables": { + "TARGET_ARCH": "skylake" } }, { @@ -51,20 +54,20 @@ "DISABLE_ASM": "ON" } }, - {"name":"asan", - "displayName": "Debugging build with address sanitizer on Clang-16", - "description": "Build with address sanitizer on clang16 with debugging information", - "inherits":"clang16-dbg", + { + "name": "asan", + "displayName": "Debugging build with address sanitizer on Clang-16", + "description": "Build with address sanitizer on clang16 with debugging information", + "inherits": "clang16-dbg", "binaryDir": "build-asan", -"environment": { + "environment": { "CMAKE_BUILD_TYPE": "Debug" }, "cacheVariables": { "ENABLE_ASAN": "ON", - "DISABLE_ASM": "ON" + "DISABLE_ASM": "ON" } - -}, + }, { "name": "gcc", "displayName": "Build with GCC", @@ -193,7 +196,8 @@ "name": "clang16-dbg", "inherits": "default", "configurePreset": "clang16-dbg" - },{ + }, + { "name": "asan", "inherits": "default", "configurePreset": "asan" @@ -218,7 +222,7 @@ "inherits": "clang16", "configurePreset": "fuzzing" }, - { + { "name": "smt-verification", "inherits": "clang16", "configurePreset": "smt-verification" @@ -278,7 +282,7 @@ "inherits": "default", "configurePreset": "clang16-dbg" }, - { + { "name": "asan", "inherits": "default", "configurePreset": "asan" diff --git a/barretenberg/cpp/cmake/arch.cmake b/barretenberg/cpp/cmake/arch.cmake index 1812e8eb3ed..7d517c88ad7 100644 --- a/barretenberg/cpp/cmake/arch.cmake +++ b/barretenberg/cpp/cmake/arch.cmake @@ -6,5 +6,6 @@ if(WASM) endif() if(NOT WASM AND NOT APPLE AND NOT ARM) - add_compile_options(-march=skylake) + message(STATUS "Target architecture: ${TARGET_ARCH}") + add_compile_options(-march=${TARGET_ARCH}) endif()