-
Notifications
You must be signed in to change notification settings - Fork 19
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
Cleanup the 3rd party support code #548
Comments
Up to you as the maintainer but I might suggest |
@planetmarshall |
Ok. For STL my approach seems to work. However, there is some tight coupling between STL strings, vectors and HDF5 attributes. This is something I have to think about but this should not stop us from moving on. |
Hi Eugen, the story is about NX_BOALEAN in NeXus. At the beginning in the old In NeXus format mapping to hdf5 format is not strictly defined i.e.
so it can be anything which can be mapped to true and false values. |
@jkotan would it be ok for you if I move this to a |
@eugenwintersberger , if you change only the header file location it should be OK |
So far so good. I am not sure if I understand why some of the builds fail. Maybe @jkotan has a good idea ;) |
Hi @eugenwintersberger, It looks like you need to add #include <h5cpp/contrib/stl/string.hpp> to --- a/src/h5cpp/contrib/stl/array.hpp
+++ b/src/h5cpp/contrib/stl/array.hpp
@@ -1,6 +1,8 @@
#pragma once
#include <h5cpp/datatype/type_trait.hpp>
+#include <h5cpp/dataspace/type_trait.hpp>
+#include <h5cpp/dataspace/simple.hpp>
#include <array>
namespace hdf5 { and --- a/src/h5cpp/contrib/stl/string.hpp
+++ b/src/h5cpp/contrib/stl/string.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <h5cpp/datatype/type_trait.hpp>
+#include <h5cpp/datatype/string.hpp>
#include <string>
namespace hdf5 { and some other include statements to your test For macos it is another independent issue, i.e. some conan packages were update and they started to require the newer conan version (I'm not a fan of package managers not based on distribution model). So we can either upgrade the conan version or downgrade the zlib package. |
Additionally after downgrading the zlib conan package to 1.2.8 for macos all the tests are green |
@jkotan thanks for your comments. It seems that I really should do more C++ to stay fit. What I do not understand is why this problems show up only on some of the test systems. I would expect missing header files to show up in any case. Or do I miss here something? |
Good question 👍 It looks like a similar problem to https://stackoverflow.com/questions/42356633/why-would-a-release-build-have-linker-errors-if-the-debug-build-didnt i.e. I'm not sure but it looks like some code instantiates the the |
Playing with the code I have found that the instantiation of void Dataset::write(const char *data,const property::DatasetTransferList &dtpl)
{
write(std::string(data),dtpl);
} that if you comment the content of the above method, i.e. --- a/src/h5cpp/node/dataset.cpp
+++ b/src/h5cpp/node/dataset.cpp
@@ -33,6 +33,7 @@
#include <h5cpp/node/functions.hpp>
#include <h5cpp/filter/external_filter.hpp>
#include <h5cpp/error/error.hpp>
+#include <h5cpp/contrib/stl/string.hpp>
namespace hdf5 {
namespace node {
@@ -211,6 +212,11 @@ void Dataset::write(const char *data,const property::DatasetTransferList &dtpl)
write(std::string(data),dtpl);
}
+void Dataset::write(const char *data,const property::DatasetTransferList &dtpl) const
+{
+ write(std::string(data),dtpl);
+}
+
filter::ExternalFilters Dataset::filters() const
{
filter::ExternalFilters efilters = filter::ExternalFilters();
Another option would be to move the implementation of the write method to the header but since it is not template method it is better not to do it. |
It looks like it is even more tricky. I've just run tests where I have moved the include statement from dataset.hpp to dataset.cpp and in that time the macos compiler has complained https://jenkins.esss.dk/dm/blue/organizations/jenkins/ess-dmsc%2Fh5cpp/detail/issue_548_tests/6/pipeline so it is better to keep |
I had a look on Jans changes. Looks all good to me. The installation of the header files seems to work. @jkotan do you think it makes sense to create a PR for this issues? |
Hi @eugenwintersberger, I think you can merge them into the your PR. All the changes are in the |
Sure, make the PR. As I understand after merging the PR the user need to add |
* moved STL datatype traits to contrib/stl Update #548 * Removed unused header files Update #548 * attribute tests are back Update #548 * node tests are back update #548 * file and utility tests are back Update #548 * datatype test is back Update #548 * dataspace test ist back Update #548 * moved dataspaces for STL containers to contrib Update #548 * removed ebool code from the mainline Update #548 * Added test build for the nexus contrib Update #548 * Fixing ebool tests Update #548 * add include statments * downgrade conan version * revert conanfile_ess.txt * fix typo * add CONAN_FILE for macos * move include statement to dataset.cpp * add back stl/string.hpp to dataset.hpp * add newline at the end of files * comment bzip2 from macos conanfile * since @amues remove * comment windows test Co-authored-by: Jan Kotanski <[email protected]>
Hi Jan. Long time no see. I see your problem. This is a bit tricky to resolve since there is this tight coupling between the dataset IO code and the string type. If I recall correctly this is due to the fact that, for some reason I forgot, we handle variable length string and fixed length sting IO different from general variable/fixed length data IO. |
Not running yet Update #548
Ok. It seems that the string trait was not the problem. I removed now all the contrib header files from the core library. I think it is if people use your master header file |
Hi Eugen,
#include <h5cpp/hdf5.hpp>
#include <h5cpp/contrib/stl/stl.hpp> |
I guess this is a reasonable approach to provide people with a reasonable way to start so they don't have to think about adding another header file. I will try to fix the clang problem today (without any success promises ;)) |
Update Cleanup the 3rd party support code #548
Tests are passing except for Windows. I have no Windows installation here so I will deal with this next week when I am back at home. |
The current situation
hdf5.hpp
file and thus always active without providing the user a chance to remove themSuggested fixes
src/h5cpp/support
src/h5cpp/support/stl
orsrc/h5cpp/support/h5py
test/support
Users who want to have support for STL data types can than easily add
This would give the user a way to provide its own
std::vector
integration if he needs this.How to get there
Once this is done (I hope during Christmas) it would be nice if others join in providing support for other 3rd party libraries.
The text was updated successfully, but these errors were encountered: