Made state a member variable of Gibbs, and added a cache for factor entries.
[libdai.git] / Makefile
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
4 #
5 # This file is part of libDAI.
6 #
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.
11 #
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.
16 #
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
20
21
22 # Enable/disable various approximate inference methods
23 WITH_BP=true
24 WITH_MF=true
25 WITH_HAK=true
26 WITH_LC=true
27 WITH_TREEEP=true
28 WITH_JTREE=true
29 WITH_MR=true
30 WITH_GIBBS=true
31 # Build with debug info?
32 DEBUG=true
33 # Build matlab interface?
34 WITH_MATLAB=
35 # New/old matlab version?
36 NEW_MATLAB=true
37 # Windows or linux (default)?
38 WINDOWS=
39
40 # Directories
41 INC=include/dai
42 SRC=src
43 LIB=lib
44
45 # Extensions (library, object, executable, matlab compiled MEX file)
46 LE=.a
47 OE=.o
48 EE=
49 ME=.mexglx
50
51 # Libraries
52 LIBS=-ldai
53
54 # We use the BOOST Program Options library
55 BOOSTLIBS=-lboost_program_options
56
57 # Compile using GNU C++ Compiler
58 CC=g++
59 # Output filename option
60 CCO=-o
61
62 # Flags for the C++ compiler
63 CCFLAGS=-O3 -Wno-deprecated -Wall -W -Wextra -fpic -Iinclude -Llib
64 CCDEBUGFLAGS=-g -DDAI_DEBUG
65
66 # Build targets
67 TARGETS=tests utils $(LIB)/libdai$(LE) examples testregression doc
68
69 ifdef WITH_MATLAB
70 # Replace the following by the directory where Matlab has been installed
71 MATLABDIR=/agbs/share/sw/matlab
72 MEX=$(MATLABDIR)/bin/mex
73 MEXFLAGS=-Iinclude CXX\#$(CC) CXXFLAGS\#'-O3 -Wno-deprecated -Wall -W -Wextra -fpic'
74 endif
75
76
77 include Makefile.shared
78
79
80 $(LIB)/libdai$(LE) : bipgraph$(OE) daialg$(OE) alldai$(OE) clustergraph$(OE) factorgraph$(OE) properties$(OE) regiongraph$(OE) util$(OE) weightedgraph$(OE) exceptions$(OE) $(OBJECTS)
81 -mkdir -p lib
82 ar rcus $(LIB)/libdai$(LE) bipgraph$(OE) daialg$(OE) alldai$(OE) clustergraph$(OE) factorgraph$(OE) properties$(OE) regiongraph$(OE) util$(OE) weightedgraph$(OE) exceptions$(OE) $(OBJECTS)
83
84 testregression : tests/testdai$(EE)
85 @echo Starting regression test...this can take a minute or so!
86 cd tests && ./testregression && cd ..
87
88 doc : $(INC)/*.h $(SRC)/*.cpp examples/*.cpp doxygen.conf
89 doxygen doxygen.conf
90
91 .PHONY : clean
92 clean :
93 -rm *$(OE)
94 -rm matlab/*$(ME)
95 -rm examples/example$(EE) examples/example_bipgraph$(EE) examples/example_varset$(EE)
96 -rm tests/testdai$(EE)
97 -rm utils/fg2dot$(EE) utils/createfg$(EE) utils/fginfo$(EE)
98 -rm -R doc
99 -rm -R lib