ihedvall / mdflib

Implementation of the ASAM MDF data file.
https://ihedvall.github.io/mdflib/
MIT License
57 stars 26 forks source link

Using Qt instead of boost #1

Closed Murmele closed 1 year ago

Murmele commented 1 year ago

Hello,

the labplot team is thinking about supporting mdf files in their application. Labplot is using Qt and we would like to get an additional dependency like boost and so the idea would be to replace boost by Qt equivalents. In this case I would create a library interface (source, header file) for boost and qt and in the cmake file the correct files will be selected. So that means your mdf lib depend only on that library interface files and anymore directly on boost.

Mostly locale and endian have to be replaced. The current comparsion and alternative Qt function selection is done here: https://invent.kde.org/education/labplot/-/issues/293

What do you think about this? I will do the implementation of this procedure.

ihedvall commented 1 year ago

Hello

The MDFLIB repository includes a library and a sub-project MdfViewer (wxWidgets). The viewer application can easily be moved to its own repository.

The library is dependent on 3:rd party libraries as boost, expat, utillib and zlib.

The boost library solve the big/little endian byte order issues. Instead of involving Qt, I suggest that the byte order stuffing is replaced by plain C code instead. This will solve the main boost dependency.

The UtilLib constains a lot of XML (expat) and time conversion routines. It also include error logging functions. The time and logging functions can be included (copied) into the library.

Remains from the UtilLib is the XML (expat) dependency. XML is heavily used in the MDF4 Meta data block (MD block).

The ZLIB is used for compressing/decompressing the MDF4 data blocks. I don't see that this dependecy can be removed.

Conclusion

I can do the above changes removing dependecies of the utillib and boost library. Remain dependency of expat and zlib. Is this an acceptable solution?

ihedvall commented 1 year ago

FYI I have started to remove dependecies. Boost and utilib is OK. Some problems with XML and Expat. I'm 1-2 days left.

Murmele commented 1 year ago

Hello. Thank you very much for the changes! I think boost is the biggest dependency which might be great to get rid of it. Zlib is used also for hdf5 so it is already a dependency of labplot so it should not be any problem. I think you don't have to move the viewer out, because when building without the viewer then wxwidgets and so on is not needed, which makes it fine. If I can help you with something I would be happy to do. I will let you know tomorrow about the changes for building on linux

Murmele commented 1 year ago

Are you using any codestyle template like clang-format? If not and you want we can set one up . I did it already several times for github CI

ihedvall commented 1 year ago

I have removed the utillib dependency in mdflib. UtilLib uses boost. MdfLib should only depend on EXPAT and ZLIB. I'm using the JetBrain CLION (Editor) and TeamCity (CI) with local agents. The latter due to the unit tests require local MDF files that cannot be exposed for external users.

I'm using the Google C++ coding standard. The Editor has built-in clang which is good enough so far

Murmele commented 1 year ago

I have removed the utillib dependency in mdflib. UtilLib uses boost. MdfLib should only depend on EXPAT and ZLIB. I'm using the JetBrain CLION (Editor) and TeamCity (CI) with local agents. The latter due to the unit tests require local MDF files that cannot be exposed for external users.

I'm using the Google C++ coding standard. The Editor has built-in clang which is good enough so far

Did you push the changes?

ihedvall commented 1 year ago

No. I'm removing the boost dependency as well.

Murmele commented 1 year ago

Ah ok thanks. Thank you for your work and helping to get mdflib cross compiled

ihedvall commented 1 year ago

I have checked in the changes that should remove the boost and utillib dependencies. We need to merge in the changes from you. I have added you as collaborator.

Best Regards Ingemar Hedvall

Murmele commented 1 year ago

Thank you for your effort! I can close this one now