awslabs / palace

3D finite element solver for computational electromagnetics
https://awslabs.github.io/palace/dev
Apache License 2.0
237 stars 49 forks source link

Add <numeric> header to resolve the MSVC building error #133

Closed lcheng9 closed 10 months ago

lcheng9 commented 10 months ago

*Description of changes: add header to resolve the MSVC building error

EDIT: Includes https://github.com/awslabs/palace/pull/134 and https://github.com/awslabs/palace/pull/135 as well.

Issue #, if available: MS Visual Studio 2022 complains. needed for std::partial_sum and std::accumulate

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

sebastiangrimberg commented 10 months ago

Thanks @lcheng9!

sebastiangrimberg commented 10 months ago

Hi @lcheng9, can you make sure the latest commit compiles with MSVC correctly? I refactored the diagnostics into utils/diagnostic.hpp.

lcheng9 commented 10 months ago

Hi @sebastiangrimberg, Thank you so much for the refactoring. Your revision builds on MSVS, I just realized that I need to add the _MSC_VER check to prevent the impact on other Windows systems, such as Cygwin.

sebastiangrimberg commented 10 months ago

Hi @sebastiangrimberg, Thank you so much for the refactoring. Your revision builds on MSVS, I just realized that I need to add the _MSC_VER check to prevent the impact on other Windows systems, such as Cygwin.

Great. I would suggest to change the check to just #if defined(_MSC_VER) for simplicity as it should capture all the needed cases for needing warning.

lcheng9 commented 10 months ago

Great. I would suggest to change the check to just #if defined(_MSC_VER) for simplicity as it should capture all the needed cases for needing warning.

_MSC_VER should be sufficient, since the i686 system probably not be used in the computing nowadays. The change is submitted. Thank you.