-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_and_move
executable file
·48 lines (39 loc) · 1.89 KB
/
build_and_move
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
#!/bin/bash
###################################
## Script Constants #
###################################
## Shell Colors and Line Separator ##
RED_COLOR='\033[0;31m';
CYAN_COLOR='\033[0;36m';
NO_COLOR='\033[0m';
LINE_SEPARATOR="###############################################################\n";
## Filepath where to copy Hydrascalar to ##
BENCHMARKS_PATH="../working-benchmarks/benchmarks/hydra";
###################################
## Check Script Arguments ##
###################################
# Second conditional component checks for proper number of threads passed
if [[ "$#" -ne 1 || ( "$1" -ne 8 && "$1" -ne 16 && "$1" -ne 24 && "$1" -ne 40 && "$1" -ne 64 ) ]]; then
printf "${CYAN_COLOR}Improper call to build script. The proper format is the following: \n\n${NO_COLOR}";
printf "${RED_COLOR} ./build_and_move <# of Threads for Hydrascalar> \n\n${NO_COLOR}";
printf "${CYAN_COLOR}The number passed must be one of the following:${NO_COLOR}${RED_COLOR} 8, 16, 24, 40, or 64.\n${NO_COLOR}";
exit 1;
fi
###################################
## Compile Hydrascalar ##
###################################
# Print info header
printf "${CYAN_COLOR}$LINE_SEPARATOR${NO_COLOR}";
printf "${CYAN_COLOR}#\t Compiling Hydrascalar For${NO_COLOR} ${RED_COLOR}$1${NO_COLOR} ${CYAN_COLOR}Threads #\n${NO_COLOR}"
printf "${CYAN_COLOR}$LINE_SEPARATOR${NO_COLOR}";
printf "${RED_COLOR}NOTE: Warnings when compiling are turned off.\n${NO_COLOR}";
# Change directories and clean old files
cd ./hydra_1.0c;
make clean;
# Compile hydrascalar using the specified number of threads
# NOTE: Warnings for compilation are turned off (-w flag)
make hydra EXTRA_CFLAGS="-w -DCFG$1";
printf "\n";
# Move hydra binary into the benchmarks directory
printf "${CYAN_COLOR}Hydrascalar copied to:${NO_COLOR} ${RED_COLOR}$BENCHMARKS_PATH\n\n${NO_COLOR}";
cp ./hydra $BENCHMARKS_PATH