-
Notifications
You must be signed in to change notification settings - Fork 5
/
prepare_libxsmm.sh
72 lines (69 loc) · 2.1 KB
/
prepare_libxsmm.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
###############################################################################
# Copyright (c) Intel Corporation - All rights reserved. #
# This file is part of the LIBXSMM library. #
# #
# For information on the license, see the LICENSE file. #
# Further information: https://github.com/libxsmm/libxsmm/ #
# SPDX-License-Identifier: BSD-3-Clause #
###############################################################################
#!/bin/bash
CC_USE=gcc
CXX_USE=g++
if [[ -z "${PARLOOPER_COMPILER}" ]]; then
CC_USE=gcc
CXX_USE=g++
elif [[ "${PARLOOPER_COMPILER}" == "icc" ]]; then
CC_USE=icc
CXX_USE=icpc
elif [[ "${PARLOOPER_COMPILER}" == "clang" ]]; then
CC_USE=clang
CXX_USE=clang++
elif [[ "${PARLOOPER_COMPILER}" == "gcc" ]]; then
CC_USE=gcc
CXX_USE=g++
else
CC_USE=gcc
CXX_USE=g++
fi
BRANCH=main
BRANCHDNN=main
if [ $# -eq 2 ]; then
BRANCH=$1
BRANCHDNN=$2
fi
echo "Building PARLOOPER with libxsmm branch $BRANCH and libxsmm-dnn branch $BRANCHDNN"
#clone LIBXSMM
if [ ! -d "libxsmm" ]; then
echo "libxsmm not exist, clone one from remote repo ..."
git clone https://github.com/libxsmm/libxsmm.git libxsmm
cd libxsmm
else
echo "libxsmm exists, just updating ..."
cd libxsmm
git pull
fi
echo "building LIBXSMM..."
echo "switching to $BRANCH branch ..."
git checkout $BRANCH
git pull
make realclean && make CC=${CC_USE} CXX=${CXX_USE} FC= -j16
echo "done building LIBXSMM"
cd ..
#clone LIBXSMM_DNN
if [ ! -d "libxsmm_dnn" ]; then
echo "libxsmm_dnn not exist, clone one from remote repo ..."
git clone https://github.com/libxsmm/libxsmm_dnn.git libxsmm_dnn
cd libxsmm_dnn
else
echo "libxsmm_dnn exists, just updating ..."
cd libxsmm_dnn
git pull
fi
echo "building LIBXSMM_DNN..."
echo "switching to $BRANCHDNN branch ..."
git checkout $BRANCHDNN
git pull
export LIBXSMMROOT=../libxsmm
#make realclean && make CC=${CC_USE} CXX=${CXX_USE} FC= -j16
#echo "done building LIBXSMM_DNN"
cd ..