HomePhorge

Make RoSA build with MSVC

Description

Make RoSA build with MSVC

Step language requirement to C++17 (not only Clang, but recent MSVC can also compiler RoSA with that);
fix various build flags for MSVC in the CMake project;
remove noexcept specifier from template arguments of std::function,
add note about this change and caused issue in Issue document;
minor refactoring of local identifiers, types, and explicit casting to shut MSVC;
remove separate template argument for first input of DeluxeAgent so that only the ellipse remains, that is to make MSVC deduce template arguments properly;
update documentation according to changes.

Details

Auditors
btutzer
Provenance
Dávid JuhászAuthored on Apr 8 2019, 2:44 PM
juhaszPushed on Apr 8 2019, 4:49 PM
Parents
R20:913c638efda1: Detailing documentation directories in the Release docs page.
Branches
Unknown
Tags
Unknown

Event Timeline

Dávid Juhász <juhasz.david.scholar@gmail.com> committed R20:00d326ff0959: Make RoSA build with MSVC (authored by Dávid Juhász <juhasz.david.scholar@gmail.com>).Apr 8 2019, 2:44 PM
btutzer raised a concern with this commit.EditedApr 10 2019, 12:01 PM
btutzer subscribed.

I noticed I cannot build anymore due to this change.
Since no C++17 features are actually used I do not think it is a good strategy to require it. Many linux distributions do not have clang-7 available from repositories, so support for C++17 is still scarse. Is there no other way to achieve VS compatibility with c++14?
If I build with c++17 and clang-7, I run into the following error:
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/tuple:115:17: error: reference member '_M_head_impl' binds to a temporary object whose lifetime would be shorter than the lifetime of the constructed object
The same source builds fine with C++14 and clang-4.0

This commit now has outstanding concerns.Apr 10 2019, 12:01 PM

I do not remember exactly, unfortunately. But I think I could not compile using C++14 with MSVC. It could depend on compiler and/or library versions...

@btutzer wrote in R20:00d326ff0959a966d345b807cfbcb68c7503f4bc#8306:
Many linux distributions do not have clang-7 available from repositories

That's true, but you do not need clang 7. Everything works fine with clang 5.

Minimum compiler requirements:

  • Clang/LLVM -- minimum version 5.0.0
  • Visual Studio 2017 -- minimum version 15.7

If I build with c++17 and clang-7, I run into the following error:
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/tuple:115:17: error: reference member '_M_head_impl' binds to a temporary object whose lifetime would be shorter than the lifetime of the constructed object

I would guess this might be more of a standard library problem than a compiler problem...

Can you try clang 5 or another library version?

Since no C++17 features are actually used

That was true, but I started to use some just recently... For example, I use fold expressions (since C++17) to statically generate code to handle values in tuples.

Everything works fine with clang 5.

clang 5 is also not available from most current repositories though.

Can you try clang 5 or another library version?

clang 5 I could not find, but I installed clang 6 from debian's experimental and it works, thanks!

All concerns with this commit have now been addressed.May 2 2019, 1:27 PM