forked from tensorflow/haskell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_macos_dependencies.sh
executable file
·45 lines (35 loc) · 1.27 KB
/
install_macos_dependencies.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -eu
echo "Installing macOS System Dependencies"
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
TMP_DIR=$(mktemp -d)
echo "Downloading libtensorflow..."
curl https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-darwin-x86_64-1.14.0.tar.gz > "$TMP_DIR/libtensorflow.tar.gz"
echo "Extracting and copying libtensorflow..."
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"
sudo mv /usr/local/lib/libtensorflow.so /usr/local/lib/libtensorflow.dylib
sudo install_name_tool -id libtensorflow.dylib /usr/local/lib/libtensorflow.dylib
echo "Installing submodule dependencies"
git submodule update --init --recursive
echo ""
echo "Finished"