Skip to content

Commit

Permalink
clean build scripts #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Valery Chernov committed Feb 10, 2022
1 parent 8c47481 commit 0fd41c1
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ endif()
if (onnxruntime_USE_TVM)
list(APPEND ORT_PROVIDER_FLAGS -DUSE_TVM=1)
list(APPEND ORT_PROVIDER_CMAKE_FLAGS -Donnxruntime_USE_TVM=1)
list(APPEND ONNXRUNTIME_PROVIDER_NAMES stvm)
list(APPEND ONNXRUNTIME_PROVIDER_NAMES tvm)
endif()
if (onnxruntime_USE_WINML)
list(APPEND ORT_PROVIDER_FLAGS -DUSE_WINML=1)
Expand Down
2 changes: 1 addition & 1 deletion cmake/onnxruntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ set(onnxruntime_INTERNAL_LIBRARIES
${PROVIDERS_DML}
${PROVIDERS_NNAPI}
${PROVIDERS_NUPHAR}
${PROVIDERS_STVM}
${PROVIDERS_TVM}
${PROVIDERS_RKNPU}
${PROVIDERS_ROCM}
${PROVIDERS_VITISAI}
Expand Down
30 changes: 15 additions & 15 deletions cmake/onnxruntime_providers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1281,38 +1281,38 @@ if (onnxruntime_USE_TVM)
endif()
add_definitions(-DUSE_TVM=1)

file (GLOB_RECURSE onnxruntime_providers_stvm_cc_srcs CONFIGURE_DEPENDS
file (GLOB_RECURSE onnxruntime_providers_tvm_cc_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/tvm/*.h"
"${ONNXRUNTIME_ROOT}/core/providers/tvm/*.cc"
)
source_group(TREE ${ONNXRUNTIME_ROOT}/core FILES ${onnxruntime_providers_stvm_cc_srcs})
onnxruntime_add_static_library(onnxruntime_providers_stvm ${onnxruntime_providers_stvm_cc_srcs})
source_group(TREE ${ONNXRUNTIME_ROOT}/core FILES ${onnxruntime_providers_tvm_cc_srcs})
onnxruntime_add_static_library(onnxruntime_providers_tvm ${onnxruntime_providers_tvm_cc_srcs})

if ( CMAKE_COMPILER_IS_GNUCC )
target_compile_options(onnxruntime_providers_stvm PRIVATE -Wno-unused-parameter -Wno-missing-field-initializers)
target_compile_options(onnxruntime_providers_tvm PRIVATE -Wno-unused-parameter -Wno-missing-field-initializers)
endif()

target_include_directories(onnxruntime_providers_stvm PRIVATE
${onnxruntime_STVM_HOME}/include
${onnxruntime_STVM_HOME}/3rdparty/dlpack/include
${onnxruntime_STVM_HOME}/3rdparty/dmlc-core/include
target_include_directories(onnxruntime_providers_tvm PRIVATE
${onnxruntime_TVM_HOME}/include
${onnxruntime_TVM_HOME}/3rdparty/dlpack/include
${onnxruntime_TVM_HOME}/3rdparty/dmlc-core/include
${PYTHON_INLCUDE_DIRS})
onnxruntime_add_include_to_target(onnxruntime_providers_stvm onnxruntime_common onnx tvm)
onnxruntime_add_include_to_target(onnxruntime_providers_tvm onnxruntime_common onnx tvm)

add_dependencies(onnxruntime_providers_stvm ${onnxruntime_EXTERNAL_DEPENDENCIES})
add_dependencies(onnxruntime_providers_tvm ${onnxruntime_EXTERNAL_DEPENDENCIES})

target_link_libraries(onnxruntime_providers_stvm PRIVATE
target_link_libraries(onnxruntime_providers_tvm PRIVATE
onnx
tvm
onnxruntime_common
onnxruntime_framework
)

set_target_properties(onnxruntime_providers_stvm PROPERTIES FOLDER "ONNXRuntime")
set_target_properties(onnxruntime_providers_stvm PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(onnxruntime_providers_tvm PROPERTIES FOLDER "ONNXRuntime")
set_target_properties(onnxruntime_providers_tvm PROPERTIES LINKER_LANGUAGE CXX)

target_compile_options(onnxruntime_providers_stvm PRIVATE -Wno-error=type-limits)
target_compile_definitions(onnxruntime_providers_stvm PUBLIC DMLC_USE_LOGGING_LIBRARY=<tvm/runtime/logging.h>)
target_compile_options(onnxruntime_providers_tvm PRIVATE -Wno-error=type-limits)
target_compile_definitions(onnxruntime_providers_tvm PUBLIC DMLC_USE_LOGGING_LIBRARY=<tvm/runtime/logging.h>)

install(DIRECTORY ${PROJECT_SOURCE_DIR}/../include/onnxruntime/core/providers/tvm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnxruntime/core/providers)
endif()
4 changes: 2 additions & 2 deletions cmake/onnxruntime_python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ target_link_libraries(onnxruntime_pybind11_state PRIVATE
onnxruntime_session
${onnxruntime_libs}
${PROVIDERS_NUPHAR}
${PROVIDERS_STVM}
${PROVIDERS_TVM}
${PROVIDERS_VITISAI}
${PROVIDERS_NNAPI}
${PROVIDERS_COREML}
Expand Down Expand Up @@ -674,7 +674,7 @@ if (onnxruntime_USE_TVM)
${onnxruntime_python_providers_stvm_srcs}
$<TARGET_FILE_DIR:${build_output_target}>/onnxruntime/providers/stvm
COMMAND ${CMAKE_COMMAND} -E copy
$<TARGET_FILE:onnxruntime_providers_stvm>
$<TARGET_FILE:onnxruntime_providers_tvm>
$<TARGET_FILE_DIR:${build_output_target}>/onnxruntime/capi/
COMMAND ${CMAKE_COMMAND} -E copy
${tvm_BINARY_DIR}/libtvm*
Expand Down
6 changes: 3 additions & 3 deletions cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ set(ONNXRUNTIME_TEST_LIBS
${PROVIDERS_ACL}
${PROVIDERS_ARMNN}
${PROVIDERS_COREML}
# ${PROVIDERS_STVM}
# ${PROVIDERS_TVM}
onnxruntime_optimizer
onnxruntime_providers
onnxruntime_util
Expand Down Expand Up @@ -556,7 +556,7 @@ if (onnxruntime_USE_TVM)
"${ONNXRUNTIME_ROOT}/test/stvm/*.cc"
)

list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_stvm)
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_tvm)
endif()

if(WIN32)
Expand Down Expand Up @@ -1288,7 +1288,7 @@ if (NOT onnxruntime_MINIMAL_BUILD AND NOT onnxruntime_EXTENDED_MINIMAL_BUILD
endif()

if (onnxruntime_USE_TVM)
# find_library(STVM_LIBS NAMES libtvm.so PATHS ${onnxruntime_STVM_HOME}/lib)
# find_library(STVM_LIBS NAMES libtvm.so PATHS ${onnxruntime_TVM_HOME}/lib)
# link_directories(onnxruntime_test_all ${STVM_LIBS})
find_library(PYTHON_LIBS NAMES libpython PATHS /usr/local/lib)
#target_link_libraries(onnxruntime_test_all PRIVATE ${PYTHON_LIBRARIES} -lutil)
Expand Down
2 changes: 1 addition & 1 deletion tools/ci_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,7 @@ def build_nuget_package(source_dir, build_dir, configs, use_cuda, use_openvino,
elif use_nuphar:
package_name = "/p:OrtPackageId=\"Microsoft.ML.OnnxRuntime.Nuphar\""
elif use_tvm:
package_name = "/p:OrtPackageId=\"Microsoft.ML.OnnxRuntime.Stvm\""
package_name = "/p:OrtPackageId=\"Microsoft.ML.OnnxRuntime.Tvm\""
else:
# use the solution file that includes Xamarin mobile targets
sln = "OnnxRuntime.CSharp.sln"
Expand Down

0 comments on commit 0fd41c1

Please sign in to comment.