Building libDAI is not an easy job in
Windows. I spent more than two days on that effort but failed, mainly
because there is not a clear way to build MPIR (the Windows port of GMP) that
compatible with libDAI in Windows environment. Briefly, the failed building
process for Windows is the following:
-
For GMP: since there is no GMP
working for Windows, we have to resort its Windows port called MPIR. Downloaded MPIR 2.5.1 released on March 11,2012. Untar the files and
then in one of its sub-folder called 'build.vc10', it
provides complete instruction on how to build MPIR using VC++ (readme.txt
in the folder has the details). Basically, you need to use VC++ to load the
project file called 'mpir.sln' in the folder 'build.vc10'. You can ignore the
message popped out about 'One or more projects were not loaded correctly' when
using VC++ Express. Then I chose the project 'lib_mpir_cxx', building it
creates binaries into the default folder 'lib/Win32/Debug or Release'
depending on your building settings. I saw 'mpir.lib, mpirxx.lib,
mpir.pdb, mpirxx.pdb' and 'gmp.h, gmpxx.h, mpir.h, mpirxx.h' generated
there. But there is no 'gmp.lib' or 'gmpxx.lib', which is probably the
reason I did not make libDAI working in this route, because I guess libDAI
calls GMP not MPIR, and it may not recognize MPIR at all.
-
Assuming you have downloaded libDAI Windows zip
files. Third step is to copy 'Makefile.WINDOWS' to 'Makefile.conf', and then
modify 'Makefile.conf' to specify the path for Boost and MPIR compiled
above. Before running 'make', go to VC++ 2010 folder - C:\Program
Files\Microsoft Visual Studio 10.0\VC', run 'vcvarsall.bat' in cmd window
(This is to set environment for using Microsoft Visual Studio). Now go to
libDAI folder, run 'make' in cmd window. it did pass the compiling stage, but
when linking, about 16 errors popped out such LNK2001, LNK2019, etc. Sample
error messages are shown below:
Hope somebody can figure out what is wrong in the
process described above. If so, please email
me.
---
Created on April 28th, 2012, by Wei
Sun.