diff --git a/MLIR.cmake b/MLIR.cmake index c9c5198..873c480 100644 --- a/MLIR.cmake +++ b/MLIR.cmake @@ -62,7 +62,7 @@ function(find_mlir_lib lib) PATHS ${LLVM_PROJECT_LIB} NO_DEFAULT_PATH) 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() endfunction(find_mlir_lib) diff --git a/src/Runtime/CMakeLists.txt b/src/Runtime/CMakeLists.txt index 7cc2a91..d091d70 100644 --- a/src/Runtime/CMakeLists.txt +++ b/src/Runtime/CMakeLists.txt @@ -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.h DataType.h) diff --git a/test/backend/CMakeLists.txt b/test/backend/CMakeLists.txt index a370170..39075b3 100644 --- a/test/backend/CMakeLists.txt +++ b/test/backend/CMakeLists.txt @@ -3,7 +3,7 @@ configure_file(test_config.py.in test_config.py) find_package(PythonInterp 3 REQUIRED) 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) add_dependencies(check-onnx-backend onnx-mlir)