-
Notifications
You must be signed in to change notification settings - Fork 1
/
compile
executable file
·46 lines (45 loc) · 1.37 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
44
45
46
#!/bin/bash
rm libforthyd.a
COMPILER="gfortran"
COMP_FLAGS="-c -O3"
LINK_FLAGS="-O3"
LIBRARIES="-lblas -llapack"
PROGRAM_NAME="eigensplines.out"
###########################################
echo "____________________________________________________________"
echo "start compilation"
echo "host:" $HOST
echo "compiler:" $COMPILER
echo "comp flags:" $COMP_FLAGS
echo "link flags:" $LINK_FLAGS
echo "libraries:" $LIBRARIES
echo "program name:" $PROGRAM_NAME
echo "____________________________________________________________"
###########################################
#Compiler to .o files
echo "compiling to object files..."
$COMPILER $COMP_FLAGS src/bsplvb.f &
$COMPILER $COMP_FLAGS src/dbsplvb.f90 &
$COMPILER $COMP_FLAGS src/gauleg.f &
$COMPILER $COMP_FLAGS src/getsplines.f90 &
$COMPILER $COMP_FLAGS src/getdsplines.f90 &
$COMPILER $COMP_FLAGS src/isinf.f90 &
$COMPILER $COMP_FLAGS src/qsort.f90 &
wait
echo "done"
echo "____________________________________________________________"
#
ar rsv libforthyd.a *.o
rm *.o
echo "done"
echo "____________________________________________________________"
#
echo "compiling main and linking..."
echo "done"
$COMPILER src/eigensplines.f90 -L./ -lforthyd $LIBRARIES -o $PROGRAM_NAME $LINK_FLAGS
#
echo "Compilation of" $PROGRAM_NAME "finished"
echo "Size of program:"
size $PROGRAM_NAME
echo "____________________________________________________________"
echo