1 # Copyright (C) 2006-2008 Joris Mooij [j dot mooij at science dot ru dot nl]
2 # Radboud University Nijmegen, The Netherlands
4 # This file is part of libDAI.
6 # libDAI is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # libDAI is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with libDAI; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 # Enable/disable various approximate inference methods
29 # Build with debug info?
31 # Build matlab interface?
33 # New/old matlab version?
35 # Windows or linux (default)?
43 # Extensions (library, object, executable extensions)
51 # We use the BOOST Program Options library
52 BOOSTLIBS
=-lboost_program_options
54 # Compile using GNU C++ Compiler
57 # Flags for the C++ compiler
58 CCFLAGS
=-Wno-deprecated
-Wall
-W
-Wextra
-fpic
-I.
/include -Llib
-O3
#-pg #-static #-DVERBOSE
60 CCFLAGS
:=$(CCFLAGS
) -g
-DDAI_DEBUG
64 CCFLAGS
=$(CCFLAGS
) -DWINDOWS
67 OBJECTS
:=exactinf
$(OE
)
69 CCFLAGS
:=$(CCFLAGS
) -DWITH_BP
70 OBJECTS
:=$(OBJECTS
) bp
$(OE
)
73 CCFLAGS
:=$(CCFLAGS
) -DWITH_MF
74 OBJECTS
:=$(OBJECTS
) mf
$(OE
)
77 CCFLAGS
:=$(CCFLAGS
) -DWITH_HAK
78 OBJECTS
:=$(OBJECTS
) hak
$(OE
)
81 CCFLAGS
:=$(CCFLAGS
) -DWITH_LC
82 OBJECTS
:=$(OBJECTS
) lc
$(OE
)
85 CCFLAGS
:=$(CCFLAGS
) -DWITH_TREEEP
86 OBJECTS
:=$(OBJECTS
) treeep
$(OE
)
89 CCFLAGS
:=$(CCFLAGS
) -DWITH_JTREE
90 OBJECTS
:=$(OBJECTS
) jtree
$(OE
)
93 CCFLAGS
:=$(CCFLAGS
) -DWITH_MR
94 OBJECTS
:=$(OBJECTS
) mr
$(OE
)
98 # Replace the following by the directory where Matlab has been installed
99 MATLABDIR
=/opt
/matlab
/bin
100 # Replace the following with the extension of compiled MEX files on this platform, e.g. .mexglx for x86
105 MEXFLAGS
:=$(MEXFLAGS
) -g
-DDAI_DEBUG
108 MEXFLAGS
:=$(MEXFLAGS
) -largeArrayDims
110 MEXFLAGS
:=$(MEXFLAGS
) -DSMALLMEM
114 HEADERS
=$(INC
)/bipgraph.h
$(INC
)/diffs.h
$(INC
)/index.h
$(INC
)/var.h
$(INC
)/factor.h
$(INC
)/varset.h
$(INC
)/prob.h
$(INC
)/daialg.h
$(INC
)/properties.h
$(INC
)/alldai.h
$(INC
)/enum.h
$(INC
)/x2x.h
$(INC
)/exceptions.h
116 TARGETS
=tests utils
$(LIB
)/libdai
$(LE
) example
$(EE
) testregression doc
118 TARGETS
:=$(TARGETS
) matlabs
123 matlabs
: matlab
/dai.
$(ME
) matlab
/dai_readfg.
$(ME
) matlab
/dai_writefg.
$(ME
) matlab
/dai_potstrength.
$(ME
)
125 $(LIB
)/libdai
$(LE
) : bipgraph
$(OE
) daialg
$(OE
) alldai
$(OE
) clustergraph
$(OE
) factorgraph
$(OE
) properties
$(OE
) regiongraph
$(OE
) util
$(OE
) weightedgraph
$(OE
) x2x
$(OE
) exceptions
$(OE
) $(OBJECTS
)
126 ar rcus
$(LIB
)/libdai
$(LE
) bipgraph
$(OE
) daialg
$(OE
) alldai
$(OE
) clustergraph
$(OE
) factorgraph
$(OE
) properties
$(OE
) regiongraph
$(OE
) util
$(OE
) weightedgraph
$(OE
) x2x
$(OE
) exceptions
$(OE
) $(OBJECTS
)
128 tests
: tests
/test$(EE
)
130 utils
: utils
/createfg
$(EE
) utils
/fg2dot
$(EE
) utils
/fginfo
$(EE
)
132 testregression
: tests
/test
133 echo Testing...this can take a while...
134 cd tests
; time .
/testregression
; cd ..
136 doc
: $(INC
)/*.h
$(SRC
)/*.
cpp doxygen.conf
140 rm *$(OE
) example
$(EE
) matlab
/*.
$(ME
) matlab
/*$(OE
) tests
/test$(EE
) utils
/fg2dot
$(EE
) utils
/createfg
$(EE
) utils
/fginfo
$(EE
) $(LIB
)/libdai
$(LE
); echo
143 bipgraph
$(OE
) : $(SRC
)/bipgraph.
cpp $(HEADERS
)
144 $(CC
) $(CCFLAGS
) -c
$(SRC
)/bipgraph.
cpp
146 daialg
$(OE
) : $(SRC
)/daialg.
cpp $(HEADERS
)
147 $(CC
) $(CCFLAGS
) -c
$(SRC
)/daialg.
cpp
149 exactinf
$(OE
) : $(SRC
)/exactinf.
cpp $(INC
)/exactinf.h
$(HEADERS
)
150 $(CC
) $(CCFLAGS
) -c
$(SRC
)/exactinf.
cpp
152 bp
$(OE
) : $(SRC
)/bp.
cpp $(INC
)/bp.h
$(HEADERS
)
153 $(CC
) $(CCFLAGS
) -c
$(SRC
)/bp.
cpp
155 lc
$(OE
) : $(SRC
)/lc.
cpp $(INC
)/lc.h
$(HEADERS
)
156 $(CC
) $(CCFLAGS
) -c
$(SRC
)/lc.
cpp
158 mf
$(OE
) : $(SRC
)/mf.
cpp $(INC
)/mf.h
$(HEADERS
)
159 $(CC
) $(CCFLAGS
) -c
$(SRC
)/mf.
cpp
161 factorgraph
$(OE
) : $(SRC
)/factorgraph.
cpp $(INC
)/factorgraph.h
$(HEADERS
)
162 $(CC
) $(CCFLAGS
) -c
$(SRC
)/factorgraph.
cpp
164 util
$(OE
) : $(SRC
)/util.
cpp $(INC
)/util.h
$(HEADERS
)
165 $(CC
) $(CCFLAGS
) -c
$(SRC
)/util.
cpp
167 regiongraph
$(OE
) : $(SRC
)/regiongraph.
cpp $(INC
)/regiongraph.h
$(HEADERS
)
168 $(CC
) $(CCFLAGS
) -c
$(SRC
)/regiongraph.
cpp
170 hak
$(OE
) : $(SRC
)/hak.
cpp $(INC
)/hak.h
$(HEADERS
) $(INC
)/regiongraph.h
171 $(CC
) $(CCFLAGS
) -c
$(SRC
)/hak.
cpp
173 clustergraph
$(OE
) : $(SRC
)/clustergraph.
cpp $(INC
)/clustergraph.h
$(HEADERS
)
174 $(CC
) $(CCFLAGS
) -c
$(SRC
)/clustergraph.
cpp
176 jtree
$(OE
) : $(SRC
)/jtree.
cpp $(INC
)/jtree.h
$(HEADERS
) $(INC
)/weightedgraph.h
$(INC
)/clustergraph.h
$(INC
)/regiongraph.h
177 $(CC
) $(CCFLAGS
) -c
$(SRC
)/jtree.
cpp
179 treeep
$(OE
) : $(SRC
)/treeep.
cpp $(INC
)/treeep.h
$(HEADERS
) $(INC
)/weightedgraph.h
$(INC
)/clustergraph.h
$(INC
)/regiongraph.h
$(INC
)/jtree.h
180 $(CC
) $(CCFLAGS
) -c
$(SRC
)/treeep.
cpp
182 weightedgraph
$(OE
) : $(SRC
)/weightedgraph.
cpp $(INC
)/weightedgraph.h
$(HEADERS
)
183 $(CC
) $(CCFLAGS
) -c
$(SRC
)/weightedgraph.
cpp
185 mr
$(OE
) : $(SRC
)/mr.
cpp $(INC
)/mr.h
$(HEADERS
)
186 $(CC
) $(CCFLAGS
) -c
$(SRC
)/mr.
cpp
188 properties
$(OE
) : $(SRC
)/properties.
cpp $(HEADERS
)
189 $(CC
) $(CCFLAGS
) -c
$(SRC
)/properties.
cpp
191 exceptions
$(OE
) : $(SRC
)/exceptions.
cpp $(HEADERS
)
192 $(CC
) $(CCFLAGS
) -c
$(SRC
)/exceptions.
cpp
194 alldai
$(OE
) : $(SRC
)/alldai.
cpp $(HEADERS
)
195 $(CC
) $(CCFLAGS
) -c
$(SRC
)/alldai.
cpp
197 x2x
$(OE
) : $(SRC
)/x2x.
cpp $(HEADERS
)
198 $(CC
) $(CCFLAGS
) -c
$(SRC
)/x2x.
cpp
204 example
$(EE
) : example.
cpp $(HEADERS
) $(LIB
)/libdai
$(LE
)
205 $(CC
) $(CCFLAGS
) -o example
$(EE
) example.
cpp $(LIBS
)
210 tests
/test$(EE
) : tests
/test.
cpp $(HEADERS
) $(LIB
)/libdai
$(LE
)
211 $(CC
) $(CCFLAGS
) -o tests
/test$(EE
) tests
/test.
cpp $(LIBS
) $(BOOSTLIBS
)
217 matlab
/dai.
$(ME
) : matlab
/dai.
cpp $(HEADERS
) matlab
/matlab
$(OE
) $(LIB
)/libdai
$(LE
)
218 $(MEX
) $(MEXFLAGS
) -o matlab
/dai matlab
/dai.
cpp matlab
/matlab
$(OE
) $(LIB
)/libdai
$(LE
)
220 matlab
/dai_readfg.
$(ME
) : matlab
/dai_readfg.
cpp $(HEADERS
) factorgraph
$(OE
) matlab
/matlab
$(OE
) exceptions
$(OE
)
221 $(MEX
) $(MEXFLAGS
) -o matlab
/dai_readfg matlab
/dai_readfg.
cpp factorgraph
$(OE
) matlab
/matlab
$(OE
) exceptions
$(OE
)
223 matlab
/dai_writefg.
$(ME
) : matlab
/dai_writefg.
cpp $(HEADERS
) factorgraph
$(OE
) matlab
/matlab
$(OE
) exceptions
$(OE
)
224 $(MEX
) $(MEXFLAGS
) -o matlab
/dai_writefg matlab
/dai_writefg.
cpp factorgraph
$(OE
) matlab
/matlab
$(OE
) exceptions
$(OE
)
226 matlab
/dai_potstrength.
$(ME
) : matlab
/dai_potstrength.
cpp $(HEADERS
) matlab
/matlab
$(OE
) exceptions
$(OE
)
227 $(MEX
) $(MEXFLAGS
) -o matlab
/dai_potstrength matlab
/dai_potstrength.
cpp matlab
/matlab
$(OE
) exceptions
$(OE
)
229 matlab
/matlab
$(OE
) : matlab
/matlab.
cpp matlab
/matlab.h
$(HEADERS
)
230 $(MEX
) $(MEXFLAGS
) -outdir matlab
-c matlab
/matlab.
cpp
236 utils
/createfg
$(EE
) : utils
/createfg.
cpp $(HEADERS
) $(LIB
)/libdai
$(LE
)
237 $(CC
) $(CCFLAGS
) -o utils
/createfg utils
/createfg.
cpp $(LIBS
) $(BOOSTLIBS
)
239 utils
/fg2dot
$(EE
) : utils
/fg2dot.
cpp $(HEADERS
) $(LIB
)/libdai
$(LE
)
240 $(CC
) $(CCFLAGS
) -o utils
/fg2dot utils
/fg2dot.
cpp $(LIBS
)
242 utils
/fginfo
$(EE
) : utils
/fginfo.
cpp $(HEADERS
) $(LIB
)/libdai
$(LE
)
243 $(CC
) $(CCFLAGS
) -o utils
/fginfo utils
/fginfo.
cpp $(LIBS
)