Commit a3073457 by Junru Shao Committed by Tianqi Chen

More friendly error msg; Fix Android Demo LLVM ver (#3962)

parent 3edf5260
......@@ -101,7 +101,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)
......
......@@ -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
......
......@@ -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 \
......
......@@ -66,7 +66,7 @@ from tvm.contrib.download import download_testdata
#
# 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 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment