Skip to content

Commit d3e69f1

Browse files
committed
Fix builds for ONNX Runtime
1 parent 5444b5c commit d3e69f1

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

onnxruntime/cppbuild.sh

+12-5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ fi
1010
export ARCH_FLAGS="--allow_running_as_root"
1111
export DNNL_FLAGS="--use_dnnl"
1212
export OPENMP_FLAGS= # "--use_openmp"
13+
export CUDAFLAGS="-v"
1314
export CUDACXX="/usr/local/cuda/bin/nvcc"
1415
export CUDA_HOME="/usr/local/cuda"
1516
export CUDNN_HOME="/usr/local/cuda"
@@ -75,18 +76,24 @@ sedinplace '/WX/d' cmake/CMakeLists.txt
7576

7677
# allow cross compilation for linux-arm64
7778
sedinplace 's/if args.arm or args.arm64:/if False:/g' tools/ci_build/build.py
79+
sedinplace 's/is_linux() and platform.machine() == "x86_64"/False/g' tools/ci_build/build.py
80+
sedinplace 's/onnxruntime_target_platform STREQUAL "aarch64"/FALSE/g' cmake/CMakeLists.txt
81+
sedinplace 's/if (NOT APPLE)/if (FALSE)/g' cmake/onnxruntime_mlas.cmake
82+
sedinplace 's/!defined(__APPLE__)/0/g' onnxruntime/core/mlas/inc/mlas.h
83+
sedinplace 's/defined(__aarch64__) && defined(__linux__)/0/g' `find . -name *.cpp -o -name *.cc -o -name *.h`
84+
sedinplace 's/MLAS_CPUIDINFO::GetCPUIDInfo().HasArmNeon_I8MM()/false/g' onnxruntime/core/mlas/lib/platform.cpp
7885

7986
# work around toolchain issues on Mac and Windows
8087
patch -p1 < ../../../onnxruntime.patch
8188
#patch -p1 < ../../../onnxruntime-windows.patch # https://github.com/microsoft/onnxruntime/pull/7883
8289
sedinplace '/--Werror/d' cmake/CMakeLists.txt
8390
sedinplace "s/return 'ON'/return 'OFF'/g" tools/ci_build/build.py
8491
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
92+
sedinplace 's/Darwin|iOS/iOS/g' cmake/onnxruntime_providers_cpu.cmake cmake/onnxruntime_providers.cmake
93+
sedinplace 's/-fvisibility=hidden//g' cmake/CMakeLists.txt cmake/adjust_global_compile_flags.cmake cmake/onnxruntime_providers_cpu.cmake cmake/onnxruntime_providers.cmake
94+
sedinplace 's:/Yucuda_pch.h /FIcuda_pch.h::g' cmake/onnxruntime_providers_cuda.cmake cmake/onnxruntime_providers.cmake
95+
sedinplace 's/${PROJECT_SOURCE_DIR}\/external\/cub//g' cmake/onnxruntime_providers_cuda.cmake cmake/onnxruntime_providers.cmake
96+
sedinplace 's/ONNXRUNTIME_PROVIDERS_SHARED)/ONNXRUNTIME_PROVIDERS_SHARED onnxruntime_providers_shared)/g' cmake/onnxruntime_providers_cpu.cmake cmake/onnxruntime_providers.cmake
9097
sedinplace 's/DNNL_TAG v.*)/DNNL_TAG v3.4.1)/g' cmake/external/dnnl.cmake
9198
sedinplace 's/DNNL_SHARED_LIB libdnnl.1.dylib/DNNL_SHARED_LIB libdnnl.2.dylib/g' cmake/external/dnnl.cmake
9299
sedinplace 's/DNNL_SHARED_LIB libdnnl.so.1/DNNL_SHARED_LIB libdnnl.so.2/g' cmake/external/dnnl.cmake

onnxruntime/src/main/java/org/bytedeco/onnxruntime/presets/onnxruntime.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public void map(InfoMap infoMap) {
224224
.put(new Info("Ort::detail::Base<OrtKernelInfo>").pointerTypes("BaseKernelInfo"))
225225
.put(new Info("Ort::detail::Base<OrtThreadingOptions>").pointerTypes("BaseThreadingOptions"))
226226

227-
.put(new Info("OrtSessionOptionsAppendExecutionProvider_MIGraphX",
227+
.put(new Info("OrtSessionOptionsAppendExecutionProvider_MIGraphX", "OrtSessionOptionsAppendExecutionProvider_Tensorrt",
228228
"OrtSessionOptionsAppendExecutionProvider_ROCM", "Ort::detail::OptionalTypeInfoImpl<OrtTypeInfo>::GetOptionalElementType").skip())
229229
.put(new Info("OrtSessionOptionsAppendExecutionProvider_CUDA").annotations("@Platform(extension=\"-gpu\")").javaNames("OrtSessionOptionsAppendExecutionProvider_CUDA"));
230230
}

0 commit comments

Comments
 (0)