@@ -16,9 +16,9 @@ export CUDNN_HOME="/usr/local/cuda"
16
16
export MAKEFLAGS=" -j $MAKEJ "
17
17
export PYTHON_BIN_PATH=$( which python3)
18
18
19
- export GPU_FLAGS =
19
+ export CUDAFLAGS =
20
20
if [[ " $EXTENSION " == * gpu ]]; then
21
- GPU_FLAGS =" --use_cuda"
21
+ CUDAFLAGS =" --use_cuda"
22
22
fi
23
23
24
24
ONNXRUNTIME=1.17.3
@@ -75,18 +75,24 @@ sedinplace '/WX/d' cmake/CMakeLists.txt
75
75
76
76
# allow cross compilation for linux-arm64
77
77
sedinplace ' s/if args.arm or args.arm64:/if False:/g' tools/ci_build/build.py
78
+ sedinplace ' s/is_linux() and platform.machine() == "x86_64"/False/g' tools/ci_build/build.py
79
+ sedinplace ' s/onnxruntime_target_platform STREQUAL "aarch64"/FALSE/g' cmake/CMakeLists.txt
80
+ sedinplace ' s/if (NOT APPLE)/if (FALSE)/g' cmake/onnxruntime_mlas.cmake
81
+ sedinplace ' s/!defined(__APPLE__)/0/g' onnxruntime/core/mlas/inc/mlas.h
82
+ sedinplace ' s/defined(__aarch64__) && defined(__linux__)/0/g' ` find . -name * .cpp -o -name * .cc -o -name * .h`
83
+ sedinplace ' s/MLAS_CPUIDINFO::GetCPUIDInfo().HasArmNeon_I8MM()/false/g' onnxruntime/core/mlas/lib/platform.cpp
78
84
79
85
# work around toolchain issues on Mac and Windows
80
86
patch -p1 < ../../../onnxruntime.patch
81
87
# patch -p1 < ../../../onnxruntime-windows.patch # https://github.com/microsoft/onnxruntime/pull/7883
82
88
sedinplace ' /--Werror/d' cmake/CMakeLists.txt
83
89
sedinplace " s/return 'ON'/return 'OFF'/g" tools/ci_build/build.py
84
90
sedinplace " s/Visual Studio 1. 20../Ninja/g" tools/ci_build/build.py
85
- sedinplace ' s/Darwin|iOS/iOS/g' cmake/onnxruntime_providers.cmake
86
- sedinplace ' s/-fvisibility=hidden//g' cmake/CMakeLists.txt cmake/adjust_global_compile_flags.cmake cmake/onnxruntime_providers.cmake
87
- sedinplace ' s:/Yucuda_pch.h /FIcuda_pch.h::g' cmake/onnxruntime_providers.cmake
88
- sedinplace ' s/${PROJECT_SOURCE_DIR}\/external\/cub//g' cmake/onnxruntime_providers.cmake
89
- sedinplace ' s/ONNXRUNTIME_PROVIDERS_SHARED)/ONNXRUNTIME_PROVIDERS_SHARED onnxruntime_providers_shared)/g' cmake/onnxruntime_providers.cmake
91
+ sedinplace ' s/Darwin|iOS/iOS/g' cmake/onnxruntime_providers_cpu.cmake cmake/ onnxruntime_providers.cmake
92
+ sedinplace ' s/-fvisibility=hidden//g' cmake/CMakeLists.txt cmake/adjust_global_compile_flags.cmake cmake/onnxruntime_providers_cpu.cmake cmake/ onnxruntime_providers.cmake
93
+ sedinplace ' s:/Yucuda_pch.h /FIcuda_pch.h::g' cmake/onnxruntime_providers_cuda.cmake cmake/ onnxruntime_providers.cmake
94
+ sedinplace ' s/${PROJECT_SOURCE_DIR}\/external\/cub//g' cmake/onnxruntime_providers_cuda.cmake cmake/ onnxruntime_providers.cmake
95
+ sedinplace ' s/ONNXRUNTIME_PROVIDERS_SHARED)/ONNXRUNTIME_PROVIDERS_SHARED onnxruntime_providers_shared)/g' cmake/onnxruntime_providers_cpu.cmake cmake/ onnxruntime_providers.cmake
90
96
sedinplace ' s/DNNL_TAG v.*)/DNNL_TAG v3.4.1)/g' cmake/external/dnnl.cmake
91
97
sedinplace ' s/DNNL_SHARED_LIB libdnnl.1.dylib/DNNL_SHARED_LIB libdnnl.2.dylib/g' cmake/external/dnnl.cmake
92
98
sedinplace ' s/DNNL_SHARED_LIB libdnnl.so.1/DNNL_SHARED_LIB libdnnl.so.2/g' cmake/external/dnnl.cmake
@@ -160,7 +166,7 @@ sedinplace 's/UTFChars(javaNameStrings/UTFChars((jstring)javaNameStrings/g' java
160
166
sedinplace ' s/initializers = allocarray/initializers = (const OrtValue**)allocarray/g' java/src/main/native/ai_onnxruntime_OrtSession_SessionOptions.cpp
161
167
162
168
which ctest3 & > /dev/null && CTEST=" ctest3" || CTEST=" ctest"
163
- " $PYTHON_BIN_PATH " tools/ci_build/build.py --build_dir ../build --config Release --cmake_path " $CMAKE " --ctest_path " $CTEST " --build_shared_lib $ARCH_FLAGS $DNNL_FLAGS $OPENMP_FLAGS $GPU_FLAGS
169
+ " $PYTHON_BIN_PATH " tools/ci_build/build.py --build_dir ../build --config Release --cmake_path " $CMAKE " --ctest_path " $CTEST " --build_shared_lib $ARCH_FLAGS $DNNL_FLAGS $OPENMP_FLAGS $CUDAFLAGS
164
170
165
171
# install headers and libraries in standard directories
166
172
cp -r include/* ../include
0 commit comments