1 # Copyright (C) 2006-2008 Joris Mooij [joris dot mooij at tuebingen dot mpg dot de]
2 # Radboud University Nijmegen, The Netherlands /
3 # Max Planck Institute for Biological Cybernetics, Germany
5 # This file is part of libDAI.
7 # libDAI is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # libDAI is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with libDAI; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 # Enable/disable various approximate inference methods
30 # Build with debug info?
32 # Build matlab interface?
34 # New/old matlab version?
36 # Windows or linux (default)?
44 # Extensions (library, object, executable, matlab compiled MEX file)
50 # Libraries (for some reason, we have to add the VC library path, although it is in the environment)
51 LIBS=/link $(LIB)/libdai$(LE) /LIBPATH:"C:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB" /LIBPATH:"C:\Program Files\Microsoft Visual Studio 9.0\VC\LIB" /LIBPATH:"C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib"
53 # We use the BOOST Program Options library
54 BOOSTLIBS=/LIBPATH:C:\boost_1_36_0\stage\lib
56 # Compile using GNU C++ Compiler
58 # Output filename option
61 # Flags for the C++ compiler
62 CCFLAGS=/Iinclude /IC:\boost_1_36_0 /EHsc /Ox
64 CCFLAGS=$(CCFLAGS) /Zi /DDAI_DEBUG
68 CCFLAGS=$(CCFLAGS) /DWINDOWS
73 CCFLAGS=$(CCFLAGS) /DDAI_WITH_BP
74 OBJECTS=$(OBJECTS) bp$(OE)
77 CCFLAGS=$(CCFLAGS) /DDAI_WITH_MF
78 OBJECTS=$(OBJECTS) mf$(OE)
81 CCFLAGS=$(CCFLAGS) /DDAI_WITH_HAK
82 OBJECTS=$(OBJECTS) hak$(OE)
85 CCFLAGS=$(CCFLAGS) /DDAI_WITH_LC
86 OBJECTS=$(OBJECTS) lc$(OE)
89 CCFLAGS=$(CCFLAGS) /DDAI_WITH_TREEEP
90 OBJECTS=$(OBJECTS) treeep$(OE)
93 CCFLAGS=$(CCFLAGS) /DDAI_WITH_JTREE
94 OBJECTS=$(OBJECTS) jtree$(OE)
97 CCFLAGS=$(CCFLAGS) /DDAI_WITH_MR
98 OBJECTS=$(OBJECTS) mr$(OE)
102 # Replace the following by the directory where Matlab has been installed
104 MEX=$(MATLABDIR)\bin\mex
105 MEXFLAGS=-Iinclude CXX\#$(CC) CXXFLAGS\#"/EHsc /Ox"
107 MEXFLAGS=$(MEXFLAGS) -g /DDAI_DEBUG
110 MEXFLAGS=$(MEXFLAGS) -largeArrayDims
112 MEXFLAGS=$(MEXFLAGS) /DSMALLMEM
116 HEADERS=$(INC)/bipgraph.h $(INC)/index.h $(INC)/var.h $(INC)/factor.h $(INC)/varset.h $(INC)/smallset.h $(INC)/prob.h $(INC)/daialg.h $(INC)/properties.h $(INC)/alldai.h $(INC)/enum.h $(INC)/exceptions.h
118 TARGETS=tests utils $(LIB)/libdai$(LE) examples
119 # testregression disabled, it uses diff
120 # doc disabled, it uses doxygen, graphviz and latex
122 TARGETS = $(TARGETS) matlabs
126 examples : examples/example$(EE) examples/example_bipgraph$(EE) examples/example_varset$(EE)
128 matlabs : matlab/dai$(ME) matlab/dai_readfg$(ME) matlab/dai_writefg$(ME) matlab/dai_potstrength$(ME)
130 $(LIB)/libdai$(LE) : bipgraph$(OE) daialg$(OE) alldai$(OE) clustergraph$(OE) factorgraph$(OE) properties$(OE) regiongraph$(OE) util$(OE) weightedgraph$(OE) exceptions$(OE) $(OBJECTS)
131 lib /out:$(LIB)/libdai$(LE) bipgraph$(OE) daialg$(OE) alldai$(OE) clustergraph$(OE) factorgraph$(OE) properties$(OE) regiongraph$(OE) util$(OE) weightedgraph$(OE) exceptions$(OE) $(OBJECTS)
133 tests : tests/testdai$(EE)
135 utils : utils/createfg$(EE) utils/fg2dot$(EE) utils/fginfo$(EE)
137 testregression : tests/testdai$(EE)
138 echo Starting regression test...this can take a minute or so!
139 cd tests; time ./testregression; cd ..
141 doc : $(INC)/*.h $(SRC)/*.cpp examples/*.cpp doxygen.conf
145 del *$(OE) *.ilk *.pdb *$(EE) matlab\*$(ME) examples\*$(EE) tests\testdai$(EE) tests\*.pdb tests\*.ilk utils\*$(EE) utils\*.pdb utils\*.ilk $(LIB)\libdai$(LE)
147 !INCLUDE Makefile.shared