forked from microsoft/CNTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-linux.sh
executable file
·46 lines (36 loc) · 1.38 KB
/
build-linux.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
#!/bin/bash
#
# Copyright (c) Microsoft. All rights reserved.
#
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
#
# Stop on error, trace commands
set -e -x
# Enter directory the script is located in
cd "$( dirname "${BASH_SOURCE[0]}" )"
# TODO configurable
MKLROOT=/opt/intel/compilers_and_libraries_2016.2.181/linux/mkl
MKLBUILDERROOT=$MKLROOT/tools/builder
CNTKCUSTOMMKLVERSION=$(cat version.txt)
rm -rf Publish
mkdir Publish{,/$CNTKCUSTOMMKLVERSION{,/x64}}
for THREADING in parallel sequential
do
LIBBASENAME=libmkl_cntk_$(echo $THREADING | cut -c 1)
make -f $MKLBUILDERROOT/makefile libintel64 \
export=functions.txt \
threading=$THREADING \
name=$LIBBASENAME \
MKLROOT=$MKLROOT
mkdir Publish/$CNTKCUSTOMMKLVERSION/x64/$THREADING
mv $LIBBASENAME.so Publish/$CNTKCUSTOMMKLVERSION/x64/$THREADING
done
cp -p $MKLROOT/../compiler/lib/intel64_lin/libiomp5.so Publish/$CNTKCUSTOMMKLVERSION/x64/parallel
rsync -av --files-from headers.txt $MKLROOT/include Publish/$CNTKCUSTOMMKLVERSION/include
cp -p README-for-redistributable.txt Publish/$CNTKCUSTOMMKLVERSION/README.txt
cp -p ../../LICENSE.md Publish/$CNTKCUSTOMMKLVERSION
cd Publish
tar -czf ../CNTKCustomMKL-Linux-$CNTKCUSTOMMKLVERSION.tgz $CNTKCUSTOMMKLVERSION
cd ..