Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for Windows #1874

Merged
merged 23 commits into from
Jan 9, 2020
Merged

Fixes for Windows #1874

merged 23 commits into from
Jan 9, 2020

Conversation

ZedThree
Copy link
Member

Necessary fixes to compile on Windows, plus fixes for the noisiest warnings.

The unit tests run and pass, but the integrated tests need a bit of faff to run as tests: ./runtest doesn't work as Windows can't tell what the filetype is. The ones written in Python can be run manually like python.exe runtest, but I had to use Anaconda to set up the Python environment and I've not managed to convince Visual Studio to use that to run the tests. test-solver and test-snb can be run just as the executables, so they work fine.

I've replaced print("Making such and such test"); shell("make > make.log") with a helper function, build_and_log("such and such test"). This is a no-op for Windows because make likely doesn't exist, and besides, CMake should've built it already.

I also had to replace shell("./test_command") with launch("./test_command", nproc=1, mthread=1) in a few tests, because while Windows needs the .exe extension but MPI doesn't for some reason.

At some point I need to set up CI for Windows, but this is very much a "nice to have", and not something I'm expecting us to put a lot of effort into supporting.

Bug fixes:

  • Duplicated DEPRECATED
  • Workaround for compiler bug with std::bind
  • isspace needs to be called with int but representable as unsigned char: some casting required
  • Add definitions for UNUSED and MAYBE_UNUSED
  • Workaround for possible compiler bug requiring fully-resolved names
  • Finding NLS in CMakeLists.txt was always required
  • Add various shims for the POSIX bits in BoutInitialise
  • Add shims for the POSIX strcasecmp and the BSD finite(double) (latter is BSD but in glibc for some reason -- C++ standard is std::isfinite)
  • Fix variadic macros in MACRO_FOR_EACH by using an intermediate BOUT_EXPAND macro that just expands its argument
  • Fix Datafile copy/move constructors missing some members -- notably the move ctor was missing the mesh member. I think once fmt goes in, making this = default should be sufficient
  • Fix for setting the number of OpenMP threads in boututils.launch

Warning fixes:

  • Catching an exception and then not using it
  • Some conversions (from size_t to int) in ubiquitous headers

Argument must be representable as `unsigned char`, so must `static_cast` argument
Workaround for name resolution bug in MSVC
This is a BSD extension in GNU's libc
Also conditionally include strings.h
Also make sure to catch them by const-ref
Can't set environment variable and run command in single process
@ZedThree ZedThree added this to the BOUT-5.0 milestone Dec 17, 2019
bendudson
bendudson previously approved these changes Jan 7, 2020
* next: (32 commits)
  Ignore file copied by configure
  Fix fmt include path not getting expanded correctly
  Add option to use external fmt instead of bundled version
  Install fmt from subdirectory correctly
  Fix Chinese translated strings
  Fixes for locale DE
  Add breaking change entry to changelog
  Add redundant out-of-line definitions for static Factory members
  Use fmt's positional arguments to avoid repeating variable
  Apply fmt fixes to i18n
  Apply fmt fixes to remaining tests and examples
  Use fmt for other printf formatting in bout++.cxx
  Use fmt to format timestamp
  Fix uses of output to use fmt formatting
  Use fmt in Output
  Fix out-of-line definition required for static member
  Fix uses of toString().c_str() with formatting
  Fix all BoutException calls in library
  Free messages from backtrace_symbols
  Use fmt in BoutException
  ...
@bendudson bendudson merged commit 5a35054 into next Jan 9, 2020
@bendudson bendudson deleted the msvc-fixes branch January 9, 2020 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants