Experimental Windows support

Hello,

I’ve just pushed out the experimental/wsl branch, a set of changes that allow GPUSPH to be built (and run!) under Windows. Current requirements:

  • Windows 10
  • Windows Subsystem for Linux (WSL), aka “Ubuntu for Windows”
  • Visual Studio (tested with Visual Studio 2017)
  • NVIDIA CUDA SDK for Windows (tested with CUDA 10)

To build GPUSPH, you need to start bash from within the Developer Command Prompt for Visual Studio, change to the directory where the GPUSPH repository is located, and run make.

Keep in mind that this branch should be considered an experimental “best-effort proof of concept”. There are several points that need to be addressed for a more proper support for Windows:

  • the Microsoft C++ compiler has several bugs concerning its implementation of the C++11 standard; the most significant is that constexpr template funcions are not evaluated for SFINAE, a feature that is extensively used in the GPUSPH code base; as a temporary workaround, the wsl branch uses auxiliary template structures with a static value member, which further reduces the legibility of the code;

  • for some essential features, GPUSPH relies on automatic code generation (debug flag definition and documentation, problem generation, etc); while this may be possible to implement using only tools from Visual Studio, such solutions would not be portable and increase the maintenance burden; hence the requirement for the WSL to provide the POSIX tools currently used by the GPUSPH build system;

  • for some non-essential features, GPUSPH relies on some POSIX APIs (shared memory, sockets) for which Windows support is either non-existent, or would require some porting effort; the corresponding features are currently disabled in this branch when building for Windows;

  • the Windows vs Linux detection logic currently assumes that a native Windows build is required if (and only if) building under the WSL; this should be tuned to include e.g. support for building using MSYS or some other POSIX layer in Windows.