source: trunk/Test/Makefile.solve @ 172

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

move files to Clp/Test?

  • 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 ../../Clp/Test
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 += unitTestClp.cpp
70
71###############################################################################
72
73space:= $(empty) $(empty)
74OptVersion := $(subst $(space),_,$(OptLevel))
75
76TARGETDIR := $(UNAME)$(OptVersion)
77DEPDIR := dep
78
79VPATH := . : include : Junk : ${TARGETDIR} : ${DEPDIR} : $(CoinDir)/Clp/Test
80
81#########################################################################
82
83CXXFLAGS += $(addprefix -I,${IncDir})
84CXXFLAGS += $(addprefix -D,${Define})
85
86LIBDIRS := ${LibDir}
87LIBS    := ${LibName}
88
89LDFLAGS := $(addprefix -L,$(LIBDIRS))
90LDFLAGS += $(call ifprefix,$(SHLINKPREFIX),$(LIBDIRS))
91LDFLAGS += $(patsubst lib%,-l%,$(basename $(LIBS)))
92
93ifeq ($(findstring Linux,${UNAME}),Linux)
94        CXXFLAGS +=     -DREADLINE
95endif
96#LDFLAGS += -lefence
97
98###############################################################################
99
100TESTOBJ := $(addprefix $(TARGETDIR)/, $(TESTSRC:.cpp=.o))
101TESTDEP := $(addprefix $(DEPDIR)/, $(TESTSRC:.cpp=.d))
102
103###############################################################################
104# This one must be right before the rules
105
106include ${MakefileDir}/Makefile.rules
107
108###############################################################################
109
110.DELETE_ON_ERROR:
111
112.PHONY: unitTest
113
114unitTest: $(TARGETDIR)/solve
115
116$(TARGETDIR)/solve : $(TESTOBJ)
117        @rm -rf Junk
118        @echo ""
119        @echo Creating solve
120        @mkdir -p $(TARGETDIR)
121        @rm -f $@
122        $(CXX) $(CXXFLAGS) -o $@ $(TESTOBJ) $(LDFLAGS) $(SYSLD) -lm
123        ${CP} $@ ..
124
125###############################################################################
126
127%::
128        @mkdir -p Junk
129        touch Junk/$(notdir $@)
130
131###############################################################################
132
133-include $(TESTDEP)
Note: See TracBrowser for help on using the repository browser.