[ESI Runtime] Distribute headers along with wheel (#7400)

- 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
This commit is contained in:
John Demme 2024-07-29 10:20:34 -07:00 committed by GitHub
parent 01d98e8fa0
commit 660c6d41e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 24 additions and 17 deletions

View File

@ -70,7 +70,7 @@ jobs:
if: runner.os != 'Windows' if: runner.os != 'Windows'
env: env:
CIBW_BUILD: ${{ matrix.config.cibw_build }} 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 SETUPTOOLS_SCM_DEBUG: True
run: python -m cibuildwheel --output-dir wheelhouse ./lib/Dialect/ESI/runtime run: python -m cibuildwheel --output-dir wheelhouse ./lib/Dialect/ESI/runtime

View File

@ -177,12 +177,12 @@ install(RUNTIME_DEPENDENCY_SET ESICppRuntime_RUNTIME_DEPS
) )
install(FILES ${ESICppRuntimeHeaders} install(FILES ${ESICppRuntimeHeaders}
DESTINATION include/esi 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 DESTINATION cmake
COMPONENT ESIRuntime-dev COMPONENT ESIRuntime
) )
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
@ -460,5 +460,5 @@ endif()
install(FILES ${ESICppRuntimeBackendHeaders} install(FILES ${ESICppRuntimeBackendHeaders}
DESTINATION include/esi/backends DESTINATION include/esi/backends
COMPONENT ESIRuntime-dev COMPONENT ESIRuntime
) )

View File

@ -1,12 +0,0 @@
function(add_esiaccel_flags TARGET)
message("-- Adding ESI runtime flags to target ${TARGET}")
target_include_directories(${TARGET}
PUBLIC
"${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../include"
)
file(GLOB ESI_LIBS ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../lib/*)
target_link_libraries(${TARGET}
PUBLIC
${ESI_LIBS}
)
endfunction()

View File

@ -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()

View File

@ -24,3 +24,7 @@ def run_esi_cosim():
cosim_import = importlib.util.module_from_spec(spec) cosim_import = importlib.util.module_from_spec(spec)
spec.loader.exec_module(cosim_import) spec.loader.exec_module(cosim_import)
return cosim_import.__main__(sys.argv) return cosim_import.__main__(sys.argv)
def get_cmake_dir():
return _thisdir / "cmake"