COIN-OR::LEMON - Graph Library

Opened 11 years ago

Closed 11 years ago

#87 closed enhancement (fixed)

WIN32 support

Reported by: Alpar Juttner Owned by: Balazs Dezso
Priority: major Milestone: LEMON 1.0 release
Component: build system Version: hg main
Keywords: Cc: Akos Ladanyi
Revision id:

Description (last modified by Alpar Juttner)

Akos has worked out a CMAKE build environment which - in theory - makes it possible to use LEMON with MSVC. However there are several compilations errors with MSVC.

The uploaded patches contains the cmake environment and several fixes. They fix almost all errors but one related to Paths are still unfixed.

Attachments (8)

cmake.patch (2.3 KB) - added by Alpar Juttner 11 years ago.
cmake-2.patch (830 bytes) - added by Alpar Juttner 11 years ago.
time_measure.patch (526 bytes) - added by Alpar Juttner 11 years ago.
hgignore.patch (220 bytes) - added by Alpar Juttner 11 years ago.
cmake-3.patch (973 bytes) - added by Alpar Juttner 11 years ago.
msvc-fixes.patch (749 bytes) - added by Alpar Juttner 11 years ago.
vs_2005_path.patch (3.2 KB) - added by Balazs Dezso 11 years ago.
makefile-cleanup.patch (2.2 KB) - added by Akos Ladanyi 11 years ago.

Download all attachments as: .zip

Change History (19)

Changed 11 years ago by Alpar Juttner

Attachment: cmake.patch added

Changed 11 years ago by Alpar Juttner

Attachment: cmake-2.patch added

Changed 11 years ago by Alpar Juttner

Attachment: time_measure.patch added

Changed 11 years ago by Alpar Juttner

Attachment: hgignore.patch added

Changed 11 years ago by Alpar Juttner

Attachment: cmake-3.patch added

Changed 11 years ago by Alpar Juttner

Attachment: msvc-fixes.patch added

comment:1 Changed 11 years ago by Akos Ladanyi

Cc: Akos Ladanyi added

What version of MSVC are you using? I'm asking this because with the attached patches everything compiles using MSVC 15.00.21022.08 (the one included in Visual Studio 2008).

comment:2 in reply to:  1 Changed 11 years ago by Alpar Juttner

Description: modified (diff)

Replying to ladanyi:

What version of MSVC are you using? I'm asking this because with the attached patches everything compiles using MSVC 15.00.21022.08 (the one included in Visual Studio 2008).

I tried it with VS 2005, but I don't know how to check the exact version number. You must be aware of my complete ignorance related to the M$ world.

comment:3 Changed 11 years ago by Alpar Juttner

Here is the error message I get compiling dfs_test and bfs_test:

C:\Work\lemon\cmake\lemon/path.h(971) : error C2752: 'lemon::_path_bits::PathCopySelector<Target,Source>' : more than one partial specialization matches the template argument list
        with
        [
            Target=lemon::Path<Digraph>,
            Source=lemon::PredMapPath<lemon::concepts::Digraph,lemon::concepts::Digraph::NodeMap<lemon::concepts::Digraph::Arc>>
        ]
        C:\Work\lemon\cmake\lemon/path.h(960): could be 'lemon::_path_bits::PathCopySelector<Target,Source,enable_if<Target::BuildTag,void>::type,enable_if<Source::RevPathTag,void>::type>'
        C:\Work\lemon\cmake\lemon/path.h(949): or 'lemon::_path_bits::PathCopySelector<Target,Source,enable_if<Target::BuildTag,void>::type,RevEnable>'
        C:\Work\lemon\cmake\lemon/path.h(939): or 'lemon::_path_bits::PathCopySelector<Target,Source,BuildEnable,enable_if<Source::RevPathTag,void>::type>'
        C:\Work\lemon\cmake\lemon/path.h(73) : see reference to function template instantiation 'void lemon::copyPath<lemon::Path<_Digraph>,CPath>(Target &,const Source &)' being compiled
        with
        [
            _Digraph=Digraph,
            CPath=lemon::PredMapPath<lemon::concepts::Digraph,lemon::concepts::Digraph::NodeMap<lemon::concepts::Digraph::Arc>>,
            Target=lemon::Path<Digraph>,
            Source=lemon::PredMapPath<lemon::concepts::Digraph,lemon::concepts::Digraph::NodeMap<lemon::concepts::Digraph::Arc>>
        ]
        ..\..\test\dfs_test.cc(63) : see reference to function template instantiation 'lemon::Path<_Digraph>::Path<lemon::PredMapPath<_Digraph,_PredMap>>(const CPath &)' being compiled
        with
        [
            _Digraph=Digraph,
            _PredMap=lemon::concepts::Digraph::NodeMap<lemon::concepts::Digraph::Arc>,
            CPath=lemon::PredMapPath<lemon::concepts::Digraph,lemon::concepts::Digraph::NodeMap<lemon::concepts::Digraph::Arc>>
        ]

comment:4 Changed 11 years ago by Alpar Juttner

And here is the nasty warning which I can't get rid of:

C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(2282) : warning C4996: 'std::_Copy_opt' was declared deprecated
        C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(2270) : see declaration of 'std::_Copy_opt'
        Message: 'You have used a std:: construct that is not safe. See documentation on how to use the Safe Standard C++ Library'
        C:\Work\lemon\cmake\lemon/random.h(221) : see reference to function template instantiation '_OutIt std::copy<const unsigned long*,unsigned long*>(_InIt,_InIt,_OutIt)' being compiled
        with
        [
            _OutIt=unsigned long *,
            _InIt=const unsigned long *
        ]
        C:\Work\lemon\cmake\lemon/random.h(220) : while compiling class template member function 'void lemon::_random_bits::RandomCore<_Word>::copyState(const lemon::_random_bits::RandomCore<_Word> &)'
        with
        [
            _Word=lemon::Random::Word
        ]
        C:\Work\lemon\cmake\lemon/random.h(523) : see reference to class template instantiation 'lemon::_random_bits::RandomCore<_Word>' being compiled
        with
        [
            _Word=lemon::Random::Word
        ]

Do you know some magic compiler switch to turn this off?

comment:5 in reply to:  4 Changed 11 years ago by Alpar Juttner

Replying to alpar:

Do you know some magic compiler switch to turn this off?

According to http://msdn2.microsoft.com/en-us/library/aa985974(VS.80).aspx The following #define should switch off this warning.

#define _SCL_SECURE_NO_WARNINGS

As an alternative method it also suggests using

#pragma warning(disable:4996)

None of them is working for me, neither using them alone nor both together.

Changed 11 years ago by Balazs Dezso

Attachment: vs_2005_path.patch added

comment:6 Changed 11 years ago by Balazs Dezso

The uploaded patch uses different type of template specialization, which is accepted by MSVC 2005.

comment:7 Changed 11 years ago by Alpar Juttner

Resolution: fixed
Status: newclosed

The patches are now in the main branch, see [96f81c791f0c], [8b703d177341], [c3b45bb643b0] and [4e626dbbe408].

All the errors have been fixed (though MSVC still emits several warnings).

comment:8 Changed 11 years ago by Akos Ladanyi

Resolution: fixed
Status: closedreopened

The removal of the Makefiles from the subdirectories broke the tarball generation. This patch fixes this.

Changed 11 years ago by Akos Ladanyi

Attachment: makefile-cleanup.patch added

comment:9 Changed 11 years ago by Akos Ladanyi

Updated the patch to distribute the CMakeLists.txt files too.

comment:10 in reply to:  9 Changed 11 years ago by Alpar Juttner

Replying to ladanyi:

Updated the patch to distribute the CMakeLists.txt files too.

It is in the main branch, see [4b42aa24ce12].

comment:11 Changed 11 years ago by Alpar Juttner

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.