Skip to content

Commit c0a3f6b

Browse files
committed
Merge main, resolve conflict
2 parents 8e0cf82 + bed11ca commit c0a3f6b

File tree

9 files changed

+6
-345
lines changed

9 files changed

+6
-345
lines changed

cmake/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,6 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
5555
# NOTE: POSITION INDEPENDENT CODE hurts performance, and it only make sense on POSIX systems
5656
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
5757

58-
#set(CMAKE_CXX_COMPILER "/usr/bin/clang++ --target=arm64-apple-macos14.0-macabi" ) #Paco
59-
#set(CMAKE_C_COMPILER "/usr/bin/clang --target=arm64-apple-macos14.0-macabi" )
60-
61-
#set(CMAKE_CXX_FLAGS "--target=arm64-apple-macos14.0-macabi" ) #Paco
62-
#set(CMAKE_C_FLAGS "--target=arm64-apple-macos14.0-macabi" )
63-
64-
# Suggested by https://gitlab.kitware.com/cmake/cmake/-/issues/20132
65-
# Because MacCatalyst does not support well in CMake
66-
add_compile_options(-Wno-overriding-t-option)
67-
add_link_options(-Wno-overriding-t-option)
68-
6958
# Enable CTest
7059
enable_testing()
7160
include(Dart)
@@ -1686,8 +1675,6 @@ endif()
16861675
#Now the 'onnxruntime_EXTERNAL_LIBRARIES' variable should be sealed. It will be used in onnxruntime.cmake which will be included in the next.
16871676
#The order of the following targets matters. Right depends on left. If target A appears before target B. Then A.cmake can not use variables defined in B.cmake.
16881677
set(ONNXRUNTIME_CMAKE_FILES onnxruntime_flatbuffers onnxruntime_common onnxruntime_mlas onnxruntime_graph onnxruntime_framework onnxruntime_util onnxruntime_providers onnxruntime_optimizer onnxruntime_session ${ONNXRUNTIME_EAGER_CMAKE_FILE_NAME})
1689-
# set(ONNXRUNTIME_CMAKE_FILES onnxruntime_flatbuffers onnxruntime_common onnxruntime_mlas) #Paco to be disable
1690-
# set(ONNXRUNTIME_CMAKE_FILES onnxruntime_mlas) #Paco to be disable
16911678

16921679
if (onnxruntime_USE_WINML)
16931680
# WINML uses and depends on the shared lib. Note: You can build WINML without DML and you will get a

cmake/adjust_global_compile_flags.cmake

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ endif()
1919

2020
# Enable space optimization for gcc/clang
2121
# Cannot use "-ffunction-sections -fdata-sections" if we enable bitcode (iOS)
22-
#TODO: Paco: need to find out onnxruntime_ENABLE_BITCODE turns ON even it is set to OFF
23-
#if (NOT MSVC AND NOT onnxruntime_ENABLE_BITCODE)
24-
# string(APPEND CMAKE_CXX_FLAGS " -ffunction-sections -fdata-sections")
25-
# string(APPEND CMAKE_C_FLAGS " -ffunction-sections -fdata-sections")
26-
#endif()
22+
if (NOT MSVC AND NOT onnxruntime_ENABLE_BITCODE)
23+
string(APPEND CMAKE_CXX_FLAGS " -ffunction-sections -fdata-sections")
24+
string(APPEND CMAKE_C_FLAGS " -ffunction-sections -fdata-sections")
25+
endif()
2726

2827
if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
2928
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s ALLOW_UNIMPLEMENTED_SYSCALLS=1 -s DEFAULT_TO_CXX=1")

cmake/deps.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ coremltools;https://github.com/apple/coremltools/archive/refs/tags/7.1.zip;f1bab
1717
cxxopts;https://github.com/jarro2783/cxxopts/archive/3c73d91c0b04e2b59462f0a741be8c07024c1bc0.zip;6c6ca7f8480b26c8d00476e0e24b7184717fe4f0
1818
date;https://github.com/HowardHinnant/date/archive/refs/tags/v3.0.1.zip;2dac0c81dc54ebdd8f8d073a75c053b04b56e159
1919
dlpack;https://github.com/dmlc/dlpack/archive/refs/tags/v0.6.zip;4d565dd2e5b31321e5549591d78aa7f377173445
20-
#flatbuffers;https://github.com/google/flatbuffers/archive/refs/tags/v1.12.0.zip;ba0a75fd12dbef8f6557a74e611b7a3d0c5fe7bf
21-
#flatbuffers;https://github.com/google/flatbuffers/archive/refs/tags/v22.12.6.zip;d01b5232ee52ed5ed05e84f4de01118d5ff8730d
2220
# This Eigen commit id matches the eigen archive being consumed from https://gitlab.com/libeigen/eigen/-/archive/3.4/eigen-3.4.zip
2321
# prior to the 3.4.1 RC changing the bits and invalidating the hash.
2422
# it contains changes on top of 3.4.0 which are required to fix build issues.

cmake/patches/protobuf/protobuf_cmake.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ index 008c19225..cbab108c2 100644
3535
+++ b/src/google/protobuf/map.h
3636
@@ -52,7 +52,8 @@
3737
#endif // defined(__cpp_lib_string_view)
38-
38+
3939
#if !defined(GOOGLE_PROTOBUF_NO_RDTSC) && defined(__APPLE__)
4040
-#include <mach/mach_time.h>
4141
+// apply update from https://github.com/protocolbuffers/protobuf/pull/15662/
4242
+#include <time.h>
4343
#endif
44-
44+
4545
#include <google/protobuf/stubs/common.h>
4646
@@ -1154,7 +1155,8 @@ class Map {
4747
#if defined(__APPLE__)

onnxruntime/core/flatbuffers/schema/ort.fbs.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,15 +1576,9 @@ struct Attribute FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
15761576
verifier.VerifyString(name()) &&
15771577
VerifyOffset(verifier, VT_DOC_STRING) &&
15781578
verifier.VerifyString(doc_string()) &&
1579-
<<<<<<< HEAD
1580-
VerifyField<int32_t>(verifier, VT_TYPE, sizeof(int32_t)) &&
1581-
VerifyField<float>(verifier, VT_F, sizeof(float)) &&
1582-
VerifyField<int64_t>(verifier, VT_I, sizeof(int64_t)) &&
1583-
=======
15841579
VerifyField<int32_t>(verifier, VT_TYPE, 4) &&
15851580
VerifyField<float>(verifier, VT_F, 4) &&
15861581
VerifyField<int64_t>(verifier, VT_I, 8) &&
1587-
>>>>>>> main
15881582
VerifyOffset(verifier, VT_S) &&
15891583
verifier.VerifyString(s()) &&
15901584
VerifyOffset(verifier, VT_T) &&

tools/ci_build/build.py

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@ def convert_arg_line_to_args(self, arg_line):
450450
"(e.g. macOS or iOS)"
451451
"This is only supported on MacOS",
452452
)
453-
parser.add_argument("--macabi", action="store_true", help="Build for macabi")
454453
# A 32-bit progress doesn't have enough memory to run all the tests in onnxruntime_test_all.
455454
# Mimalloc is incompatible with address sanitizer.
456455
# Address sanitizer itself is also a memory leak checker, so when it is enabled we should disable_memleak_checker.
@@ -1020,7 +1019,6 @@ def generate_build_tree(
10201019
"-Donnxruntime_BUILD_OBJC=" + ("ON" if args.build_objc else "OFF"),
10211020
"-Donnxruntime_BUILD_SHARED_LIB=" + ("ON" if args.build_shared_lib else "OFF"),
10221021
"-Donnxruntime_BUILD_APPLE_FRAMEWORK=" + ("ON" if args.build_apple_framework else "OFF"),
1023-
"-DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=NEVER", #PACO
10241022
"-Donnxruntime_USE_DNNL=" + ("ON" if args.use_dnnl else "OFF"),
10251023
"-Donnxruntime_USE_NNAPI_BUILTIN=" + ("ON" if args.use_nnapi else "OFF"),
10261024
"-Donnxruntime_USE_VSINPU=" + ("ON" if args.use_vsinpu else "OFF"),
@@ -1393,65 +1391,6 @@ def generate_build_tree(
13931391
"-Donnxruntime_ENABLE_CPUINFO=OFF",
13941392
]
13951393

1396-
if args.macabi:
1397-
needed_args = [
1398-
#args.use_xcode,
1399-
args.ios_sysroot,
1400-
args.apple_deploy_target,
1401-
]
1402-
arg_names = [
1403-
#"--use_xcode " + "<need use xcode to cross build iOS on MacOS>",
1404-
"--ios_sysroot " + "<the location or name of the macOS platform SDK>",
1405-
"--apple_deploy_target " + "<the minimum version of the target platform>",
1406-
]
1407-
if not all(needed_args):
1408-
raise BuildError(
1409-
"iOS build on MacOS canceled due to missing arguments: "
1410-
+ ", ".join(val for val, cond in zip(arg_names, needed_args) if not cond)
1411-
)
1412-
cmake_args += [
1413-
"-DCMAKE_SYSTEM_NAME=Darwin",
1414-
"-Donnxruntime_BUILD_SHARED_LIB=ON",
1415-
"-DCMAKE_OSX_SYSROOT=" + args.ios_sysroot,
1416-
"-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0", # + args.apple_deploy_target,
1417-
"-DCMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG=" + args.apple_deploy_target,
1418-
"-DCMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG=" + args.apple_deploy_target,
1419-
"-DCMAKE_CC_OSX_DEPLOYMENT_TARGET_FLAG=" + args.apple_deploy_target,
1420-
"-DCMAKE_CXX_COMPILER_TARGET=" + f"{args.osx_arch}-apple-ios{args.apple_deploy_target}-macabi",
1421-
"-DCMAKE_C_COMPILER_TARGET=" + f"{args.osx_arch}-apple-ios{args.apple_deploy_target}-macabi",
1422-
"-DCMAKE_CC_COMPILER_TARGET=" + f"{args.osx_arch}-apple-ios{args.apple_deploy_target}-macabi",
1423-
"-DCMAKE_CXX_FLAGS=" + f"--target={args.osx_arch}-apple-ios{args.apple_deploy_target}-macabi",
1424-
"-DCMAKE_CXX_FLAGS_RELEASE=" + f"-O3 -DNDEBUG --target={args.osx_arch}-apple-ios{args.apple_deploy_target}-macabi",
1425-
"-DCMAKE_C_FLAGS=" + f"--target={args.osx_arch}-apple-ios{args.apple_deploy_target}-macabi",
1426-
"-DCMAKE_C_FLAGS_RELEASE=" + f"-O3 -DNDEBUG --target={args.osx_arch}-apple-ios{args.apple_deploy_target}-macabi",
1427-
"-DCMAKE_CC_FLAGS=" + f"--target={args.osx_arch}-apple-ios{args.apple_deploy_target}-macabi",
1428-
"-DCMAKE_CC_FLAGS_RELEASE=" + f"-O3 -DNDEBUG --target={args.osx_arch}-apple-ios{args.apple_deploy_target}-macabi",
1429-
"-DCMAKE_OSX_SYSROOT=" + "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk",
1430-
"-DCMAKE_THREAD_LIBS_INIT=" + "-lpthread",
1431-
"-DCMAKE_HAVE_THREADS_LIBRARY=" + "1",
1432-
"-DCMAKE_USE_PTHREADS_INIT=1",
1433-
"-DTHREADS_PREFER_PTHREAD_FLAG=ON",
1434-
"-Donnxruntime_ENABLE_BITCODE=OFF",
1435-
"-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF",
1436-
"-DCMAKE_OSX_ARCHITECTURES=" + f"{args.osx_arch}",
1437-
"-DCMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG=",
1438-
# we do not need protoc binary for ios cross build
1439-
"-Dprotobuf_BUILD_PROTOC_BINARIES=OFF",
1440-
]
1441-
1442-
if args.osx_arch == "arm64":
1443-
cmake_args += ["-DPLATFORM=MAC_CATALYST_ARM64"]
1444-
elif args.osx_arch == "x86_64":
1445-
cmake_args += ["-DPLATFORM=MAC_CATALYST"]
1446-
#"-DPLATFORM=" + "MAC_CATALYST_ARM64" if args.osx_arch == "arm64" else "MAC_CATALYST",
1447-
#f"-DCMAKE_C_FLAGS={args.osx_arch}-apple-ios{args.apple_deploy_target}-macabi",
1448-
#"-DCMAKE_TOOLCHAIN_FILE="
1449-
#+ (args.macabi_toolchain_file if args.macabi_toolchain_file else "../cmake/onnxruntime_macabi.toolchain.cmake.v1"),
1450-
print("args.macabi cmake config")
1451-
print(cmake_args)
1452-
#exit(-1)
1453-
1454-
14551394
if args.build_wasm:
14561395
emsdk_dir = os.path.join(cmake_dir, "external", "emsdk")
14571396
emscripten_cmake_toolchain_file = os.path.join(
@@ -1798,9 +1737,6 @@ def build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, targe
17981737
if args.android:
17991738
env["ANDROID_SDK_ROOT"] = args.android_sdk_path
18001739
env["ANDROID_NDK_HOME"] = args.android_ndk_path
1801-
#cmd_args += ['--verbose']
1802-
print(cmd_args)
1803-
print(env)
18041740
run_subprocess(cmd_args, env=env)
18051741

18061742

0 commit comments

Comments
 (0)