-
Notifications
You must be signed in to change notification settings - Fork 22
/
compile.sh
executable file
·161 lines (126 loc) · 2.78 KB
/
compile.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/bin/bash
# exit immediately on error
set -e
UNAME=`uname`
if [ -z $HT ]; then
echo "We can't see the HDK, exiting."
exit 1
fi
usage ()
{
echo
echo "Usage:"
echo
echo "./compile.sh [flags]"
echo
echo "flags:"
echo
echo " -f|--fast - skip the 3rd party compile stage"
echo " -n|--noinstall - just build, don't install the dso's"
echo
}
# command line args
while [ $# -gt 0 ]; do
case "$1" in
-f|--fast)
FAST=1
;;
-n|--noinstall)
NOINSTALL=1
;;
*)
echo "Unknown flag \"${1}\""
usage
exit 1
esac
shift
done
case $UNAME in
"Darwin")
DLLEXT="dylib"
;;
"Linux")
DLLEXT="so"
;;
*)
echo "Unsupported architecture \"${UNAME}\", exiting."
exit 1
;;
esac
if [ -z $FAST ]; then
echo
echo " *** Testing compilation environment ***"
echo
mkdir -p tmp
cp $HT/samples/SOP/SOP_Star.* ./tmp
chmod u+rw tmp/SOP_Star.*
pushd tmp
hcustom -i . SOP_Star.C
if [ ! -e SOP_Star.${DLLEXT} ]; then
echo
echo "Sorry, we couldn't compile SOP_Star.C so you need to get that in order first!"
echo "Start by reading about the HDK at http://www.sidefx.com/docs"
echo
exit 1
fi
popd
fi
HIH="${HOME}/houdini${HOUDINI_MAJOR_RELEASE}.${HOUDINI_MINOR_RELEASE}"
if [ -z $FAST ]; then
echo
echo " *** Compiling the 3rdparty dependencies. *** "
echo
pushd 3rdparty
case $UNAME in
"Darwin")
./build_osx.sh
;;
"Linux")
./build_linux.sh
;;
esac
popd
fi
echo
echo " *** Compiling the HOT. *** "
echo
case $UNAME in
"Darwin")
IFLAGS="-I. -I./3rdparty/include -I ./3rdparty/osx/include"
LFLAGS="-L ./3rdparty/osx/lib -l fftw3f -l blitz"
;;
"Linux")
IFLAGS="-I. -I./3rdparty/include -I ./3rdparty/linux/include"
LFLAGS="-L ./3rdparty/linux/lib -l fftw3f -l blitz"
;;
esac
if [ -z "$NOINSTALL" ]; then
INST="-i ${HIH}/dso"
else
INST="-i ."
fi
FLAGS="$IFLAGS $LFLAGS $INST"
hcustom -e $FLAGS SOP_Ocean.C
hcustom -e $FLAGS VEX_Ocean.C
# not ported yet ...
# hcustom SOP_Cleave.C
VEXDSO="${HIH}/vex"
mkdir -p ${VEXDSO}
# don't nuke VEXdso if it exists
if [ -z "$NOINSTALL" ]; then
if [ -e ${VEXDSO}/VEXdso ]; then
cp ${VEXDSO}/VEXdso ${VEXDSO}/VEXdso.orig
cat ${VEXDSO}/VEXdso VEXdso_${UNAME} | uniq > ${VEXDSO}/VEXdso
else
cp VEXdso_${UNAME} ${VEXDSO}/VEXdso
fi
fi
if [ -z "$NOINSTALL" ]; then
echo
echo " *** Finished installing, go make waves. *** "
echo
else
echo
echo " *** Finished building. *** "
echo
fi