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 extensions)
49 # Libraries (for some reason, we have to add the VC library path, although it is in the environment)
50 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"
52 # We use the BOOST Program Options library
53 BOOSTLIBS=/LIBPATH:C:\boost_1_36_0\stage\lib
55 # Compile using GNU C++ Compiler
57 # Output filename option
60 # Flags for the C++ compiler
61 CCFLAGS=/I./include /IC:\boost_1_36_0 /EHsc /Ox
63 CCFLAGS=$(CCFLAGS) /Zi /DDAI_DEBUG
67 CCFLAGS=$(CCFLAGS) /DWINDOWS
72 CCFLAGS=$(CCFLAGS) /DWITH_BP
73 OBJECTS=$(OBJECTS) bp$(OE)
76 CCFLAGS=$(CCFLAGS) /DWITH_MF
77 OBJECTS=$(OBJECTS) mf$(OE)
80 CCFLAGS=$(CCFLAGS) /DWITH_HAK
81 OBJECTS=$(OBJECTS) hak$(OE)
84 CCFLAGS=$(CCFLAGS) /DWITH_LC
85 OBJECTS=$(OBJECTS) lc$(OE)
88 CCFLAGS=$(CCFLAGS) /DWITH_TREEEP
89 OBJECTS=$(OBJECTS) treeep$(OE)
92 CCFLAGS=$(CCFLAGS) /DWITH_JTREE
93 OBJECTS=$(OBJECTS) jtree$(OE)
96 CCFLAGS=$(CCFLAGS) /DWITH_MR
97 OBJECTS=$(OBJECTS) mr$(OE)
101 # Replace the following by the directory where Matlab has been installed
102 MATLABDIR=/opt/matlab/bin
103 # Replace the following with the extension of compiled MEX files on this platform, e.g. .mexglx for x86
108 MEXFLAGS=$(MEXFLAGS) -g /DDAI_DEBUG
111 MEXFLAGS=$(MEXFLAGS) -largeArrayDims
113 MEXFLAGS=$(MEXFLAGS) /DSMALLMEM
117 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)/exceptions.h
119 TARGETS=tests utils $(LIB)/libdai$(LE) example$(EE)
120 # testregression disabled, it uses diff
121 # doc disabled, it uses doxygen
123 TARGETS = $(TARGETS) matlabs
127 matlabs : matlab/dai.$(ME) matlab/dai_readfg.$(ME) matlab/dai_writefg.$(ME) matlab/dai_potstrength.$(ME)
129 $(LIB)/libdai$(LE) : bipgraph$(OE) daialg$(OE) alldai$(OE) clustergraph$(OE) factorgraph$(OE) properties$(OE) regiongraph$(OE) util$(OE) weightedgraph$(OE) exceptions$(OE) varset$(OE) $(OBJECTS)
130 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) varset$(OE) $(OBJECTS)
132 tests : tests/testdai$(EE)
134 utils : utils/createfg$(EE) utils/fg2dot$(EE) utils/fginfo$(EE)
136 testregression : tests/testdai
137 echo Testing...this can take a while...
138 cd tests; time ./testregression; cd ..
140 doc : $(INC)/*.h $(SRC)/*.cpp doxygen.conf
144 del *$(OE) *.ilk *.pdb *$(EE) matlab\*.$(ME) matlab\*$(OE) tests\testdai$(EE) tests\*.pdb tests\*.ilk utils\*$(EE) utils\*.pdb utils\*.ilk $(LIB)\libdai$(LE)
146 !INCLUDE Makefile.shared