Skip to content

Commit 5dcdfd2

Browse files
committed
Build: fixes #4
1 parent 9543ac9 commit 5dcdfd2

File tree

2 files changed

+34
-41
lines changed

2 files changed

+34
-41
lines changed

automation/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ include $(MK)/rules
5454
#----------------------------------------------------------------------------------------------
5555

5656
prebuild:
57-
@if [ -d $(ROOT)/deps ]; then echo $$'Dependencies are not in place.\nPlease run \'make fetch\'.'; exit 1; fi
57+
@if [ ! -d $(ROOT)/deps ]; then echo $$'Dependencies are not in place.\nPlease run \'make fetch\'.'; exit 1; fi
5858

5959
$(TARGET): prebuild $(MK_MAKEFILES) $(DEPS)
6060
$(MAKE) -C $(BINDIR)

get_deps.sh

Lines changed: 33 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -49,35 +49,31 @@ cd ${DEPS_DIR}
4949
# PREFIX=${DEPS_DIR}/install
5050
# mkdir -p ${PREFIX}
5151

52-
# DLPACK_PREFIX=${PREFIX}/dlpack
53-
# TF_PREFIX=${PREFIX}/libtensorflow
54-
# TORCH_PREFIX=${PREFIX}/libtorch
55-
# ORT_PREFIX=${PREFIX}/onnxruntime
52+
DLPACK=dlpack
53+
LIBTENSORFLOW=libtensorflow
54+
LIBTORCH=libtorch
55+
MKL=mkl
56+
ONNXRUNTIME=onnxruntime
5657

5758
######################################################################################## DLPACK
5859

59-
[[ $FORCE == 1 ]] && rm -rf dlpack
60+
[[ $FORCE == 1 ]] && rm -rf $DLPACK
6061

61-
if [[ ! -d dlpack ]]; then
62+
if [[ ! -d $DLPACK ]]; then
6263
echo "Cloning dlpack ..."
63-
git clone --depth 1 https://github.com/dmlc/dlpack.git
64+
git clone --depth 1 https://github.com/dmlc/dlpack.git $DLPACK
6465
echo "Done."
6566
else
6667
echo "dlpack is in place."
6768
fi
6869

69-
# if [[ ! -d dlpack/include ]]; then
70-
# mkdir -p dlpack
71-
# ln -sf ${DEPS_DIR}/dlpack/include ${DLPACK_PREFIX}/include
72-
# fi
73-
7470
#################################################################################### TENSORFLOW
7571

7672
TF_VERSION="1.14.0"
7773

78-
[[ $FORCE == 1 ]] && rm -rf tensorflow
74+
[[ $FORCE == 1 ]] && rm -rf $LIBTENSORFLOW
7975

80-
if [[ ! -d tensorflow ]]; then
76+
if [[ ! -d $LIBTENSORFLOW ]]; then
8177
echo "Installing TensorFlow ..."
8278

8379
if [[ $OS == linux ]]; then
@@ -112,10 +108,10 @@ if [[ ! -d tensorflow ]]; then
112108

113109
[[ ! -f $LIBTF_ARCHIVE || $FORCE == 1 ]] && wget --quiet $LIBTF_URL_BASE/$LIBTF_ARCHIVE
114110

115-
rm -rf tensorflow.x
116-
mkdir tensorflow.x
117-
tar xf $LIBTF_ARCHIVE --no-same-owner --strip-components=1 -C tensorflow.x
118-
mv tensorflow.x tensorflow
111+
rm -rf $LIBTENSORFLOW.x
112+
mkdir $LIBTENSORFLOW.x
113+
tar xf $LIBTF_ARCHIVE --no-same-owner --strip-components=1 -C $LIBTENSORFLOW.x
114+
mv $LIBTENSORFLOW.x $LIBTENSORFLOW
119115

120116
echo "Done."
121117
else
@@ -126,9 +122,9 @@ fi
126122

127123
PT_VERSION="1.2.0"
128124

129-
[[ $FORCE == 1 ]] && rm -rf libtorch
125+
[[ $FORCE == 1 ]] && rm -rf $LIBTORCH
130126

131-
if [[ ! -d libtorch ]]; then
127+
if [[ ! -d $LIBTORCH ]]; then
132128
echo "Installing libtorch ..."
133129

134130
if [[ $OS == linux ]]; then
@@ -157,12 +153,12 @@ if [[ ! -d libtorch ]]; then
157153

158154
[[ ! -f $LIBTORCH_ARCHIVE || $FORCE == 1 ]] && wget -q $LIBTORCH_URL
159155

160-
rm -rf libtorch.x
161-
mkdir libtorch.x
156+
rm -rf $LIBTORCH.x
157+
mkdir $LIBTORCH.x
162158

163-
tar xf $LIBTORCH_ARCHIVE --no-same-owner -C libtorch.x
164-
mv libtorch.x/libtorch libtorch
165-
rmdir libtorch.x
159+
tar xf $LIBTORCH_ARCHIVE --no-same-owner -C $LIBTORCH.x
160+
mv $LIBTORCH.x/libtorch $LIBTORCH
161+
rmdir $LIBTORCH.x
166162

167163
echo "Done."
168164
else
@@ -181,10 +177,10 @@ if [[ ! -d mkl ]]; then
181177
MKL_ARCHIVE=mklml_${MKL_OS}_${MKL_BUNDLE_VER}.tgz
182178
[[ ! -e ${MKL_ARCHIVE} ]] && wget -q https://github.com/intel/mkl-dnn/releases/download/v${MKL_VERSION}/${MKL_ARCHIVE}
183179

184-
rm -rf mkl.x
185-
mkdir mkl.x
186-
tar xzf ${MKL_ARCHIVE} --no-same-owner --strip-components=1 -C mkl.x
187-
mv mkl.x mkl
180+
rm -rf $MKL.x
181+
mkdir $MKL.x
182+
tar xzf ${MKL_ARCHIVE} --no-same-owner --strip-components=1 -C $MKL.x
183+
mv $MKL.x $MKL
188184

189185
echo "Done."
190186
fi
@@ -196,9 +192,9 @@ fi
196192

197193
ORT_VERSION="0.5.0"
198194

199-
[[ $FORCE == 1 ]] && rm -rf onnxruntime
195+
[[ $FORCE == 1 ]] && rm -rf $ONNXRUNTIME
200196

201-
if [[ ! -d onnxruntime ]]; then
197+
if [[ ! -d $ONNXRUNTIME ]]; then
202198
echo "Installing ONNXRuntime ..."
203199

204200
if [[ $OS == linux ]]; then
@@ -227,15 +223,12 @@ if [[ ! -d onnxruntime ]]; then
227223

228224
ORT_ARCHIVE=onnxruntime-${ORT_OS}-${ORT_ARCH}${ORT_BUILD}-${ORT_VERSION}.tgz
229225

230-
if [[ ! -e ${ORT_ARCHIVE} ]]; then
231-
wget -q $ORT_URL_BASE/${ORT_ARCHIVE}
232-
echo "Done."
233-
fi
226+
[[ ! -e ${ORT_ARCHIVE} ]] && wget -q $ORT_URL_BASE/${ORT_ARCHIVE}
234227

235-
rm -rf onnxruntime.x
236-
mkdir onnxruntime.x
237-
tar xzf ${ORT_ARCHIVE} --no-same-owner --strip-components=1 -C onnxruntime.x
238-
mv onnxruntime.x onnxruntime
228+
rm -rf $ONNXRUNTIME.x
229+
mkdir $ONNXRUNTIME.x
230+
tar xzf ${ORT_ARCHIVE} --no-same-owner --strip-components=1 -C $ONNXRUNTIME.x
231+
mv $ONNXRUNTIME.x $ONNXRUNTIME
239232

240233
echo "Done."
241234
else
@@ -256,4 +249,4 @@ fi
256249
# echo "Binaries in place."
257250
#fi
258251

259-
echo "Done."
252+
# echo "Done."

0 commit comments

Comments
 (0)