-
Notifications
You must be signed in to change notification settings - Fork 17
/
compile
executable file
·44 lines (34 loc) · 1.49 KB
/
compile
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
#! /bin/bash
# colors for echo output
RED='\033[0;31m'
NC='\033[0m' # No Color
# print error function
print_need_tool() {
echo -e "${RED}ERROR: we need $1 installed to compile.${NC}"
exit 1
}
# check that java, scala and sbt are installed
if [[ $(which java) == "" ]]; then
print_need_tool "java"
fi
if [[ $(which sbt) == "" ]]; then
print_need_tool "sbt"
fi
# check for gurobi
if [[ ! -f lib/gurobi.jar ]]; then
echo -e "${RED}Please copy gurobi.jar in the lib/ directory.${NC}"
echo -e "Some parts of repetita (e.g., MCF and the MIPTwoSRNoSplit solver) need gurobi."
echo -e "- If you don't have gurobi, you can visit http://www.gurobi.com to get more information on how to download and install the tool"
echo -e "- Once you have installed gurobi, you can find the location of gurobi.py by searching your filesystem. For example, in Linux and macOS, you can run the command: find / -name gurobi.jar 2>&1 | grep -v \"^find:\""
exit 1
fi
# compile using sbt
echo -e "Building the executable"
sbt clean
sbt pack
# create a symbolic link file in the root directory
rm -f repetita
ln -s target/pack/bin/repetita repetita
chmod +x repetita
# generate doc. If everything is ok, notify the user.
bash repetita -doc && echo -e "\nGood news! Basic functions seem to work: You can already run ./repetita\nTry, for example: $ ./repetita -graph data/2016TopologyZooUCL_inverseCapacity/Abilene.graph -demands data/2016TopologyZooUCL_inverseCapacity/Abilene.0000.demands -solver defoCP -t 1 -scenario SingleSolverRun\n"