From 91240ba02934429f41a2a62e32faa1d4c4fe8bfa Mon Sep 17 00:00:00 2001 From: Erika Hunhoff Date: Mon, 21 Oct 2024 11:30:55 -0600 Subject: [PATCH] Set build target in util/build... scripts. (#1860) --- utils/build-llvm-local.sh | 4 +++- utils/build-mlir-aie.sh | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/utils/build-llvm-local.sh b/utils/build-llvm-local.sh index 6b914cb48e..2df912ac92 100755 --- a/utils/build-llvm-local.sh +++ b/utils/build-llvm-local.sh @@ -15,12 +15,14 @@ # - optional, default is 'llvm' # - optional, default is 'build' (for llvm/build) # - optional, default is 'install' (for llvm/install) +# - optional, default is 'X86' # ##===----------------------------------------------------------------------===## LLVM_DIR=${1:-"llvm"} BUILD_DIR=${2:-"build"} INSTALL_DIR=${3:-"install"} +BUILD_TARGET=${4:-"X86"} mkdir -p $LLVM_DIR/$BUILD_DIR mkdir -p $LLVM_DIR/$INSTALL_DIR @@ -44,7 +46,7 @@ CMAKE_CONFIGS="\ -DMLIR_ENABLE_BINDINGS_PYTHON=ON \ -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR \ -DLLVM_ENABLE_PROJECTS=mlir \ - -DLLVM_TARGETS_TO_BUILD:STRING=X86;ARM;AArch64 \ + -DLLVM_TARGETS_TO_BUILD:STRING=$BUILD_TARGET \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON \ -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \ diff --git a/utils/build-mlir-aie.sh b/utils/build-mlir-aie.sh index f395d3ae0a..e51dcd26db 100755 --- a/utils/build-mlir-aie.sh +++ b/utils/build-mlir-aie.sh @@ -15,6 +15,7 @@ # # - optional, mlir-aie/build dir name, default is 'build' # - optional, mlir-aie/install dir name, default is 'install' +# - optional, target to build for, default is 'x86_64' # ##===----------------------------------------------------------------------===## @@ -31,6 +32,7 @@ echo "LLVM BUILD DIR: $LLVM_BUILD_DIR" BUILD_DIR=${2:-"build"} INSTALL_DIR=${3:-"install"} +BUILD_TARGET=${4:-"x86_64"} LLVM_ENABLE_RTTI=${LLVM_ENABLE_RTTI:OFF} mkdir -p $BUILD_DIR @@ -52,9 +54,9 @@ CMAKE_CONFIGS="\ -DCMAKE_CXX_VISIBILITY_PRESET=hidden \ -DLLVM_ENABLE_ASSERTIONS=ON \ -DLLVM_ENABLE_RTTI=$LLVM_ENABLE_RTTI \ - -DAIE_RUNTIME_TARGETS=x86_64;aarch64 \ + -DAIE_RUNTIME_TARGETS=$BUILD_TARGET \ -DAIE_ENABLE_PYTHON_PASSES=OFF \ - -DAIE_RUNTIME_TEST_TARGET=aarch64" + -DAIE_RUNTIME_TEST_TARGET=$BUILD_TARGET" if [ -x "$(command -v lld)" ]; then CMAKE_CONFIGS="${CMAKE_CONFIGS} -DLLVM_USE_LINKER=lld"