-
Notifications
You must be signed in to change notification settings - Fork 0
/
simplecompile.sh
37 lines (26 loc) · 961 Bytes
/
simplecompile.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
#!/bin/bash
# To more easily compile and run this program on CSS Linux Lab
# Lines starting with '$' indicate what is typed on command line
# if you get the following error:
# -bash: ./simplecompile.sh: /bin/bash^M: bad interpreter: No such file or directory
# run dos2unix to fix it
# $ dos2unix simplecompile.sh
# make this file executable
# $ chmod 700 simplecompile.sh
# redirect the output and stderr from this file to output.txt
# $ ./simplecompile.sh > output.txt 2>&1
date
echo "*** compiling with clang++ to create an executable called myprogram"
clang++ --version
clang++ -std=c++14 -Wall -Wextra -Wno-sign-compare *.cpp -g -o myprogram
echo "*** running clang-tidy using options from .clang-tidy"
clang-tidy --version
clang-tidy *.cpp -- -std=c++14
echo "*** running myprogram"
./myprogram
#valgrind will detect memory leaks
echo "*** running with valgrind"
valgrind ./myprogram
echo "*** cleaning up, deleting myprogram"
rm myprogram
date