-
Notifications
You must be signed in to change notification settings - Fork 51
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
Windows Support and AppVeyor CI #173
Conversation
3e3dc94
to
6b6ebd3
Compare
test/SerialIOTest.cpp
Outdated
@@ -815,7 +815,11 @@ TEST_CASE( "hdf5_dtype_test", "[serial][hdf5]" ) | |||
s.setAttribute("vecUint64", std::vector< uint64_t >({18446744073709551614u, 18446744073709551615u})); | |||
s.setAttribute("vecFloat", std::vector< float >({0.f, 3.40282e+38f})); | |||
s.setAttribute("vecDouble", std::vector< double >({0., 1.79769e+308})); | |||
#ifdef _MSC_VER | |||
s.setAttribute("vecLongdouble", std::vector< long double >({0.L, 1.49769e+308L})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these calls could be replaced with std::numeric_limits::max
. This would make it compatible across all compilers (that conform to the C++ standard).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, just a quick hack so far :)
4dc5229
to
c5de2f4
Compare
@C0nsultant I think the tests are not compiling because of the redefinition of Can you maybe control these "very internal unit tests" via a define so I can skip them in MSVC? |
Just so I get this right - you have something like |
No, really the first one. The second solution means we would ship different access modifiers on Windows which is a hack. Instead, let us just test observable behavior on Windows - that's ok. |
Sighh... |
e899fba
to
abe0dfc
Compare
19dc563
to
b075673
Compare
CMakeLists.txt
Outdated
if(WIN32) | ||
# generate a the openpmd_export.h header with export defines we can use for | ||
# static members and other global data | ||
include(GenerateExportHeader) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment out if we don't need this currently.
CMakeLists.txt
Outdated
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") | ||
target_compile_options(openPMD PUBLIC "/bigobj") | ||
if(BUILD_SHARED_LIBS) | ||
target_compile_options(openPMD PUBLIC "/MD") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check if we still need this block
05d5bdb
to
e8fdb59
Compare
# Compiler & Generator Selection | ||
- cmd: if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" set OPENPMD_CMAKE_GENERATOR=Visual Studio 14 2015 | ||
- cmd: if "%TARGET_ARCH%"=="x64" set OPENPMD_CMAKE_GENERATOR=%OPENPMD_CMAKE_GENERATOR% Win64 | ||
# - cmd: if "%TARGET_ARCH%"=="x86" "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64_x86 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: I keep this for docs, this line is needed if we want to build everything from a amd64
platform
@@ -861,7 +864,9 @@ TEST_CASE( "hdf5_dtype_test", "[serial][hdf5]" ) | |||
REQUIRE(s.getAttribute("vecUint64").get< std::vector< uint64_t > >() == std::vector< uint64_t >({18446744073709551614u, 18446744073709551615u})); | |||
REQUIRE(s.getAttribute("vecFloat").get< std::vector< float > >() == std::vector< float >({0.f, 3.40282e+38f})); | |||
REQUIRE(s.getAttribute("vecDouble").get< std::vector< double > >() == std::vector< double >({0., 1.79769e+308})); | |||
REQUIRE(s.getAttribute("vecLongdouble").get< std::vector< long double > >() == std::vector< long double >({0.L, 1.18973e+4932L})); | |||
#if !defined(_MSC_VER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#179 is really this bad? Sad to see as long double
is part of the C++ standard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only during read :)
I think for some reason the variant takes the double
alternative and then tries to read as long double
or similar
@@ -1171,7 +1176,9 @@ TEST_CASE( "adios1_dtype_test", "[serial][adios1]" ) | |||
REQUIRE(s.getAttribute("uint64").get< uint64_t >() == 64u); | |||
REQUIRE(s.getAttribute("float").get< float >() == 16.e10f); | |||
REQUIRE(s.getAttribute("double").get< double >() == 1.e64); | |||
#if !defined(_MSC_VER) | |||
REQUIRE(s.getAttribute("longdouble").get< long double >() == 1.e80L); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use std::numeric_limits<long double>::max()
here as well? Is it the initializer list causing the problems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem I caused by the long double
template argument during read #179
I will exclude it for now and open a PR that removes the exclusion to demonstrate.
e685f89
to
1628549
Compare
On MSVC, the range of `long double` is just the same as `long`. This is fine, since it just needs to be "at least" double... https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx https://en.wikipedia.org/wiki/Long_double
Paths, symbols and tests.
Windows version of downloading all example files for tests.
Add support for AppVeyor builds of serial openPMD-api with HDF5. Dependencies are only available with C++11 support with VS2015 ("[vc14]") toolchain. This is limited to Python 3 since Python 2.7 is only available with VS2008.
Do not print value of attribute that is read-only tried to be set in exception. Work-around did only work on VS 2017 but not on VS 2015. Just throw a generic warning on MSVC instead.
Adds support for MSVC builds on Windows.
Due to various constrains in dependencies, this is
ADIOS1 on MSVC is very unlikely but ADIOS2 in the future could be a possibility, also for conda-forge.
Related to #63
To Do
openPMD.dll
later on as well