mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-26 19:52:38 +00:00
Builds onnxruntime + eager mode with the same value for _GLIBCXX_USE_CXX11_ABI as pytorch (#10114)
* add _GLIBCXX_USE_CXX11_ABI * restrict to eager mode
This commit is contained in:
parent
790c3be7e9
commit
6e95c0316d
2 changed files with 5 additions and 0 deletions
|
|
@ -304,6 +304,10 @@ if (NOT MSVC AND NOT onnxruntime_ENABLE_BITCODE)
|
|||
string(APPEND CMAKE_C_FLAGS " -ffunction-sections -fdata-sections")
|
||||
endif()
|
||||
|
||||
if (onnxruntime_ENABLE_EAGER_MODE)
|
||||
string(APPEND CMAKE_CXX_FLAGS " -D_GLIBCXX_USE_CXX11_ABI=${_GLIBCXX_USE_CXX11_ABI}")
|
||||
endif()
|
||||
|
||||
if (onnxruntime_BUILD_WEBASSEMBLY)
|
||||
# Enable LTO for release single-thread build
|
||||
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT onnxruntime_ENABLE_WEBASSEMBLY_THREADS)
|
||||
|
|
|
|||
|
|
@ -1080,6 +1080,7 @@ def generate_build_tree(cmake_path, source_dir, build_dir, cuda_home, cudnn_home
|
|||
if args.build_eager_mode:
|
||||
import torch
|
||||
cmake_args += ["-Donnxruntime_PREBUILT_PYTORCH_PATH=%s" % os.path.dirname(torch.__file__)]
|
||||
cmake_args += ['-D_GLIBCXX_USE_CXX11_ABI=' + str(int(torch._C._GLIBCXX_USE_CXX11_ABI))]
|
||||
|
||||
cmake_args += ["-D{}".format(define) for define in cmake_extra_defines]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue