Skip to content

Commit

Permalink
[circleci] Use package managers to get the lit env dependencies.
Browse files Browse the repository at this point in the history
This makes the dependencies handling less manual for lit and FileCheck.
  • Loading branch information
Quentin Colombet authored and qcolombet committed Dec 10, 2018
1 parent f7057e2 commit 65a2d3c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .circleci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ install_pocl() {
cd ../
}

install_lit_env() {
sudo apt-get install -y llvm-6.0-tools
# We could also use `pip install lit` if the package didn't come with
# lit.py.
export PATH="$PATH:/usr/lib/llvm-6.0/build/utils/lit:/usr/lib/llvm-6.0/bin"
hash lit.py FileCheck
}

# setup sccache wrappers
if hash sccache 2>/dev/null; then
SCCACHE_BIN_DIR="/tmp/sccache"
Expand Down Expand Up @@ -63,7 +71,7 @@ if [[ "${CIRCLE_JOB}" == "ASAN" ]]; then
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release")
elif [[ "$CIRCLE_JOB" == RELEASE_WITH_LIT ]]; then
# Setup the LLVM Integrated Tester if requested.
source $GLOW_DIR/utils/set_llvm_test_env.sh
install_lit_env

# Download the models that LIT runs and tell cmake where to find them.
MODELS_DIR="$GLOW_DIR/downloaded_models"
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ else()
endif()

find_program(FILECHECK "FileCheck")
# The lit environment works equally with lit.py from llvm source or
# the python lit package. Check for the other one if lit.py failed.
find_program(LLVM_LIT "lit.py")
if (NOT LLVM_LIT)
find_program(LLVM_LIT "lit")
endif()

if (FILECHECK AND LLVM_LIT)
set(HAS_LLVM_TEST_ENV ON)
Expand Down

0 comments on commit 65a2d3c

Please sign in to comment.