# Copyright (C) 2006-2008 Joris Mooij [joris dot mooij at tuebingen dot mpg dot de] # Radboud University Nijmegen, The Netherlands / # Max Planck Institute for Biological Cybernetics, Germany # # This file is part of libDAI. # # libDAI is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # libDAI is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with libDAI; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Enable/disable various approximate inference methods WITH_BP=true WITH_MF=true WITH_HAK=true WITH_LC=true WITH_TREEEP=true WITH_JTREE=true WITH_MR=true # Build with debug info? DEBUG=true # Build matlab interface? #WITH_MATLAB=true # New/old matlab version? NEW_MATLAB=true # Windows or linux (default)? WINDOWS=true # Directories INC=include/dai SRC=src LIB=lib # Extensions (library, object, executable, MEX file extensions) LE=.lib OE=.obj EE=.exe ME=.mexglx # Libraries (for some reason, we have to add the VC library path, although it is in the environment) 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" # We use the BOOST Program Options library BOOSTLIBS=/LIBPATH:C:\boost_1_36_0\stage\lib # Compile using GNU C++ Compiler CC=cl # Output filename option CCO=/Fe # Flags for the C++ compiler CCFLAGS=/I./include /IC:\boost_1_36_0 /EHsc /Ox !IFDEF DEBUG CCFLAGS=$(CCFLAGS) /Zi /DDAI_DEBUG !ENDIF !IFDEF WINDOWS CCFLAGS=$(CCFLAGS) /DWINDOWS !ENDIF OBJECTS=exactinf$(OE) !IFDEF WITH_BP CCFLAGS=$(CCFLAGS) /DDAI_WITH_BP OBJECTS=$(OBJECTS) bp$(OE) !ENDIF !IFDEF WITH_MF CCFLAGS=$(CCFLAGS) /DDAI_WITH_MF OBJECTS=$(OBJECTS) mf$(OE) !ENDIF !IFDEF WITH_HAK CCFLAGS=$(CCFLAGS) /DDAI_WITH_HAK OBJECTS=$(OBJECTS) hak$(OE) !ENDIF !IFDEF WITH_LC CCFLAGS=$(CCFLAGS) /DDAI_WITH_LC OBJECTS=$(OBJECTS) lc$(OE) !ENDIF !IFDEF WITH_TREEEP CCFLAGS=$(CCFLAGS) /DDAI_WITH_TREEEP OBJECTS=$(OBJECTS) treeep$(OE) !ENDIF !IFDEF WITH_JTREE CCFLAGS=$(CCFLAGS) /DDAI_WITH_JTREE OBJECTS=$(OBJECTS) jtree$(OE) !ENDIF !IFDEF WITH_MR CCFLAGS=$(CCFLAGS) /DDAI_WITH_MR OBJECTS=$(OBJECTS) mr$(OE) !ENDIF !IFDEF WITH_MATLAB # Replace the following by the directory where Matlab has been installed MATLABDIR=/opt/matlab/bin # Replace the following with the extension of compiled MEX files on this platform, e.g. .mexglx for x86 MEX=$(MATLABDIR)/mex MEXFLAGS=-I. !IFDEF DEBUG MEXFLAGS=$(MEXFLAGS) -g /DDAI_DEBUG !ENDIF !IFDEF NEW_MATLAB MEXFLAGS=$(MEXFLAGS) -largeArrayDims !ELSE MEXFLAGS=$(MEXFLAGS) /DSMALLMEM !ENDIF !ENDIF 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 TARGETS=tests utils $(LIB)/libdai$(LE) example$(EE) # testregression disabled, it uses diff # doc disabled, it uses doxygen !IFDEF WITH_MATLAB TARGETS = $(TARGETS) matlabs !ENDIF all : $(TARGETS) matlabs : matlab/dai$(ME) matlab/dai_readfg$(ME) matlab/dai_writefg$(ME) matlab/dai_potstrength$(ME) $(LIB)/libdai$(LE) : bipgraph$(OE) daialg$(OE) alldai$(OE) clustergraph$(OE) factorgraph$(OE) properties$(OE) regiongraph$(OE) util$(OE) weightedgraph$(OE) exceptions$(OE) $(OBJECTS) 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) tests : tests/testdai$(EE) utils : utils/createfg$(EE) utils/fg2dot$(EE) utils/fginfo$(EE) testregression : tests/testdai$(EE) echo Testing...this can take a while... cd tests; time ./testregression; cd .. doc : $(INC)/*.h $(SRC)/*.cpp doxygen.conf doxygen doxygen.conf clean : 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) !INCLUDE Makefile.shared