source: trunk/Test/Makefile.solve @ 170

Last change on this file since 170 was 170, checked in by forrest, 16 years ago

for solve

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1# Select optimization (-O or -g). -O will be automatically bumped up to the
2# highest level of optimization the compiler supports. If want something in
3# between then specify the exact level you want, e.g., -O1 or -O2
4OptLevel := -g
5
6##############################################################################
7# You should not need to edit below this line unless you are configuring cbc
8# for multiple solvers, or for a single solver other than clp.
9##############################################################################
10
11# The location of the customized Makefiles
12# also inherited from the parent Makefile
13
14include ${MakefileDir}/Makefile.coin
15include ${MakefileDir}/Makefile.location
16
17# Include files, library directory and name, compile-time defines.
18
19# The pattern is (hopefully) obvious. Add or uncomment the appropriate lines
20# for your favourite solver. The appropriate lines of code must be installed in
21# the conditional compilation blocks in CbcMain.cpp in order for any of this to
22# work. One conditional compilation block is at the head of the file and
23# selects #include headers. The second is at the start of main() and creates a
24# vector of available solvers.
25
26IncDir := ${CbcIncDir} ${CglIncDir}
27IncDir += ${OsiClpIncDir} ${ClpIncDir}
28IncDir += ${OsiIncDir} ${CoinIncDir}
29IncDir += ${bzlibIncDir} ${zlibIncDir} $(lapackIncDir)
30IncDir := ${ClpIncDir} ${CoinIncDir} ${bzlibIncDir} ${zlibIncDir} $(lapackIncDir)
31LibDir := ${ClpLibDir} ${CoinLibDir} ${bzlibLibDir} ${zlibLibDir} $(lapackLibDir) $(GlpkLibDir)
32ifeq ($(VolDefine),COIN_HAS_VOL)
33LibName := ${ClpLibName} ${CoinLibName} ${bzlibLibName} ${zlibLibName} $(lapackLibName) $(readlineLibName) $(GlpkLibName) $(VolLibName)
34else
35LibName := ${ClpLibName} ${CoinLibName} ${bzlibLibName} ${zlibLibName} $(lapackLibName) $(readlineLibName)
36endif
37Define := ${ClpDefine} ${CoinDefine} ${bzlibDefine} ${zlibDefine} $(lapackLibDefine) $(readlineDefine) $(VolDefine)
38
39LibDir += ${CbcLibDir} ${CglLibDir}
40LibDir += ${OsiLibDir}
41
42LibName += $(OsiCbcLibName) ${CbcLibName} ${CglLibName} $(OsiClpLibName)
43ifeq ($(VolDefine),COIN_HAS_VOL)
44LibName += $(VolLibName)
45endif
46LibName += ${OsiLibName}
47
48Define += ${CbcDefine} ${CglDefine}
49Define += ${OsiClpDefine}
50Define += ${OsiDefine}
51IncDir += ./include
52
53#use clp
54CXXFLAGS += $(addprefix -D,COIN_USE_CLP)
55
56#tell parameter handling to allow for CbcModel and OsiSolverInterface
57CXXFLAGS += -DCOIN_USE_CBC
58##############################################################################
59# You should not need to edit below this line.
60##############################################################################
61
62CXXFLAGS += $(OPTFLAG)
63ifeq ($(OptLevel),-g)
64    CXXFLAGS += -DCBC_DEBUG
65endif
66
67TESTSRC := CoinSolve.cpp
68TESTSRC += CbcOrClpParam.cpp
69TESTSRC += unitTest.cpp
70TESTSRC += unitTestClp.cpp
71
72###############################################################################
73
74space:= $(empty) $(empty)
75OptVersion := $(subst $(space),_,$(OptLevel))
76
77TARGETDIR := $(UNAME)$(OptVersion)
78DEPDIR := dep
79
80VPATH := . : include : Junk : ${TARGETDIR} : ${DEPDIR}
81
82#########################################################################
83
84CXXFLAGS += $(addprefix -I,${IncDir})
85CXXFLAGS += $(addprefix -D,${Define})
86
87LIBDIRS := ${LibDir}
88LIBS    := ${LibName}
89
90LDFLAGS := $(addprefix -L,$(LIBDIRS))
91LDFLAGS += $(call ifprefix,$(SHLINKPREFIX),$(LIBDIRS))
92LDFLAGS += $(patsubst lib%,-l%,$(basename $(LIBS)))
93
94ifeq ($(findstring Linux,${UNAME}),Linux)
95        CXXFLAGS +=     -DREADLINE
96endif
97#LDFLAGS += -lefence
98
99###############################################################################
100
101TESTOBJ := $(addprefix $(TARGETDIR)/, $(TESTSRC:.cpp=.o))
102TESTDEP := $(addprefix $(DEPDIR)/, $(TESTSRC:.cpp=.d))
103
104###############################################################################
105# This one must be right before the rules
106
107include ${MakefileDir}/Makefile.rules
108
109###############################################################################
110
111.DELETE_ON_ERROR:
112
113.PHONY: unitTest
114
115unitTest: $(TARGETDIR)/solve
116
117$(TARGETDIR)/solve : $(TESTOBJ)
118        @rm -rf Junk
119        @echo ""
120        @echo Creating solve
121        @mkdir -p $(TARGETDIR)
122        @rm -f $@
123        $(CXX) $(CXXFLAGS) -o $@ $(TESTOBJ) $(LDFLAGS) $(SYSLD) -lm
124        ${CP} $@ ..
125
126###############################################################################
127
128%::
129        @mkdir -p Junk
130        touch Junk/$(notdir $@)
131
132###############################################################################
133
134-include $(TESTDEP)
Note: See TracBrowser for help on using the repository browser.