ess-dmsc / h5cpp

C++ wrapper for the HDF5 C-library
https://ess-dmsc.github.io/h5cpp/
GNU Lesser General Public License v2.1
116 stars 19 forks source link

add support for conan 2.0 #620

Closed jkotan closed 1 year ago

jkotan commented 1 year ago

We need to fix the github tests by supporting conan 2.0

jkotan commented 1 year ago

Hi, the openmpi/4.1.0 conan package is still not ready for conan 2.0

 ERROR: Package 'openmpi/4.1.0' not resolved: openmpi/4.1.0: Cannot load recipe.
Error loading conanfile at '/github/home/.conan2/p/openmf80d14015631f/e/conanfile.py': Unable to load conanfile in /github/home/.conan2/p/openmf80d14015631f/e/conanfile.py
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/github/home/.conan2/p/openmf80d14015631f/e/conanfile.py", line 1, in <module>
    from conans import ConanFile, tools, AutoToolsBuildEnvironment
ImportError: cannot import name 'ConanFile' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)

https://github.com/ess-dmsc/h5cpp/actions/runs/4675291381/jobs/8280263435#step:6:102

and according to

https://github.com/conan-io/conan-center-index/pull/13655

we have to wait for it much longer (if at all) or do it yourself or comment out MPI ??

Moreover, during conversion to conan 2.0 I needed to upgrade catch2 to v3.3.2 (but it is not a standard e.g. on debian releases). I still have some problems with github Windows shared tests i.e.

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: :VCEnd" exited with code 1. [D:\a\h5cpp\h5cpp\build\test\property\properties_test.vcxproj]
  Building Custom Rule D:/a/h5cpp/h5cpp/test/utilities/CMakeLists.txt
  array_adapter_test.cpp
  utilities_test.vcxproj -> D:\a\h5cpp\h5cpp\build\bin\utilities_test.exe
  CMake Error at C:/Users/runneradmin/.conan2/p/catchc20d5902e6d3d/p/lib/cmake/Catch2/CatchAddTests.cmake:60 (message):
    Error running test executable
    'D:/a/h5cpp/h5cpp/build/bin/utilities_test.exe':

      Result: Exit code 0xc0000135

at https://github.com/ess-dmsc/h5cpp/actions/runs/4675291381/jobs/8280265212 Looks like missing dlls.

Other tests (except MPI and Windows shared) work OK i.e.

https://github.com/ess-dmsc/h5cpp/actions/runs/4675406625

jkotan commented 1 year ago

Adding

        build_env = VirtualBuildEnv(self).vars()
        run_env = VirtualRunEnv(self).vars()
        with build_env.apply():
            with run_env.apply():

to build() in conanfile.py fixes the above windows error i.e. https://github.com/ess-dmsc/h5cpp/actions/runs/4677995970