-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·52 lines (47 loc) · 1.46 KB
/
build.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
#! /bin/bash
GPP=g++
which g++.par 2>/dev/null >/dev/null && GPP=g++.par && OLDGPP=g++
which $GPP || GPP=""
CLANGPP=clang++
which clang++.par 2>/dev/null >/dev/null && CLANGPP=clang++.par
which $CLANGPP || CLANGPP=""
ICC=icc
[ -x ~/intel/bin/icc ] && ICC=~/intel/bin/icc
which $ICC || ICC=""
[ "$IMPLS" ] || IMPLS="`grep '[#]ifdef' foo.cc from_rocksdb.cc | grep -o 'IMPL_[^ ]*'`"
for IMPL in $IMPLS; do
for FIXED_K in any 8 6 3; do
if [ "$FIXED_K" = "any" ]; then
KOPT=""
else
KOPT="-DFIXED_K=$FIXED_K"
fi
if [ "$GPP" ]; then
CMD="$GPP -D$IMPL $KOPT -std=c++11 -march=native -mtune=native -O9 -o foo_gcc_${IMPL}_${FIXED_K}.out foo.cc"
echo "$CMD"
$CMD &
else
echo "NOTE: Skipping g++ build; compiler not found"
fi
if [ "$OLDGPP" ]; then
CMD="$OLDGPP -D$IMPL $KOPT -std=c++11 -march=native -mtune=native -O9 -o foo_oldgcc_${IMPL}_${FIXED_K}.out foo.cc"
echo "$CMD"
$CMD &
fi
if [ "$CLANGPP" ]; then
CMD="$CLANGPP -D$IMPL $KOPT -std=c++11 -march=native -mtune=native -Ofast -o foo_clang_${IMPL}_${FIXED_K}.out foo.cc"
echo "$CMD"
$CMD &
else
echo "NOTE: Skipping clang build; compiler not found"
fi
if [ "$ICC" ]; then
CMD="$ICC -D$IMPL $KOPT -std=c++11 -march=native -mtune=native -Ofast -o foo_intel_${IMPL}_${FIXED_K}.out foo.cc"
echo "$CMD"
$CMD &
else
echo "NOTE: Skipping intel build; compiler not found"
fi
done
wait
done