Skip to content

Commit cff958a

Browse files
committed
Adjusting onnxruntime-1.17.1 patch to work on MacOS
1 parent 7e7d7f0 commit cff958a

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

graalpython/lib-graalpython/patches/onnxruntime-1.17.1.patch

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,42 @@
11
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
2-
index 94d650f..175a6b8 100644
2+
index 94d650f..31dc0bc 100644
33
--- a/cmake/CMakeLists.txt
44
+++ b/cmake/CMakeLists.txt
5-
@@ -54,6 +54,8 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
5+
@@ -54,6 +54,16 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
66
enable_testing()
77
include(Dart)
88

9-
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=array-bounds -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict -Wno-error=unused-but-set-variable -Wno-error=overloaded-virtual")
9+
+# For Linux
10+
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
11+
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=array-bounds -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict -Wno-error=unused-but-set-variable -Wno-error=overloaded-virtual")
12+
+endif()
13+
+
14+
+# For macOS
15+
+if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
16+
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
17+
+endif()
1018
+
1119
if (NOT CMAKE_BUILD_TYPE)
1220
message(STATUS "Build type not set - using RelWithDebInfo")
1321
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose build type: Debug Release RelWithDebInfo MinSizeRel." FORCE)
22+
diff --git a/cmake/deps.txt b/cmake/deps.txt
23+
index ba9c2bb..c2813aa 100644
24+
--- a/cmake/deps.txt
25+
+++ b/cmake/deps.txt
26+
@@ -21,7 +21,9 @@ dlpack;https://github.com/dmlc/dlpack/archive/refs/tags/v0.6.zip;4d565dd2e5b3132
27+
# it contains changes on top of 3.4.0 which are required to fix build issues.
28+
# Until the 3.4.1 release this is the best option we have.
29+
# Issue link: https://gitlab.com/libeigen/eigen/-/issues/2744
30+
-eigen;https://gitlab.com/libeigen/eigen/-/archive/e7248b26a1ed53fa030c5c459f7ea095dfd276ac/eigen-e7248b26a1ed53fa030c5c459f7ea095dfd276ac.zip;be8be39fdbc6e60e94fa7870b280707069b5b81a
31+
+# Moved to github mirror to avoid gitlab issues.
32+
+# Issue link: https://github.com/bazelbuild/bazel-central-registry/issues/4355
33+
+eigen;https://github.com/eigen-mirror/eigen/archive/1d8b82b0740839c0de7f1242a3585e3390ff5f33/eigen-1d8b82b0740839c0de7f1242a3585e3390ff5f33.zip;05b19b49e6fbb91246be711d801160528c135e34
34+
flatbuffers;https://github.com/google/flatbuffers/archive/refs/tags/v1.12.0.zip;ba0a75fd12dbef8f6557a74e611b7a3d0c5fe7bf
35+
fp16;https://github.com/Maratyszcza/FP16/archive/0a92994d729ff76a58f692d3028ca1b64b145d91.zip;b985f6985a05a1c03ff1bb71190f66d8f98a1494
36+
fxdiv;https://github.com/Maratyszcza/FXdiv/archive/63058eff77e11aa15bf531df5dd34395ec3017c8.zip;a5658f4036402dbca7cebee32be57fb8149811e1
1437
diff --git a/onnxruntime_build_backend.py b/onnxruntime_build_backend.py
1538
new file mode 100644
16-
index 0000000..33fc235
39+
index 0000000..156e70a
1740
--- /dev/null
1841
+++ b/onnxruntime_build_backend.py
1942
@@ -0,0 +1,59 @@

0 commit comments

Comments
 (0)