diff --git a/.buildbot/z13.sh b/.buildbot/z13.sh index c5361fa..3b9b2b5 100755 --- a/.buildbot/z13.sh +++ b/.buildbot/z13.sh @@ -69,6 +69,7 @@ LLVM_PROJ_SRC=${LLVM_PROJECT_ROOT} \ LLVM_PROJ_BUILD=${LLVM_PROJECT_ROOT}/build \ cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} .. \ -make -j$(nproc) onnx-mlir +make -j$(nproc) make -j$(nproc) check-onnx-lit RUNTIME_DIR=$(pwd)/lib make -j$(nproc) check-onnx-backend +RUNTIME_DIR=$(pwd)/lib PATH=$(pwd)/bin:$PATH make -j$(nproc) test diff --git a/src/Runtime/CMakeLists.txt b/src/Runtime/CMakeLists.txt index 410473d..4f3cc9d 100644 --- a/src/Runtime/CMakeLists.txt +++ b/src/Runtime/CMakeLists.txt @@ -1,9 +1,13 @@ -# Create shared libcruntime.so since model.so linkage for backend tests -# will fail on x86 Linux if cruntime is statically linked. +# Create static libcruntime.a to be embedded in model.so to make model.so self contained. +# However, by default object code for static library is not compiled with -fPIC. Embedding +# such static library in a shared library can cause runtime failure on some architectures, +# such as z. So we override the default and explicitly compile with -fPIC. add_library(cruntime STATIC RtMemRef.cpp RtMemRef.h DataType.h) +set_target_properties(cruntime PROPERTIES + POSITION_INDEPENDENT_CODE TRUE) add_library(RtMemRefUtils RtMemRef.h @@ -35,6 +39,7 @@ target_include_directories(PyRuntime PRIVATE ${ONNX_MLIR_BIN_ROOT} ${ONNX_MLIR_SRC_ROOT}) +# See comments above about libcruntime.a add_library(EmbeddedDataLoader STATIC GetEmbeddedConstPool.h GetEmbeddedConstPool.cpp)