entity icon indicating copy to clipboard operation
entity copied to clipboard

Cmake Compiling Error for Loading Hdf5 Module for Output

Open BradenBuck opened this issue 1 year ago • 8 comments

I've been able to compile and run the code without output, but not with the output option enabled. When using the Output=ON option for compiling (using gcc v13.2.0), the hdf5 module must be loaded. On the Stampede3 cluster, when hdf5 version 1.14.4 is loaded, the following error will be thrown.

CMake Error at cmake/dependencies.cmake:84 (get_directory_property):
  get_directory_property DIRECTORY argument provided but requested directory
  not found.  This could be because the directory argument was invalid or, it
  is valid but has not been processed yet.
Call Stack (most recent call first):
  CMakeLists.txt:102 (find_or_fetch_dependency)

CMake Error at CMakeLists.txt:117 (message):
  HDF5_ROOT is not set.  Please set it to the root of the HDF5 installation

As a workaround, when the HDF5_ROOT variable is exported manually via the terminal to the path in the module's lua file (/opt/apps/gcc13/hdf5/1.14.4), the compiler states that it has found the correct hdf5 version, but still throws an error.

CMake Error at cmake/dependencies.cmake:84 (get_directory_property):
  get_directory_property DIRECTORY argument provided but requested directory
  not found.  This could be because the directory argument was invalid or, it
  is valid but has not been processed yet.
Call Stack (most recent call first):
  CMakeLists.txt:102 (find_or_fetch_dependency)

-- Found HDF5: hdf5-shared (found version "1.14.4")

"$git diff CMakeLists.txt" showed no differences between the local file and the one in the github repository. Performing a fresh github clone, exporting the HDF5_ROOT variable, and compiling still presented the same error.

BradenBuck avatar Jan 13 '25 20:01 BradenBuck

this will be fixed in v1.2.0 release. for now, just add before cmake HDF5_ROOT=/opt/apps/gcc13/hdf5/1.14.4 cmake ... (or alternatively just export HDF5_ROOT=...)

haykh avatar Jan 16 '25 20:01 haykh

this will be fixed in v1.2.0 release. for now, just add before cmake HDF5_ROOT=/opt/apps/gcc13/hdf5/1.14.4 cmake ... (or alternatively just export HDF5_ROOT=...)

I apologize for the delay in replying. This is what I mentioned that I attempted to due in my original attempts. Performing $export HDF5_ROOT=/opt/apps/gcc13/hdf5/1.14.4 from the command line before running cmake (or putting this into the CMakeLists.txt document) results in entity indicating that hdf5 was found during compiling but still throws a compiling error listed in the original comment.

BradenBuck avatar Jan 28 '25 22:01 BradenBuck

weird. as a workaround for now you may comment these lines

  if(${package_name} STREQUAL "adios2")
    if(NOT DEFINED adios2_VERSION OR adios2_VERSION STREQUAL "")
      get_directory_property(adios2_VERSION DIRECTORY ${adios2_BUILD_DIR} DEFINITION ADIOS2_VERSION)
      set(adios2_VERSION ${adios2_VERSION} CACHE INTERNAL "ADIOS2 version")
    endif()
  endif()

  if(${package_name} STREQUAL "Kokkos")
    if(NOT DEFINED Kokkos_VERSION OR Kokkos_VERSION STREQUAL "")
      get_directory_property(Kokkos_VERSION DIRECTORY ${Kokkos_SRC} DEFINITION Kokkos_VERSION)
      set(Kokkos_VERSION ${Kokkos_VERSION} CACHE INTERNAL "Kokkos version")
    endif()
  endif()

from cmake/dependencies.cmake. i'll fix so that in the future this is a warning rather than an error. this is done purely to report the version of the third-party libraries during cmake configuration.

haykh avatar Jan 29 '25 17:01 haykh

I've commented out the lines you've mentioned, and it is no longer throwing the original error during compiling. However, it is now throwing several other errors in its place.

-- Configuring done (29.7s)
CMake Error at src/CMakeLists.txt:24 (add_executable):
  Target "entity.xc" links to:

    adios2::cxx11

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.



CMake Error at src/global/CMakeLists.txt:21 (add_library):
  Target "ntt_global" links to:

    adios2::cxx11

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.



CMake Error at src/framework/CMakeLists.txt:40 (add_library):
  Target "ntt_framework" links to:

    adios2::cxx11

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.



CMake Error at src/engines/CMakeLists.txt:33 (add_library):
  Target "ntt_engines" links to:

    adios2::cxx11

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.



CMake Error at src/output/CMakeLists.txt:24 (add_library):
  Target "ntt_output" links to:

    adios2::cxx11

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.


-- Generating done (9.9s)
CMake Generate step failed.  Build files cannot be regenerated correctly.

Attempting to close my eyes to the above errors and compile the code regardless led to the following.

[ 59%] Building CXX object src/output/CMakeFiles/ntt_output.dir/writer.cpp.o
In file included from /scratch/10356/btbuck/entity_test/src/output/writer.cpp:1:
/scratch/10356/btbuck/entity_test/src/output/../output/writer.h:19:10: fatal error: adios2.h: No such file or directory
   19 | #include <adios2.h>
      |          ^~~~~~~~~~
compilation terminated.
gmake[2]: *** [src/output/CMakeFiles/ntt_output.dir/build.make:76: src/output/CMakeFiles/ntt_output.dir/writer.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:717: src/output/CMakeFiles/ntt_output.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

BradenBuck avatar Jan 30 '25 01:01 BradenBuck

wait, so do you actually have ADIOS2 installed? also, which version of the code are you compiling?

haykh avatar Jan 30 '25 02:01 haykh

I'm very sorry for the delayed response. I don't have ADIOS2 installed. I was under the assumption from the documentation that Kokkos and ADIOS2 were included in the code package since they weren't explicitly identified as necessary dependencies to run the code (if I misunderstood this, please let me know). I believe the installed version of entity is current.

BradenBuck avatar Feb 17 '25 20:02 BradenBuck

@BradenBuck Would you be able to have a zoom call sometime this week? We also have weekly Entity coffee meetings (which I have not yet advertised, but will soon). Also, we have a dedicated Entity slack (also not yet advertised), so if you send me your email (you can email it to me), i can add you as a guest. I think this would be much faster and easier.

haykh avatar Mar 09 '25 18:03 haykh

I do feel bad that time slips through my fingers so readily. I will try to do a better job at checking your replies to this post more vigilantly. I can meet sometime tomorrow or on Monday. My availability next week is a bit more uncertain, but I could meet at most times the week following next week. I will send you an email shortly. I will respond much better via email than here.

BradenBuck avatar Mar 20 '25 21:03 BradenBuck

Closing this as stale. @BradenBuck now that you're on slack, let's coordinate there!

haykh avatar Jun 27 '25 23:06 haykh

Closing this as stale. @BradenBuck now that you're on slack, let's coordinate there!

Sounds good

BradenBuck avatar Jun 28 '25 00:06 BradenBuck