Skip to content

Commit

Permalink
Apply fixes based on CI logs
Browse files Browse the repository at this point in the history
onnxruntime_providers_qnn needs to be exported for
static builds.

ABSL_ENABLE_INSTALL option conflicts with using
XNNPACK.

Static builds with training enabled were failing
because of missing tensorboard exports.
As tensorboard has no CMake scripts, add them.
  • Loading branch information
jordanozang committed Oct 16, 2024
1 parent 59477fd commit bbebf04
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmake/external/abseil-cpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ set(BUILD_TESTING 0)
set(ABSL_BUILD_TESTING OFF)
set(ABSL_BUILD_TEST_HELPERS OFF)
set(ABSL_USE_EXTERNAL_GOOGLETEST ON)
set(ABSL_ENABLE_INSTALL ON)

# Both abseil and xnnpack create a target called memory, which
# results in a duplicate target if ABSL_ENABLE_INSTALL is on.
if (onnxruntime_USE_XNNPACK)
set(ABSL_ENABLE_INSTALL OFF)
else()
set(ABSL_ENABLE_INSTALL ON)
endif()

if(Patch_FOUND AND WIN32)
set(ABSL_PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/abseil/absl_windows.patch)
Expand Down
8 changes: 8 additions & 0 deletions cmake/onnxruntime_providers_qnn.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,11 @@
if(NOT MSVC)
target_compile_options(onnxruntime_providers_qnn PRIVATE "-Wno-unknown-pragmas")
endif()

if (NOT onnxruntime_BUILD_SHARED_LIB)
install(TARGETS onnxruntime_providers_qnn EXPORT ${PROJECT_NAME}Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
FRAMEWORK DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
7 changes: 7 additions & 0 deletions cmake/tensorboard/compat/proto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ add_dependencies(tensorboard ${onnxruntime_EXTERNAL_DEPENDENCIES})
if(WIN32)
target_compile_options(tensorboard PRIVATE "/wd4100" "/wd4125" "/wd4127" "/wd4267" "/wd4456" "/wd4800" "/wd6011" "/wd6387" "/wd28182")
endif()

if (NOT onnxruntime_BUILD_SHARED_LIB)
install(TARGETS tensorboard EXPORT ${PROJECT_NAME}Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()

0 comments on commit bbebf04

Please sign in to comment.