realitydeslab / holokit-sdk

HoloKit SDK
2 stars 0 forks source link

SDK-7 Mediapipe compile error fix #5

Closed botaohu closed 2 years ago

botaohu commented 3 years ago

Bazel 4.0 will fail the compilation. We need to downgrade it to 3.7.2 by

  brew unlink bazel
  wget https://raw.githubusercontent.com/Homebrew/homebrew-core/e30dc66cf73b120e72f337115ec9bb83cef0000a/Formula/bazel.rb
  brew install --formula bazel.rb

Go to https://github.com/holoi/mediapipe

bazel build  --linkopt=""  -c opt --verbose_failures --objc_enable_binary_stripping=true --features=dead_strip --strip=always --config=ios_arm64 mediapipe/iosdc:HandTracker

unzip the framework to SDK folder.

unzip -o bazel-bin/mediapipe/iosdc/HandTracker.zip -d ../../../holokit/sdk/third_party/
botaohu commented 3 years ago

Go to https://github.com/holoi/mediapipe

We need to downgrade it to 3.7.2 by

  brew unlink bazel
  wget https://raw.githubusercontent.com/Homebrew/homebrew-core/e30dc66cf73b120e72f337115ec9bb83cef0000a/Formula/bazel.rb
  brew install --formula bazel.rb
# With BITCODE
bazel build  --linkopt="-s"  -c opt --verbose_failures --objc_enable_binary_stripping=true --features=dead_strip --strip=always --copt=-fembed-bitcode  --apple_bitcode=embedded --config=ios_arm64 mediapipe/iosdc:HandTracker

# NO BITCODE Only 13mb.
bazel build  --linkopt=""  -c opt --verbose_failures --objc_enable_binary_stripping=true --features=dead_strip --strip=always --config=ios_arm64 mediapipe/iosdc:HandTracker

unzip the framework to SDK folder.

unzip -o bazel-out/applebin_ios-ios_arm64-opt-ST-1d1505307ac3/bin/mediapipe/iosdc/HandTracker.zip -d ../../../holokit/sdk/third_party/
botaohu commented 3 years ago

No Bitcode is preferred.