-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
93 lines (68 loc) · 1.9 KB
/
Makefile
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Paths
FIRD_HOME = $(CURDIR)
SRC = $(FIRD_HOME)/src
LIB = $(FIRD_HOME)/lib
TES = $(FIRD_HOME)/tests
SOL = $(FIRD_HOME)/solvers
BIN = $(FIRD_HOME)/bin
OBJ = $(FIRD_HOME)/objects
DOC = $(FIRD_HOME)/doc
ifndef PROBLEM
PROBLEM = tests/examples/hs14.f90
endif
ifndef PPROBLEM
PPROBLEM = toyprob.f90
endif
# Compiler options
CC = gcc
FC = gfortran
FCC =
# Solver configuration parameters
SOLVERLIB = /opt/tango/algencan-3.0.0/lib
RESTORATION_INTERFACE = restoration
OPTIMIZATION_INTERFACE = optimization
# The following order do matters!
SLOPTS = -ldfoirfilter -lalgencan
# Linking options
LOPTS = $(SLOPTS)
export
all: lib
mkdir -p $(BIN)
base:
mkdir -p $(LIB)
$(MAKE) -C $(SRC) base
# Generate the main FIRD library
lib: base
$(MAKE) -C $(SOL) install
$(MAKE) -C $(SRC) all install
# User-defined executable
fird: all
$(FC) $(foreach i,$(SOLVERLIB) $(LIB),-L$(i) ) \
$(FCC) $(PROBLEM) $(SOL)/*.o $(LOPTS) -o $(BIN)/$@
# Hock-Schittkowski test set executable
hstests: all
$(MAKE) -C $(TES) hs
$(FC) $(foreach i,$(SOLVERLIB) $(LIB),-L$(i) ) \
$(FCC) tests/hs/hstests.f -lhs $(SOL)/*.o $(LOPTS) -o $(BIN)/$@
# Probability test
# To solve other probability problems using Genz's MVNDST subroutine,
# please add the new problem in the tests/probability directory and
# set the PPROBLEM variable accordingly
probability: all
$(MAKE) -C $(TES) probability
$(FC) $(foreach i,$(SOLVERLIB) $(LIB),-L$(i) ) -J$(LIB)\
$(FCC) tests/probability/$(PPROBLEM) -lprobability \
$(SOL)/*.o $(LOPTS) -o $(BIN)/$@
hsprobability: all
$(MAKE) -C $(TES) hs
$(MAKE) -C $(TES) hsprobability
$(FC) $(foreach i,$(SOLVERLIB) $(LIB),-L$(i) ) -J$(LIB)\
$(FCC) tests/probability/hsccp.f90 -lprobability -lhs \
$(SOL)/*.o $(LOPTS) -o $(BIN)/$@
# Documentation
doc:
$(MAKE) -C $(DOC) all
clean:
rm -vfr *~ $(LIB)/* $(BIN)/* $(OBJ)/*
$(foreach i,$(SRC) $(SOL) $(TES) $(DOC),$(MAKE) -C $(i) clean;)
.PHONY: lib all clean doc