Skip to content

Commit bed11ca

Browse files
authored
Merge pull request #14 from GoodNotes/paco/cleanup_develop
[NOTICK] Remove unused macabi build pipeline
2 parents 295d492 + 8d9a5cc commit bed11ca

File tree

9 files changed

+36
-349
lines changed

9 files changed

+36
-349
lines changed

cmake/CMakeLists.txt

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,6 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
5050
# NOTE: POSITION INDEPENDENT CODE hurts performance, and it only make sense on POSIX systems
5151
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
5252

53-
#set(CMAKE_CXX_COMPILER "/usr/bin/clang++ --target=arm64-apple-macos14.0-macabi" ) #Paco
54-
#set(CMAKE_C_COMPILER "/usr/bin/clang --target=arm64-apple-macos14.0-macabi" )
55-
56-
#set(CMAKE_CXX_FLAGS "--target=arm64-apple-macos14.0-macabi" ) #Paco
57-
#set(CMAKE_C_FLAGS "--target=arm64-apple-macos14.0-macabi" )
58-
59-
# Suggested by https://gitlab.kitware.com/cmake/cmake/-/issues/20132
60-
# Because MacCatalyst does not support well in CMake
61-
add_compile_options(-Wno-overriding-t-option)
62-
add_link_options(-Wno-overriding-t-option)
63-
6453
# Enable CTest
6554
enable_testing()
6655
include(Dart)
@@ -130,7 +119,7 @@ option(onnxruntime_DONT_VECTORIZE "Do not vectorize operations in Eigen" OFF)
130119

131120
option(onnxruntime_USE_FULL_PROTOBUF "Link to libprotobuf instead of libprotobuf-lite when this option is ON" OFF)
132121
option(onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS "Enable operator implemented in language other than cpp" OFF)
133-
option(onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS "Dump debug information about node inputs and outputs when executing the model." ON)
122+
option(onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS "Dump debug information about node inputs and outputs when executing the model." OFF)
134123
cmake_dependent_option(onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS_ENABLE_DUMP_TO_SQLDB "Build dump debug information about node inputs and outputs with support for sql database." OFF "onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS" OFF)
135124
option(onnxruntime_USE_DML "Build with DirectML support" OFF)
136125
option(onnxruntime_USE_MIGRAPHX "Build with AMDMIGraphX support" OFF)
@@ -1661,8 +1650,6 @@ endif()
16611650
#Now the 'onnxruntime_EXTERNAL_LIBRARIES' variable should be sealed. It will be used in onnxruntime.cmake which will be included in the next.
16621651
#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.
16631652
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})
1664-
# set(ONNXRUNTIME_CMAKE_FILES onnxruntime_flatbuffers onnxruntime_common onnxruntime_mlas) #Paco to be disable
1665-
# set(ONNXRUNTIME_CMAKE_FILES onnxruntime_mlas) #Paco to be disable
16661653

16671654
if (onnxruntime_USE_WINML)
16681655
# 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.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 04cb3303a..4025805cf 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -249,9 +249,7 @@ if (MSVC)
6+
# MSVC warning suppressions
7+
add_definitions(
8+
/wd4065 # switch statement contains 'default' but no 'case' labels
9+
- /wd4244 # 'conversion' conversion from 'type1' to 'type2', possible loss of data
10+
/wd4251 # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
11+
- /wd4267 # 'var' : conversion from 'size_t' to 'type', possible loss of data
12+
/wd4305 # 'identifier' : truncation from 'type1' to 'type2'
13+
/wd4307 # 'operator' : integral constant overflow
14+
/wd4309 # 'conversion' : truncation of constant value
15+
@@ -259,7 +257,6 @@ if (MSVC)
16+
/wd4355 # 'this' : used in base member initializer list
17+
/wd4506 # no definition for inline function 'function'
18+
/wd4800 # 'type' : forcing value to bool 'true' or 'false' (performance warning)
19+
- /wd4996 # The compiler encountered a deprecated declaration.
20+
)
21+
# Allow big object
22+
add_definitions(/bigobj)
23+
@@ -289,7 +286,7 @@ if (MSVC)
24+
else (MSVC)
25+
# No version.rc file.
26+
set(protobuf_version_rc_file)
27+
-
28+
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
29+
# When building with "make", "lib" prefix will be added automatically by
30+
# the build tool.
31+
set(LIB_PREFIX)

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,15 +1568,9 @@ struct Attribute FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
15681568
verifier.VerifyString(name()) &&
15691569
VerifyOffset(verifier, VT_DOC_STRING) &&
15701570
verifier.VerifyString(doc_string()) &&
1571-
<<<<<<< HEAD
1572-
VerifyField<int32_t>(verifier, VT_TYPE, sizeof(int32_t)) &&
1573-
VerifyField<float>(verifier, VT_F, sizeof(float)) &&
1574-
VerifyField<int64_t>(verifier, VT_I, sizeof(int64_t)) &&
1575-
=======
15761571
VerifyField<int32_t>(verifier, VT_TYPE, 4) &&
15771572
VerifyField<float>(verifier, VT_F, 4) &&
15781573
VerifyField<int64_t>(verifier, VT_I, 8) &&
1579-
>>>>>>> main
15801574
VerifyOffset(verifier, VT_S) &&
15811575
verifier.VerifyString(s()) &&
15821576
VerifyOffset(verifier, VT_T) &&

tools/ci_build/build.py

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,6 @@ def convert_arg_line_to_args(self, arg_line):
415415
default="",
416416
help="Path to ios toolchain file, or cmake/onnxruntime_ios.toolchain.cmake will be used",
417417
)
418-
parser.add_argument(
419-
"--macabi_toolchain_file",
420-
default="",
421-
help="Path to macabi toolchain file, " "or cmake/onnxruntime_macabi.toolchain.cmake will be used",
422-
)
423418
parser.add_argument(
424419
"--xcode_code_signing_team_id", default="", help="The development team ID used for code signing in Xcode"
425420
)
@@ -446,7 +441,6 @@ def convert_arg_line_to_args(self, arg_line):
446441
"(e.g. macOS or iOS)"
447442
"This is only supported on MacOS",
448443
)
449-
parser.add_argument("--macabi", action="store_true", help="Build for macabi")
450444
# A 32-bit progress doesn't have enough memory to run all the tests in onnxruntime_test_all.
451445
# Mimalloc is incompatible with address sanitizer.
452446
# Address sanitizer itself is also a memory leak checker, so when it is enabled we should disable_memleak_checker.
@@ -1019,7 +1013,6 @@ def generate_build_tree(
10191013
"-Donnxruntime_BUILD_OBJC=" + ("ON" if args.build_objc else "OFF"),
10201014
"-Donnxruntime_BUILD_SHARED_LIB=" + ("ON" if args.build_shared_lib else "OFF"),
10211015
"-Donnxruntime_BUILD_APPLE_FRAMEWORK=" + ("ON" if args.build_apple_framework else "OFF"),
1022-
"-DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=NEVER", #PACO
10231016
"-Donnxruntime_USE_DNNL=" + ("ON" if args.use_dnnl else "OFF"),
10241017
"-Donnxruntime_USE_NNAPI_BUILTIN=" + ("ON" if args.use_nnapi else "OFF"),
10251018
"-Donnxruntime_USE_RKNPU=" + ("ON" if args.use_rknpu else "OFF"),
@@ -1394,65 +1387,6 @@ def generate_build_tree(
13941387
f"-DCMAKE_CC_FLAGS_RELEASE=-O3 -DNDEBUG --target={macabi_target}",
13951388
]
13961389

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

18011732

0 commit comments

Comments
 (0)