Skip to content

Commit

Permalink
Disable broken OpenMP support for ONNX Runtime on Mac (issue #917)
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Jul 25, 2020
1 parent 976e6f7 commit 2012b1a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

* Include `nnvm/c_api.h` header file in presets for MXNet ([issue #912](https://github.com/bytedeco/javacpp-presets/issues/912))
* Enable OpenMP for DNNL and ONNX Runtime on Mac using same library name as MKL to prevent conflicts ([issue #907](https://github.com/bytedeco/javacpp-presets/issues/907))
* Enable OpenMP for DNNL on Mac using same library name as MKL to prevent conflicts ([issue #907](https://github.com/bytedeco/javacpp-presets/issues/907))
* Fix loading issue with `opencv_ximgproc` ([issue #911](https://github.com/bytedeco/javacpp-presets/issues/911))
* Build LibTIFF after WebP to make sure they link correctly in presets for Leptonica
* Virtualize `IInt8Calibrator` plus subclasses from TensorRT to allow customization ([issue #902](https://github.com/bytedeco/javacpp-presets/issues/902))
Expand Down
25 changes: 16 additions & 9 deletions onnxruntime/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,21 @@ export CUDA_HOME="/usr/local/cuda"
export CUDNN_HOME="/usr/local/cuda"
export MAKEFLAGS="-j $MAKEJ"
export PYTHON_BIN_PATH=$(which python3)
if [[ $PLATFORM == windows* ]]; then
if [[ -n "${CUDA_PATH:-}" ]]; then
export CUDACXX="$CUDA_PATH/bin/nvcc"
export CUDA_HOME="$CUDA_PATH"
export CUDNN_HOME="$CUDA_PATH"
fi
export PYTHON_BIN_PATH=$(which python.exe)
fi
export OPENMP_FLAGS="--use_openmp"
case $PLATFORM in
macosx-*)
# disable OpenMP on Mac until it's fixed
OPENMP_FLAGS=
;;
windows-*)
if [[ -n "${CUDA_PATH:-}" ]]; then
export CUDACXX="$CUDA_PATH/bin/nvcc"
export CUDA_HOME="$CUDA_PATH"
export CUDNN_HOME="$CUDA_PATH"
fi
export PYTHON_BIN_PATH=$(which python.exe)
;;
esac

export GPU_FLAGS=
if [[ "$EXTENSION" == *gpu ]]; then
Expand Down Expand Up @@ -78,7 +85,7 @@ ortApiHandle = initialiseAPIBase(ORT_API_VERSION_1);\
' java/src/main/java/ai/onnxruntime/OnnxRuntime.java

which ctest3 &> /dev/null && CTEST="ctest3" || CTEST="ctest"
"$PYTHON_BIN_PATH" tools/ci_build/build.py --build_dir ../build --config Release --cmake_path "$CMAKE" --ctest_path "$CTEST" --build_shared_lib --use_dnnl --use_openmp $GPU_FLAGS
"$PYTHON_BIN_PATH" tools/ci_build/build.py --build_dir ../build --config Release --cmake_path "$CMAKE" --ctest_path "$CTEST" --build_shared_lib --use_dnnl $OPENMP_FLAGS $GPU_FLAGS

# install headers and libraries in standard directories
cp -r include/* ../include
Expand Down

0 comments on commit 2012b1a

Please sign in to comment.