From 96b6a63e1c987818b063c38eb2221b40ad4ca39d Mon Sep 17 00:00:00 2001 From: John Demme Date: Thu, 25 Jul 2024 14:21:42 +0000 Subject: [PATCH] [ESI Runtime] Fixing tests and in-tree builds RPATH wasn't effective for CIRCT-rooted builds, leading to test and stub generation failures. Also, one of the tests wasn't updated to a new name. --- integration_test/Dialect/ESI/runtime/loopback.mlir.py | 2 +- lib/Dialect/ESI/runtime/CMakeLists.txt | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/integration_test/Dialect/ESI/runtime/loopback.mlir.py b/integration_test/Dialect/ESI/runtime/loopback.mlir.py index 859ccede98b2..54560fcfe51a 100644 --- a/integration_test/Dialect/ESI/runtime/loopback.mlir.py +++ b/integration_test/Dialect/ESI/runtime/loopback.mlir.py @@ -7,7 +7,7 @@ platform = sys.argv[1] acc = esiaccel.AcceleratorConnection(platform, sys.argv[2]) -hostmem = acc.get_host_memory() +hostmem = acc.get_service_hostmem() if hostmem is not None: mem1 = hostmem.allocate(1024) assert mem1.size == 1024 diff --git a/lib/Dialect/ESI/runtime/CMakeLists.txt b/lib/Dialect/ESI/runtime/CMakeLists.txt index 03cfb079c842..6fe135910f23 100644 --- a/lib/Dialect/ESI/runtime/CMakeLists.txt +++ b/lib/Dialect/ESI/runtime/CMakeLists.txt @@ -31,7 +31,8 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED YES) set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib") set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) -set(CMAKE_BUILD_RPATH "$ORIGIN/../lib") +set(CMAKE_BUILD_RPATH + "${CMAKE_BUILD_RPATH}:${CMAKE_BINARY_DIR}/lib:$ORIGIN/../lib") # JSON parser for the manifest. if (NOT TARGET nlohmann_json) @@ -274,10 +275,10 @@ if(Python3_FOUND) add_custom_command( TARGET esiCppAccel POST_BUILD - COMMAND ${CMAKE_COMMAND} -E env "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}" + COMMAND ${CMAKE_COMMAND} -E env "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}/python" python -m pybind11_stubgen -o "${CMAKE_CURRENT_BINARY_DIR}/python/esiaccel" - esiCppAccel + esiaccel.esiCppAccel ) else() message(STATUS "pybind11_stubgen not found. Skipping stub generation.")