Skip to content

Commit

Permalink
[ESI Runtime] Distribute headers along with wheel (#7400)
Browse files Browse the repository at this point in the history
- Include headers in Python wheel
- Bump the Linux wheel build image to avoid _GLIBCXX_USE_CXX11_ABI
  linking issues
- Add cmake file which exports built library
  • Loading branch information
teqdruid authored Jul 29, 2024
1 parent 01d98e8 commit 660c6d4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/esiRuntimePublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
if: runner.os != 'Windows'
env:
CIBW_BUILD: ${{ matrix.config.cibw_build }}
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/circt/images/pycde-build
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/circt/images/esiruntime-wheel
SETUPTOOLS_SCM_DEBUG: True
run: python -m cibuildwheel --output-dir wheelhouse ./lib/Dialect/ESI/runtime

Expand Down
8 changes: 4 additions & 4 deletions lib/Dialect/ESI/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ install(RUNTIME_DEPENDENCY_SET ESICppRuntime_RUNTIME_DEPS
)
install(FILES ${ESICppRuntimeHeaders}
DESTINATION include/esi
COMPONENT ESIRuntime-dev
COMPONENT ESIRuntime
)

install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/cmake/esiaccel.cmake
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/cmake/esiaccelConfig.cmake
DESTINATION cmake
COMPONENT ESIRuntime-dev
COMPONENT ESIRuntime
)

if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
Expand Down Expand Up @@ -460,5 +460,5 @@ endif()

install(FILES ${ESICppRuntimeBackendHeaders}
DESTINATION include/esi/backends
COMPONENT ESIRuntime-dev
COMPONENT ESIRuntime
)
12 changes: 0 additions & 12 deletions lib/Dialect/ESI/runtime/cpp/cmake/esiaccel.cmake

This file was deleted.

15 changes: 15 additions & 0 deletions lib/Dialect/ESI/runtime/cpp/cmake/esiaccelConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
add_library(esiaccel::ESICppRuntime SHARED IMPORTED)
set_target_properties(esiaccel::ESICppRuntime PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/../include"
)

if(WIN32)
set_target_properties(esiaccel::ESICppRuntime PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_LIST_DIR}/../ESICppRuntime.dll"
IMPORTED_IMPLIB "${CMAKE_CURRENT_LIST_DIR}/../ESICppRuntime.lib"
)
else()
set_target_properties(esiaccel::ESICppRuntime PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_LIST_DIR}/../lib/ESICppRuntime.so"
)
endif()
4 changes: 4 additions & 0 deletions lib/Dialect/ESI/runtime/python/esiaccel/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ def run_esi_cosim():
cosim_import = importlib.util.module_from_spec(spec)
spec.loader.exec_module(cosim_import)
return cosim_import.__main__(sys.argv)


def get_cmake_dir():
return _thisdir / "cmake"

0 comments on commit 660c6d4

Please sign in to comment.