Hi,
Currently Boost::Graph hardcodes g++ as compiler. The attached patch
has some crude logic that picks MSVC++ as compiler on Win32 systems.
With that, the right, in my case anyway, compiler is used, but then
there are a bunch of compilation problems, mostly relating to symbols
that overlap between the Windows, C++ runtime, Boost, and Perl. I've
re-ordered things and added some #undef instructions to work around.
Then boost has two overloads, one with a `char` argument and one with
the same argument as `bool`. In MSVC++ `bool` is a `char`, so it does
not like that. I've commented that out.
With all that, the module compiles and links, but the #53 test in
`t/Graph.t` results in segmentation violation. Somehow the `_changed`
member does not seem to be updated properly, if I change the method
`BoostGraph_undirected_i<G>::connectedComponents()` so it also checks
for `this->boostGraph` being null, all tests pass. I don't see what
might be causing this.
regards,
--
Björn Höhrmann · mailto:[email protected] · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
diff -wur old\Boost-Graph-1.4/Directed/Directed.xs
Boost-Graph-1.4/Directed/Directed.xs
--- old\Boost-Graph-1.4/Directed/Directed.xs 2006-11-13 19:30:29.000000000
+0100
+++ Boost-Graph-1.4/Directed/Directed.xs 2011-12-17 04:05:40.136000000
+0100
@@ -1,3 +1,10 @@
+#include <iostream>
+#include <algorithm>
+#include <string>
+#include <list>
+#include <fstream>
+#include <sstream>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -8,20 +15,17 @@
#undef do_close
#undef apply
#undef ref
+#undef bind
+#undef max
#ifdef __cplusplus
}
#endif
-//____________________________________________________________________________________________________
-// C++
+
#undef list
-#include <iostream>
-#include <algorithm>
#include <boost/config.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/property_map.hpp>
-#include <string>
#include "BoostGraph_i.h"
-#include <list>
using namespace std;
using namespace boost;
diff -wur old\Boost-Graph-1.4/Directed/Makefile.PL
Boost-Graph-1.4/Directed/Makefile.PL
--- old\Boost-Graph-1.4/Directed/Makefile.PL 2006-05-16 01:50:26.000000000
+0200
+++ Boost-Graph-1.4/Directed/Makefile.PL 2011-12-17 03:16:46.304000000
+0100
@@ -1,9 +1,8 @@
use 5.008;
use ExtUtils::MakeMaker;
-$CC = 'g++ -O';
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
-WriteMakefile(
+my %options = (
'NAME' => 'Boost::Graph::Directed',
'VERSION_FROM' => 'Directed.pm', # finds $VERSION
'PREREQ_PM' => {}, # e.g., Module::Name => 1.1
@@ -12,11 +11,22 @@
AUTHOR => 'David Burdick <[email protected]>') : ()),
'LIBS' => [''], # e.g., '-lm'
'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
- 'CC' => $CC,
- 'LD' => '$(CC)',
'INC' => '-I. -I../include -I../include/boost', # MODIFY
THIS! Point it to your Boost installation
# Un-comment this if you add C files to link with later:
# 'OBJECT' => '$(O_FILES)', # link all the C files too
'XSOPT' => '-C++',
'TYPEMAPS' => ['perlobject.map' ],
);
+
+if ($^O eq "MSWin32")
+{
+ $options{CC} = "cl -TP -EHsc";
+ $options{LIBS} = "-lmsvcprt.lib";
+} else {
+ # assume some compatible Linux
+ $options{LD} = "g++";
+ $options{CC} = "g++";
+# $options{LIBS} = "-lstdc++";
+}
+
+WriteMakefile(%options);
diff -wur old\Boost-Graph-1.4/Undirected/Makefile.PL
Boost-Graph-1.4/Undirected/Makefile.PL
--- old\Boost-Graph-1.4/Undirected/Makefile.PL 2006-05-16 01:50:26.000000000
+0200
+++ Boost-Graph-1.4/Undirected/Makefile.PL 2011-12-17 03:18:10.760000000
+0100
@@ -1,9 +1,9 @@
use 5.008;
use ExtUtils::MakeMaker;
-$CC = 'g++ -O';
+
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
-WriteMakefile(
+my %options = (
'NAME' => 'Boost::Graph::Undirected',
'VERSION_FROM' => 'Undirected.pm', # finds $VERSION
'PREREQ_PM' => {}, # e.g., Module::Name => 1.1
@@ -12,11 +12,23 @@
AUTHOR => 'David Burdick <[email protected]>') : ()),
'LIBS' => [''], # e.g., '-lm'
'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
- 'CC' => $CC,
- 'LD' => '$(CC)',
'INC' => '-I. -I../include -I../include/boost', # MODIFY
THIS! Point it to your Boost installation
# Un-comment this if you add C files to link with later:
# 'OBJECT' => '$(O_FILES)', # link all the C files too
'XSOPT' => '-C++',
'TYPEMAPS' => ['perlobject.map' ],
);
+
+if ($^O eq "MSWin32")
+{
+ $options{CC} = "cl -TP -EHsc";
+ $options{LIBS} = "-lmsvcprt.lib";
+} else {
+ # assume some compatible Linux
+ $options{LD} = "g++";
+ $options{CC} = "g++";
+# $options{LIBS} = "-lstdc++";
+}
+
+
+WriteMakefile(%options);
diff -wur old\Boost-Graph-1.4/Undirected/Undirected.xs
Boost-Graph-1.4/Undirected/Undirected.xs
--- old\Boost-Graph-1.4/Undirected/Undirected.xs 2006-11-13
19:30:40.000000000 +0100
+++ Boost-Graph-1.4/Undirected/Undirected.xs 2011-12-17 04:05:51.608000000
+0100
@@ -1,3 +1,10 @@
+#include <iostream>
+#include <algorithm>
+#include <string>
+#include <list>
+#include <fstream>
+#include <sstream>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -8,21 +15,18 @@
#undef do_close
#undef apply
#undef ref
+#undef bind
+#undef max
#ifdef __cplusplus
}
#endif
-//____________________________________________________________________________________________________
-// C++
+
#undef list
-#include <iostream>
-#include <algorithm>
#include <boost/config.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/property_map.hpp>
-#include <string>
#include "BoostGraph_i.h"
#include "BoostGraph_undirected_i.h"
-#include <list>
using namespace std;
using namespace boost;
diff -wur old\Boost-Graph-1.4/include/boost/type_traits/is_integral.hpp
Boost-Graph-1.4/include/boost/type_traits/is_integral.hpp
--- old\Boost-Graph-1.4/include/boost/type_traits/is_integral.hpp
2006-06-19 23:17:57.000000000 +0200
+++ Boost-Graph-1.4/include/boost/type_traits/is_integral.hpp 2011-12-17
03:10:15.736000000 +0100
@@ -32,7 +32,7 @@
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed long,true)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,bool,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char,true)
+// BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char,true)
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
// If the following line fails to compile and you're using the Intel