Fix check-onnx-backend build on x86 Linux. (#91)

This commit is contained in:
gongsu832 2020-04-16 02:38:52 -04:00 committed by GitHub
parent 46ef7996f7
commit 72de6eb004
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -62,7 +62,7 @@ function(find_mlir_lib lib)
PATHS ${LLVM_PROJECT_LIB} PATHS ${LLVM_PROJECT_LIB}
NO_DEFAULT_PATH) NO_DEFAULT_PATH)
if(${${lib}} STREQUAL ${lib}-NOTFOUND) if(${${lib}} STREQUAL ${lib}-NOTFOUND)
message(FATAL_ERROR "${lib} not found") message(FATAL_ERROR "${lib} not found, did you forget to build llvm-project?")
endif() endif()
endfunction(find_mlir_lib) endfunction(find_mlir_lib)

View File

@ -1,4 +1,6 @@
add_library(cruntime # Create shared libcruntime.so since model.so linkage for backend tests
# will fail on x86 Linux if cruntime is statically linked.
add_library(cruntime SHARED
DynMemRef.cpp DynMemRef.cpp
DynMemRef.h DynMemRef.h
DataType.h) DataType.h)

View File

@ -3,7 +3,7 @@ configure_file(test_config.py.in test_config.py)
find_package(PythonInterp 3 REQUIRED) find_package(PythonInterp 3 REQUIRED)
add_custom_target(check-onnx-backend add_custom_target(check-onnx-backend
COMMAND ${PYTHON_EXECUTABLE} COMMAND LD_PRELOAD=${CMAKE_BINARY_DIR}/lib/libcruntime.so ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_BINARY_DIR}/test.py) ${CMAKE_CURRENT_BINARY_DIR}/test.py)
add_dependencies(check-onnx-backend onnx-mlir) add_dependencies(check-onnx-backend onnx-mlir)