+* [Peter Gober] Made libDAI compile out-of-the-box on Cygwin.
+
+
git 39a4865f4eb0b32109ca50e7980028fed835adb9
--------------------------------------------
* [Frederik Eaton] Added Gibbs sampler to algorithms
WITH_MATLAB=
# New/old matlab version?
NEW_MATLAB=true
-# Windows or linux (default)?
+
+# Default OS = GNU/Linux
+# Windows Visual C++?
WINDOWS=
+# Cygwin?
+CYGWIN=
# Directories
INC=include/dai
LIBS=-ldai
# We use the BOOST Program Options library
-BOOSTLIBS=-lboost_program_options
+ifdef CYGWIN
+ BOOSTLIBS=-lboost_program_options-gcc34-mt
+else
+ BOOSTLIBS=-lboost_program_options
+endif
# Compile using GNU C++ Compiler
CC=g++
# Flags for the C++ compiler
CCFLAGS=-O3 -Wno-deprecated -Wall -W -Wextra -fpic -Iinclude -Llib
+ifdef CYGWIN
+ CCFLAGS:=$(CCFLAGS) -I/usr/local/include/boost-1_37 -DCYGWIN -static
+ # dynamic linking of Boost libraries seems not to work on Cygwin
+endif
CCDEBUGFLAGS=-g -DDAI_DEBUG
# Build targets
Compatibility
-------------
The code has been developed under Debian GNU/Linux with the GCC compiler suite.
-libDAI compiles successfully with g++ versions 4.1, 4.2 and 4.3.
+libDAI compiles successfully with g++ versions 3.4, 4.1, 4.2 and 4.3.
libDAI has also been successfully compiled with MS Visual Studio 2008 under Windows
-(but not all build targets are supported yet).
+(but not all build targets are supported yet) and with Cygwin under Windows.
Quick start (linux/cygwin)
"apt-get install g++ make doxygen libboost-dev libboost-graph-dev libboost-program-options-dev"
(root permissions needed).
+On Cygwin, the prebuilt Cygwin package boost-1.33.1-x is known not to work.
+You can however obtain the latest boost version from http://www.boost.org/
+and compile/install it with:
+
+ ./configure
+ make
+ make install
+
To build the source, edit the Makefile and adapt it to your local setup. Then, run
make
/// Returns true if one or more entries are NaN
bool hasNaNs() const {
- return (std::find_if( _p.begin(), _p.end(), isnan ) != _p.end());
+ bool foundnan = false;
+ for( typename std::vector<T>::const_iterator x = _p.begin(); x != _p.end(); x++ )
+ if( isnan( *x ) ) {
+ foundnan = true;
+ break;
+ }
+ return foundnan;
}
/// Returns true if one or more entries are negative
#include <algorithm>
-#ifdef WINDOWS
+#if defined(WINDOWS)
#include <map>
+#elif defined(CYGWIN)
+ #include <boost/tr1/unordered_map.hpp>
#else
#include <tr1/unordered_map>
#endif
#endif
+#ifdef CYGWIN
+bool isnan( double x ) {
+ return __isnand( x ); // isnan() is a macro in Cygwin (as required by C99)
+}
+#endif
+
#ifdef WINDOWS
bool isnan( double x ) {
return _isnan( x );