2017-03-10 01:54:24 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
|
2017-07-20 22:17:50 +02:00
|
|
|
echo "Installing macOS System Dependencies"
|
2017-03-10 01:54:24 +01:00
|
|
|
echo "=================================="
|
|
|
|
|
|
|
|
if ! type "brew" > /dev/null; then
|
|
|
|
echo "Requires homebrew to be installed."
|
|
|
|
echo "Install homebrew from https://brew.sh/"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if brew ls --versions protobuf > /dev/null; then
|
|
|
|
echo "protobuf installation detected."
|
|
|
|
else
|
|
|
|
echo "protobuf not installed, installing with homebrew."
|
|
|
|
brew install protobuf
|
|
|
|
fi
|
|
|
|
|
|
|
|
if brew ls --versions snappy > /dev/null; then
|
|
|
|
echo "snappy installation detected."
|
|
|
|
else
|
|
|
|
echo "snappy not installed, installing with homebrew."
|
|
|
|
brew install snappy
|
|
|
|
fi
|
|
|
|
|
2018-05-21 17:20:20 +02:00
|
|
|
TMP_DIR=$(mktemp -d)
|
|
|
|
|
2017-03-10 01:54:24 +01:00
|
|
|
echo "Downloading libtensorflow..."
|
2019-07-15 23:16:58 +02:00
|
|
|
curl https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-darwin-x86_64-1.14.0.tar.gz > "$TMP_DIR/libtensorflow.tar.gz"
|
2017-03-10 01:54:24 +01:00
|
|
|
|
|
|
|
echo "Extracting and copying libtensorflow..."
|
2018-05-21 17:20:20 +02:00
|
|
|
tar zxf "$TMP_DIR/libtensorflow.tar.gz" -C "$TMP_DIR"
|
|
|
|
sudo rsync -a "$TMP_DIR/lib/" /usr/local/lib
|
|
|
|
sudo rsync -a "$TMP_DIR/include/" /usr/local/include
|
|
|
|
rm -rf "$TMP_DIR"
|
2017-04-04 05:27:22 +02:00
|
|
|
sudo mv /usr/local/lib/libtensorflow.so /usr/local/lib/libtensorflow.dylib
|
2017-03-10 01:54:24 +01:00
|
|
|
|
|
|
|
sudo install_name_tool -id libtensorflow.dylib /usr/local/lib/libtensorflow.dylib
|
|
|
|
|
|
|
|
echo "Installing submodule dependencies"
|
|
|
|
git submodule update --init --recursive
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Finished"
|