Significant improvement of documentation
[libdai.git] / Makefile.win
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 # Build with debug info?
31 DEBUG=true
32 # Build matlab interface?
33 #WITH_MATLAB=true
34 # New/old matlab version?
35 NEW_MATLAB=true
36 # Windows or linux (default)?
37 WINDOWS=true
38
39 # Directories
40 INC=include/dai
41 SRC=src
42 LIB=lib
43
44 # Extensions (library, object, executable, MEX file extensions)
45 LE=.lib
46 OE=.obj
47 EE=.exe
48 ME=.mexglx
49
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"
52
53 # We use the BOOST Program Options library
54 BOOSTLIBS=/LIBPATH:C:\boost_1_36_0\stage\lib
55
56 # Compile using GNU C++ Compiler
57 CC=cl
58 # Output filename option
59 CCO=/Fe
60
61 # Flags for the C++ compiler
62 CCFLAGS=/I./include /IC:\boost_1_36_0 /EHsc /Ox
63 !IFDEF DEBUG
64 CCFLAGS=$(CCFLAGS) /Zi /DDAI_DEBUG
65 !ENDIF
66
67 !IFDEF WINDOWS
68 CCFLAGS=$(CCFLAGS) /DWINDOWS
69 !ENDIF
70
71 OBJECTS=exactinf$(OE)
72 !IFDEF WITH_BP
73 CCFLAGS=$(CCFLAGS) /DDAI_WITH_BP
74 OBJECTS=$(OBJECTS) bp$(OE)
75 !ENDIF
76 !IFDEF WITH_MF
77 CCFLAGS=$(CCFLAGS) /DDAI_WITH_MF
78 OBJECTS=$(OBJECTS) mf$(OE)
79 !ENDIF
80 !IFDEF WITH_HAK
81 CCFLAGS=$(CCFLAGS) /DDAI_WITH_HAK
82 OBJECTS=$(OBJECTS) hak$(OE)
83 !ENDIF
84 !IFDEF WITH_LC
85 CCFLAGS=$(CCFLAGS) /DDAI_WITH_LC
86 OBJECTS=$(OBJECTS) lc$(OE)
87 !ENDIF
88 !IFDEF WITH_TREEEP
89 CCFLAGS=$(CCFLAGS) /DDAI_WITH_TREEEP
90 OBJECTS=$(OBJECTS) treeep$(OE)
91 !ENDIF
92 !IFDEF WITH_JTREE
93 CCFLAGS=$(CCFLAGS) /DDAI_WITH_JTREE
94 OBJECTS=$(OBJECTS) jtree$(OE)
95 !ENDIF
96 !IFDEF WITH_MR
97 CCFLAGS=$(CCFLAGS) /DDAI_WITH_MR
98 OBJECTS=$(OBJECTS) mr$(OE)
99 !ENDIF
100
101 !IFDEF WITH_MATLAB
102 # Replace the following by the directory where Matlab has been installed
103 MATLABDIR=/opt/matlab/bin
104 # Replace the following with the extension of compiled MEX files on this platform, e.g. .mexglx for x86
105 MEX=$(MATLABDIR)/mex
106 MEXFLAGS=-I.
107 !IFDEF DEBUG
108 MEXFLAGS=$(MEXFLAGS) -g /DDAI_DEBUG
109 !ENDIF
110 !IFDEF NEW_MATLAB
111 MEXFLAGS=$(MEXFLAGS) -largeArrayDims
112 !ELSE
113 MEXFLAGS=$(MEXFLAGS) /DSMALLMEM
114 !ENDIF
115 !ENDIF
116
117 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
119 TARGETS=tests utils $(LIB)/libdai$(LE) example$(EE)
120 # testregression disabled, it uses diff
121 # doc disabled, it uses doxygen
122 !IFDEF WITH_MATLAB
123 TARGETS = $(TARGETS) matlabs
124 !ENDIF
125 all : $(TARGETS)
126
127 matlabs : matlab/dai$(ME) matlab/dai_readfg$(ME) matlab/dai_writefg$(ME) matlab/dai_potstrength$(ME)
128
129 $(LIB)/libdai$(LE) : bipgraph$(OE) daialg$(OE) alldai$(OE) clustergraph$(OE) factorgraph$(OE) properties$(OE) regiongraph$(OE) util$(OE) weightedgraph$(OE) exceptions$(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) $(OBJECTS)
131
132 tests : tests/testdai$(EE)
133
134 utils : utils/createfg$(EE) utils/fg2dot$(EE) utils/fginfo$(EE)
135
136 testregression : tests/testdai
137 echo Testing...this can take a while...
138 cd tests; time ./testregression; cd ..
139
140 doc : $(INC)/*.h $(SRC)/*.cpp doxygen.conf
141 doxygen doxygen.conf
142
143 clean :
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)
145
146 !INCLUDE Makefile.shared