mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-22 22:01:08 +00:00
1. Update manylinux build scripts. This will add [PEP600](https://www.python.org/dev/peps/pep-0600/)(manylinux2 tags) support. numpy has adopted this new feature, we should do the same. The old build script files were copied from https://github.com/pypa/manylinux, but they has been deleted and replaced in the upstream repo. The manylinux repo doesn't have a manylinux2014 branch anymore. So I'm removing the obsolete code, sync the files with the latest master. 2. Update GPU CUDA version from 11.0 to 11.1(after a discussion with PMs). 3. Delete tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cuda10_2. (Merged the content to tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cuda11) 4. Modernize the cmake code of how to locate python devel files. It was suggested in https://github.com/onnx/onnx/pull/1631 . 5. Remove `onnxruntime_MSVC_STATIC_RUNTIME` and `onnxruntime_GCC_STATIC_CPP_RUNTIME` build options. Now cmake has builtin support for it. Starting from cmake 3.15, we can use `CMAKE_MSVC_RUNTIME_LIBRARY` cmake variable to choose which MSVC runtime library we want to use. 6. Update Ubuntu docker images that used in our CI build from Ubuntu 18.04 to Ubuntu 20.04. 7. Update GCC version in CUDA 11.1 pipelines from 8.x to 9.3.1 8. Split Linux GPU CI pipeline to two jobs: build the code on a CPU machine then run the tests on another GPU machines. In the past we didn't test our python packages. We only tested the pre-packed files. So we didn't catch the rpath issue in CI build. 9. Add a CentOS machine pool and test our Linux GPU build on real CentOS machines. 10. Rework ARM64 Linux GPU python packaging pipeline. Previously it uses cross-compiling therefore we must static link to C Runtime. But now have pluggable EP API and it doesn't support static link. So I changed to use qemu emulation instead. Now the build is 10x slower than before. But it is more extensible.
65 lines
3.3 KiB
CMake
65 lines
3.3 KiB
CMake
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
# Licensed under the MIT License.
|
|
|
|
file(GLOB_RECURSE onnxruntime_framework_srcs CONFIGURE_DEPENDS
|
|
"${ONNXRUNTIME_INCLUDE_DIR}/core/framework/*.h"
|
|
"${ONNXRUNTIME_ROOT}/core/framework/*.h"
|
|
"${ONNXRUNTIME_ROOT}/core/framework/*.cc"
|
|
)
|
|
|
|
if (onnxruntime_MINIMAL_BUILD)
|
|
set(onnxruntime_framework_src_exclude
|
|
"${ONNXRUNTIME_ROOT}/core/framework/provider_bridge_ort.cc"
|
|
"${ONNXRUNTIME_ROOT}/core/framework/fallback_cpu_capability.h"
|
|
"${ONNXRUNTIME_ROOT}/core/framework/fallback_cpu_capability.cc"
|
|
)
|
|
|
|
# custom ops support must be explicitly enabled in a minimal build. exclude if not.
|
|
if (NOT onnxruntime_MINIMAL_BUILD_CUSTOM_OPS)
|
|
list(APPEND onnxruntime_framework_src_exclude
|
|
"${ONNXRUNTIME_INCLUDE_DIR}/core/framework/customregistry.h"
|
|
"${ONNXRUNTIME_ROOT}/core/framework/customregistry.cc"
|
|
)
|
|
endif()
|
|
|
|
list(REMOVE_ITEM onnxruntime_framework_srcs ${onnxruntime_framework_src_exclude})
|
|
endif()
|
|
|
|
source_group(TREE ${REPO_ROOT} FILES ${onnxruntime_framework_srcs})
|
|
|
|
onnxruntime_add_static_library(onnxruntime_framework ${onnxruntime_framework_srcs})
|
|
if(onnxruntime_ENABLE_INSTRUMENT)
|
|
target_compile_definitions(onnxruntime_framework PRIVATE ONNXRUNTIME_ENABLE_INSTRUMENT)
|
|
endif()
|
|
if(onnxruntime_USE_TENSORRT)
|
|
# TODO: for now, core framework depends on CUDA. It should be moved to TensorRT EP
|
|
target_include_directories(onnxruntime_framework PRIVATE ${ONNXRUNTIME_ROOT} ${eigen_INCLUDE_DIRS} ${onnxruntime_CUDNN_HOME}/include PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
|
|
else()
|
|
target_include_directories(onnxruntime_framework PRIVATE ${ONNXRUNTIME_ROOT} ${eigen_INCLUDE_DIRS} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
|
endif()
|
|
# Needed for the provider interface, as it includes training headers when training is enabled
|
|
if (onnxruntime_ENABLE_TRAINING OR onnxruntime_ENABLE_TRAINING_OPS)
|
|
target_include_directories(onnxruntime_framework PRIVATE ${ORTTRAINING_ROOT})
|
|
if (onnxruntime_USE_NCCL OR onnxruntime_USE_MPI)
|
|
target_include_directories(onnxruntime_framework PUBLIC ${MPI_CXX_INCLUDE_DIRS})
|
|
endif()
|
|
endif()
|
|
onnxruntime_add_include_to_target(onnxruntime_framework onnxruntime_common onnx onnx_proto ${PROTOBUF_LIB} flatbuffers)
|
|
set_target_properties(onnxruntime_framework PROPERTIES FOLDER "ONNXRuntime")
|
|
# need onnx to build to create headers that this project includes
|
|
add_dependencies(onnxruntime_framework ${onnxruntime_EXTERNAL_DEPENDENCIES})
|
|
|
|
# In order to find the shared provider libraries we need to add the origin to the rpath for all executables we build
|
|
# For the shared onnxruntime library, this is set in onnxruntime.cmake through CMAKE_SHARED_LINKER_FLAGS
|
|
# But our test files don't use the shared library so this must be set for them.
|
|
# For Win32 it generates an absolute path for shared providers based on the location of the executable/onnxruntime.dll
|
|
if (UNIX AND NOT APPLE AND NOT onnxruntime_MINIMAL_BUILD AND NOT onnxruntime_BUILD_WEBASSEMBLY)
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath='$ORIGIN'")
|
|
endif()
|
|
|
|
if (onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS)
|
|
target_compile_definitions(onnxruntime_framework PRIVATE DEBUG_NODE_INPUTS_OUTPUTS)
|
|
endif()
|
|
|
|
|
|
install(DIRECTORY ${PROJECT_SOURCE_DIR}/../include/onnxruntime/core/framework DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnxruntime/core)
|