-
Notifications
You must be signed in to change notification settings - Fork 0
/
e.sh
executable file
·75 lines (46 loc) · 1.4 KB
/
e.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
#!/bin/bash
# script file for BASH
# which bash
# save this file as e.sh
# chmod +x e.sh
# ./e.sh
# checked in https://www.shellcheck.net/
printf "make pgm files \n"
gcc e.c -lm -Wall -march=native -fopenmp
if [ $? -ne 0 ]
then
echo ERROR: compilation failed !!!!!!
exit 1
fi
export OMP_DISPLAY_ENV="TRUE"
printf "display OMP info \n"
printf "run the compiled program\n"
time ./a.out > e.txt
export OMP_DISPLAY_ENV="FALSE"
printf "change Image Magic settings\n"
export MAGICK_WIDTH_LIMIT=100MP
export MAGICK_HEIGHT_LIMIT=100MP
printf "convert all pgm files to png using Image Magic v 6 convert \n"
for file in *.pgm ; do
# b is name of file without extension
b=$(basename -- "$file" .pgm)
# convert from pgm to gif and add text ( level ) using ImageMagic
# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
convert "$file" -pointsize 50 -annotate +10+100 "${b:0:4}" "${b}".gif
echo "$file"
done
# convert gif files to animated gif
# https://stackoverflow.com/questions/69691394/how-to-convert-images-with-negative-number-as-a-name-to-animation-video
readarray -t files < <(printf '%s\n' *.gif | LC_ALL=C sort -n)
convert "${files[@]}" -resize 600x600 a600.gif
printf "delete all pgm files \n"
rm ./*.pgm
echo OK
printf "info about software \n"
echo "$SHELL"
bash --version
make -v
gcc --version
convert -version
convert -list resource
# end