Skip to content

Commit

Permalink
Workaround onnx/onnx#3129 (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Dec 5, 2020
1 parent e66a8b7 commit b80df5d
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions tools/onnx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ sync() {

install() {
bold "onnx install"
if [ "$(uname -s)" = "Darwin" ]; then
echo "- macos [skip]"
return
fi
case "${OSTYPE}" in
linux*)
[ -x "$(command -v cmake)" ] || sudo apt install -y cmake
Expand All @@ -56,6 +52,10 @@ install() {
[ -x "$(command -v cmake)" ] || brew install cmake > /dev/null
[ -x "$(command -v protoc)" ] || brew install protobuf > /dev/null
protobuf=protobuf
if [ "$(uname -sm)" = "Darwin arm64" ]; then
PYTHON_ARCHITECTURE=$(${python} -c "import platform; print(platform.uname().machine);")
export CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES=${PYTHON_ARCHITECTURE}"
fi
;;
msys*)
[ ! -z "$(choco list --local-only --exacty --limit-output visualstudio2017-workload-vctools)" ] || $(choco install -yes visualstudio2017-workload-vctools) > /dev/null
Expand All @@ -80,9 +80,10 @@ install() {
esac
venv
${python} -m pip install --quiet --upgrade ${protobuf}
${python} -m pip install --quiet --upgrade numpy
export ONNX_ML=1
export ONNX_NAMESPACE=onnx
${python} -m pip install --quiet --no-use-pep517 "./third_party/source/onnx"
${python} -m pip install --quiet "./third_party/source/onnx"
deactivate
}

Expand All @@ -97,10 +98,6 @@ schema() {

metadata() {
bold "onnx metadata"
if [ "$(uname -s)" = "Darwin" ]; then
echo "- macos [skip]"
return
fi
[[ $(grep -U $'\x0D' ./source/onnx-metadata.json) ]] && crlf=1
venv
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
Expand Down

0 comments on commit b80df5d

Please sign in to comment.