-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
87 lines (63 loc) · 2.39 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
# this include is part of lvvlib
ifeq ($(USER),lvv)
HOMEDIR := /home/lvv/p/volnitsky.com/
INCLUDE := $(HOMEDIR)/include.mk
else
INCLUDE := /dev/null
endif
include $(INCLUDE)
SPEED ?= DEBUG
PREFIX ?= /usr/local
VERSION = 0.4
#FCFLAGS += -O2
FCFLAGS += -frange-check -fbounds-check -O0 -ggdb3
LDFLAGS += -L. -L /usr/local/lib -lgsl -lgslcblas -lcondor -llopti -lgfortran
CXXFLAGS += -std=c++11 -I /usr/local/include/ -I .. -I .
XGRAPHIC = xgraphic -scat -markcol=-1 -g2 -logy -leg -legpos=3 -legsiz=1 -legtyp=2 -titgen="Convergance speed for dirivative-free algorithms" -titx="Objective function evaluation count" -tity="Distance to optimum: log10 ( | X - X_opt | )"
FC=gfortran
#.DEFAULT_GOAL := t-lopti-r
#.PHONY: t-lopti-r all
test: t-lopti
./t-lopti
install: liblopti.so
mkdir -p $(PREFIX)/include/lopti/
cp -v *.h $(PREFIX)/include/lopti/
mkdir -p $(PREFIX)/lib/
cp -va liblopti.so* $(PREFIX)/lib/
doclean:
rm -f liblopti.so*
rm -f {,newuoa/}*.o
rm -f doc/*.{html,css}
rm -f t-{lopti,newuoa}
rm -f gmon.out
liblopti.so: *.h newuoa/bigden.o newuoa/biglag.o newuoa/calfun.o newuoa/trsapp.o newuoa/update.o
$(FC) $(FCFLAGS) -fPIC -c newuoa/{bigden,biglag,calfun,trsapp,update}.f
gcc -shared -Wl,-soname,liblopti.so.$(VERSION) -o liblopti.so.$(VERSION) *.o
ln -sf liblopti.so.$(VERSION) liblopti.so
t-%: t-%.cc %.h *.h liblopti.so
t-%-r: t-%.cc *.h liblopti.so
t-%: SPEED=DEBUG
t-lopti: t-lopti.cc liblopti.so
t-lopti-xg: t-lopti log/condor
$<
cd log; LANG=C.iso88591 $(XGRAPHIC) `find -type f \( -newer ../$< -o -cmin -1 \) -printf "%f\n"`
log/condor: t-lopti
t-lopti-ps: t-lopti.ps
t-lopti.ps: t-lopti t-lopti-r
$<
cd log; $(XGRAPHIC) -pscoltex=../$@ `find -type f \( -newer ../$< -o -cmin -1 \) -printf "%f\n"`
gsview $@
t-condor: CXXFLAGS += -I ..
t-condor: LDFLAGS += -L /usr/local/lib/ -lcondor -lm
t-condor: t-condor.cc condor-wrap.h
$(CXX) $(CXXFLAGS) -DOPTI=CONDOR $< -o $@ $(LDFLAGS)
t-line_search: t-line_search.cc line_search.h
$(CXX) $(CXXFLAGS) -DOPTI=NM $< -o $@ $(LDFLAGS)
t-nm: t.cc gsl-nelder-mead-wrap.h
$(CXX) $(CXXFLAGS) -DOPTI=NM $< -o $@ $(LDFLAGS)
t-newuoa-old: newuoa/t-newuoa.cc newuoa-wrap.h lopti.h
# rm -f *.o
#$(FC) $(FCFLAGS) -c bigden.f biglag.f calfun.f trsapp.f update.f
$(CXX) $(CXXFLAGS) $< newuoa/*.o -lgfortran -o $@
sync:
cp -v condor-wrap.h gsl-nelder-mead-wrap.h Makefile t.cc ../nf/lopti-ss/