Skip to content

Commit

Permalink
More friendly error msg; Fix Android Demo LLVM ver (apache#3962)
Browse files Browse the repository at this point in the history
  • Loading branch information
junrushao authored and wweic committed Sep 30, 2019
1 parent 25ce696 commit 8ac4294
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ else(MSVC)
set(CMAKE_C_FLAGS "-O2 -Wall -fPIC ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-O2 -Wall -fPIC ${CMAKE_CXX_FLAGS}")
if (HIDE_PRIVATE_SYMBOLS)
message("Hide private symbols...")
message(STATUS "Hide private symbols...")
set(CMAKE_C_FLAGS "-fvisibility=hidden ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-fvisibility=hidden ${CMAKE_CXX_FLAGS}")
endif(HIDE_PRIVATE_SYMBOLS)
Expand Down
16 changes: 16 additions & 0 deletions cmake/util/FindLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,29 @@ macro(find_llvm use_llvm)
message(STATUS "Use llvm-config=" ${LLVM_CONFIG})
separate_arguments(LLVM_CONFIG)
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
RESULT_VARIABLE __llvm_exit_code
OUTPUT_VARIABLE __llvm_libfiles)
if(NOT "${__llvm_exit_code}" STREQUAL "0")
message(FATAL_ERROR "Fatal error executing: ${use_llvm} --libfiles")
endif()
execute_process(COMMAND ${LLVM_CONFIG} --system-libs
RESULT_VARIABLE __llvm_exit_code
OUTPUT_VARIABLE __llvm_system_libs)
if(NOT "${__llvm_exit_code}" STREQUAL "0")
message(FATAL_ERROR "Fatal error executing: ${use_llvm} --system-libs")
endif()
execute_process(COMMAND ${LLVM_CONFIG} --cxxflags
RESULT_VARIABLE __llvm_exit_code
OUTPUT_VARIABLE __llvm_cxxflags)
if(NOT "${__llvm_exit_code}" STREQUAL "0")
message(FATAL_ERROR "Fatal error executing: ${use_llvm} --cxxflags")
endif()
execute_process(COMMAND ${LLVM_CONFIG} --version
RESULT_VARIABLE __llvm_exit_code
OUTPUT_VARIABLE __llvm_version)
if(NOT "${__llvm_exit_code}" STREQUAL "0")
message(FATAL_ERROR "Fatal error executing: ${use_llvm} --version")
endif()
# llvm version
string(REGEX REPLACE "^([^.]+)\.([^.])+\.[^.]+.*$" "\\1\\2" TVM_LLVM_VERSION ${__llvm_version})
# definitions
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.demo_android
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ RUN cd /usr && \
mkdir -p build && \
cd build && \
cmake \
-DUSE_LLVM=llvm-config-6.0 \
-DUSE_LLVM=llvm-config-8 \
-DUSE_RPC=ON \
-DUSE_SORT=ON \
-DUSE_GRAPH_RUNTIME=ON \
Expand Down
2 changes: 1 addition & 1 deletion tutorials/frontend/deploy_model_on_android.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
#
# mkdir build
# cd build
# cmake -DUSE_LLVM=llvm-config-6.0 \
# cmake -DUSE_LLVM=llvm-config-8 \
# -DUSE_RPC=ON \
# -DUSE_SORT=ON \
# -DUSE_VULKAN=ON \
Expand Down

0 comments on commit 8ac4294

Please sign in to comment.