[Dune-devel] Dune with Visual Studio 2019 (16.2 Preview 2)

Christoph Grüninger foss at grueninger.de
Sun Jun 16 23:23:15 CEST 2019


Dear fellow Dune developers,
from time to time I yield to temptation checking how far I can trust
Micrsoft's marketing regarding their talking about ongoing efforts to
improve Visual C++ compiler [0]. They claim to support C++14, a fair
share of C++17, and quite some C++20 [1]. Impressive.

== Summary ==
* I can see a lot of improvements. The compiler is better, they
integrated Git, CMake and Ninja into Visual Studio, and the installation
is less bloated compared to older versions.
* dune-common (libdunecommon) compiles fine
* dune-grid fails with an internal compiler error while compiling
onedgrid.cc for libdunegrid. I reported the issue.
* tests for dune-common: all SIMD test fail, and the MPI tests due to
min/max problem. Roughly 80% compile and run fine.
* tests for dune-geometry: quadrature rules fail to compile
* tests for dune-istl: two thirds pass, AMG tests fail with seg faults
* tests for dune-localfunctions: only a third passed, three timeouts and
20 tests did not compile
* without libdunegrid I did not try application modules like PDELab or DuMuX

So visible improvements compared to my last try two years ago [2].

But still, cmd is utter crap, the process is very slow (on bare metal
building Dune on Windows feels like the computer is broken, within a
virtual machine it is even worse) and the output is difficult to understand.

== Installation ==
It is easy to install. I used VirtualBox, officially downloaded the
latest Windows 10, used it with some old license key I usually have no
use for, installed Visual Studio. It took me two evenings but most of
the time it was a background task downloading and installing.
I used the Community edition of Visual Studio 2019, version 16.2 preview
2. It can be used for personal use or to develop open source software.
CMake, Git and Ninja are installed right away, when selecting the CMake
feature.

== Building and using Dune ==
The CMake integration did not work, I was not able to teach the Dune
modules where to find dune-common. So I switched to the developer
console, which is a cmd with the Visual Studio stuff preloaded. So Git
and the Compile can be used right away.
To allow for some ancient C++ stuff like "and" and "not" (instead of &&,
!), you have to pass /permissive-. To get the latest C++ version without
considering compatibility to older Visual C++ version, /std:c++latest
must be added. I had some linker issue, by passing /EHsc I could move
on. Further, Dune's C++ version detection failed, so I did that manually.
Then I had to pass the dune-common_DIR. All together I called
dune-geometry with these CMake arguments:

-DCMAKE_CXX_FLAGS="/permissive- /std:c++latest /EHsc"
-DDISABLE_CXX_VERSION_CHECK=true -DCXX_MAX_SUPPORTED_STANDARD=17
-Ddune-common_DIR=C:\Dune\dune-common\build-cmake
-T "Visual Studio 16 2019"

I don't know which build tool I ended up, devenv or MSBuild. I built
Dune with
  cmake --build .
and
  cmake --build . --target build_tests
I executed the tests with
  ctest -j4 -C Debug

Bye
Christoph

[0]
https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=vs-2019
[1]
https://docs.microsoft.com/en-us/cpp/overview/cpp-conformance-improvements?view=vs-2019
[2]
https://lists.dune-project.org/pipermail/dune-devel/2017-November/002301.html

-- 
Nous vivons une époque où les pizzas arrivent plus vite que la police.
[Claude Chabrol]




More information about the Dune-devel mailing list