Cleanup build instructions/scripts

pull/1/head
Stella Laurenzo 2020-04-29 17:05:45 -07:00
parent 03cf785bae
commit f174c0557b
2 changed files with 15 additions and 5 deletions

View File

@ -29,6 +29,8 @@ export LLVM_SRC_DIR=/path/to/llvm-project
cd build cd build
ninja ninja
ninja check-npcomp-opt
# Note: currently, python tests run separately
./python/run_tests.py ./python/run_tests.py
``` ```

View File

@ -1,16 +1,20 @@
#!/bin/bash #!/bin/bash
set -e set -e
td="$(realpath $(dirname $0)/..)"
# Find LLVM source. # Find LLVM source (assumes it is adjacent to this directory).
if [ -z "$LLVM_SRC_DIR" ] || ! [ -f "$LLVM_SRC_DIR/llvm/CMakeLists.txt" ]; then if [ -z "$LLVM_SRC_DIR" ]; then
LLVM_SRC_DIR="$td/../llvm-project"
fi
LLVM_SRC_DIR="$(realpath "$LLVM_SRC_DIR")"
if ! [ -f "$LLVM_SRC_DIR/llvm/CMakeLists.txt" ]; then
echo "Expected LLVM_SRC_DIR variable to be set correctly (got '$LLVM_SRC_DIR')" echo "Expected LLVM_SRC_DIR variable to be set correctly (got '$LLVM_SRC_DIR')"
exit 1 exit 1
fi fi
LLVM_SRC_DIR="$(realpath "$LLVM_SRC_DIR")"
echo "Using LLVM source dir: $LLVM_SRC_DIR" echo "Using LLVM source dir: $LLVM_SRC_DIR"
# Setup directories. # Setup directories.
td="$(realpath $(dirname $0)/..)"
build_mlir="$td/build-mlir" build_mlir="$td/build-mlir"
install_mlir="$td/install-mlir" install_mlir="$td/install-mlir"
echo "Building MLIR in $build_mlir" echo "Building MLIR in $build_mlir"
@ -26,9 +30,13 @@ cmake -GNinja \
"-B$build_mlir" \ "-B$build_mlir" \
-DLLVM_INSTALL_UTILS=ON \ -DLLVM_INSTALL_UTILS=ON \
-DLLVM_ENABLE_PROJECTS=mlir \ -DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_TARGETS_TO_BUILD="X86;AArch64" \
-DLLVM_INCLUDE_TOOLS=ON \
-DLLVM_BUILD_TOOLS=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
"-DCMAKE_INSTALL_PREFIX=$install_mlir" \ "-DCMAKE_INSTALL_PREFIX=$install_mlir" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DLLVM_ENABLE_ASSERTIONS=On \ -DLLVM_ENABLE_ASSERTIONS=On \
cmake --build "$build_mlir"
cmake --build "$build_mlir" --target install cmake --build "$build_mlir" --target install
#cmake --build "$build_mlir" --target install