Repository navigation
Expand file tree
/
Copy pathdownload-externals.sh
More file actions
executable file
·63 lines (55 loc) · 1.68 KB
/
Copy pathdownload-externals.sh
File metadata and controls
executable file
·63 lines (55 loc) · 1.68 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# Initialize external folder and stage dependencies
# Eigen, FFTW, fox-toolkit, FFTW, OpenGL, GLUT
# works on Linux and OSX
function confirm {
if [ ! ${BASH_ARGV[0]} = "-q" ]; then
read -p "Press enter to continue or Ctrl-C to abort: "
fi
}
unamestr=$(uname)
# download dependencies and install
pdir=$(dirname $0)
mkdir external
pushd external
eigenfile=3.3.3.tar.gz
eigenfolder=eigen-eigen-67e894c6cd8f
eigenurl=https://bitbucket.org/eigen/eigen/get/$eigenfile
echo "Downloading and installing Eigen to " $pdir/external/eigen
if [[ "$unamestr" == 'Darwin' ]]; then
# workaround, because there is no SSL capable curl on OSX, by defaul
echo "Using Safari to download Eigen3, then unpacking and staging to external."
echo "Note: You should switch back to this shell after the download completed."
confirm
open -a Safari $eigenurl
echo "Waiting for ~/Downloads/$eigenfolder.tar to exist"
while [ ! -f ~/Downloads/$eigenfolder.tar ]
do
sleep 1
done
tar -xf ~/Downloads/$eigenfolder.tar
else
wget $eigenurl -O eigen-3.3.3.tgz
tar xzf eigen-3.3.3.tgz
fi
mv $eigenfolder eigen
if [[ "$unamestr" == 'Darwin' ]]; then
echo
echo "Installing fox-toolkit, FFTW, and freeglut using homebrew"
confirm
brew install fox fftw freeglut lua
# brew install swing
openglinc=/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers
if [ -d $openglinc ]; then
mkdir include
ln -s $openglinc include/GL
else
echo "Could not find OpenGL headers at location"
echo $openglinc
fi
fi
popd
echo
echo "External dependencies successfully installed."
echo "You can build the app now, e.g., using: cd src; make -j4 release"
echo