source: trunk/Test/Makefile.solve @ 304

Last change on this file since 304 was 304, checked in by lou, 14 years ago

Remove OsiCbc? from link; not used.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.7 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 += $(OsiLibName) ${CbcLibName} ${CglLibName} $(OsiClpLibName)
43ifeq ($(VolDefine),COIN_HAS_VOL)
44LibName += $(VolLibName)
45endif
46#add for static links
47LibName += ${OsiLibName} $(CoinLibName)
48
49Define += ${CbcDefine} ${CglDefine}
50Define += ${OsiClpDefine}
51Define += ${OsiDefine}
52IncDir += ./include ../../Clp/Test
53
54#use clp
55ifneq (,$(filter COIN_HAS_OSICLP, $(Define)))
56#  add in USE
57#CXXFLAGS += $(addprefix -D,COIN_USE_CLP)
58else
59  $(error COIN_HAS_CLP is not defined in Makefiles/Makefile.location. Probably the line 'CoinLibsDefined += COIN_libClp' is commented out.)
60endif
61
62#tell parameter handling to allow for CbcModel and OsiSolverInterface
63CXXFLAGS += -DCOIN_USE_CBC -DCOIN_NO_CLP_MESSAGE
64##############################################################################
65# You should not need to edit below this line.
66##############################################################################
67
68CXXFLAGS += $(OPTFLAG)
69ifeq ($(OptLevel),-g)
70    CXXFLAGS += -DCBC_DEBUG
71endif
72
73TESTSRC := CoinSolve.cpp
74TESTSRC += CbcOrClpParam.cpp
75TESTSRC += unitTestClp.cpp
76TESTSRC += Cbc_ampl.cpp
77
78###############################################################################
79
80space:= $(empty) $(empty)
81OptVersion := $(subst $(space),_,$(OptLevel))
82
83TARGETDIR := $(UNAME)$(OptVersion)
84DEPDIR := dep
85
86VPATH := . : include : Junk : ${TARGETDIR} : ${DEPDIR} : $(CoinDir)/Clp/Test
87
88#########################################################################
89
90CXXFLAGS += $(addprefix -I,${IncDir})
91CXXFLAGS += $(addprefix -D,${Define})
92
93LIBDIRS := ${LibDir}
94LIBS    := ${LibName}
95
96LDFLAGS := $(addprefix -L,$(LIBDIRS))
97LDFLAGS += $(call ifprefix,$(SHLINKPREFIX),$(LIBDIRS))
98LDFLAGS += $(patsubst lib%,-l%,$(basename $(LIBS)))
99#for Ampl
100ifneq ($(origin CoinObjAmpl),undefined)
101LDFLAGS +=  $(CoinObjAmpl)
102endif
103
104ifeq ($(findstring Linux,${UNAME}),Linux)
105        CXXFLAGS +=     -DREADLINE
106endif
107#LDFLAGS += -lefence
108
109###############################################################################
110
111TESTOBJ := $(addprefix $(TARGETDIR)/, $(TESTSRC:.cpp=.o))
112TESTDEP := $(addprefix $(DEPDIR)/, $(TESTSRC:.cpp=.d))
113
114###############################################################################
115# This one must be right before the rules
116
117include ${MakefileDir}/Makefile.rules
118
119###############################################################################
120
121.DELETE_ON_ERROR:
122
123.PHONY: solve solver
124
125solve solver: $(TARGETDIR)/solve
126
127$(TARGETDIR)/solve : $(TESTOBJ)
128        @rm -rf Junk
129        @echo ""
130        @echo Creating solve
131        @mkdir -p $(TARGETDIR)
132        @rm -f $@
133        $(CXX) $(CXXFLAGS) -o $@ $(TESTOBJ) $(LDFLAGS) $(SYSLD) -lm
134        ${CP} $@ ..
135
136###############################################################################
137
138%::
139        @mkdir -p Junk
140        touch Junk/$(notdir $@)
141
142###############################################################################
143
144-include $(TESTDEP)
Note: See TracBrowser for help on using the repository browser.