You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In tests/general/util/pio_tutil.F90, several macros, namely _NETCDF4,
_NETCDF, _PNETCDF, _ADIOS2, and _HDF5, are utilized.
In the case of NetCDF/PnetCDF libraries, the macros _NETCDF4,
_NETCDF, and _PNETCDF are directly defined for lib piof in
src/flib/CMakeLists.txt:
#===== NetCDF-Fortran =====
if (WITH_NETCDF)
find_package (NetCDF ${NETCDF_FORTRAN_MIN_VER_REQD} COMPONENTS Fortran)
if (NetCDF_Fortran_FOUND)
message(STATUS "NetCDF Fortran library dependencies: ${NetCDF_Fortran_LIBRARIES}")
...
target_compile_definitions (piof
PUBLIC _NETCDF)
...
if (EXISTS ${NetCDF_Fortran_INCLUDE_DIR}/netcdf_par.h)
target_compile_definitions (piof
PUBLIC _NETCDF4)
...
#===== PnetCDF =====
if (WITH_PNETCDF)
find_package (PnetCDF ${PNETCDF_MIN_VER_REQD} COMPONENTS Fortran)
if (PnetCDF_FOUND)
message(STATUS "PnetCDF Fortran library dependencies: ${PnetCDF_Fortran_LIBRARIES}")
...
target_compile_definitions (piof
PUBLIC _PNETCDF)
However, for ADIOS2/HDF5 libraries, where no Fortran components
are available, the direct definition of _ADIOS2 and _HDF5 for lib
piof in src/flib/CMakeLists.txt is not feasible.
To overcome this limitation, a workaround is to define these macros
for lib pioc in src/clib/CMakeLists.txt. Consequently, they are indirectly
defined for lib piof.
For _HDF5, it will be something like:
#===== HDF5-C =====
if (WITH_HDF5)
find_package (HDF5 COMPONENTS HL C)
if (HDF5_C_FOUND)
...
target_compile_definitions (pioc
PUBLIC _HDF5)
The current definition of _ADIOS2 for lib adios2pio-nm-lib in
tools/adios2pio-nm/CMakeLists.txt may need to be relocated to
src/clib/CMakeLists.txt to ensure consistency for lib pioc:
if (ADIOS2_FOUND)
target_compile_definitions (adios2pio-nm-lib
PUBLIC _ADIOS2)
It is worth noting that this workaround introduces a minor issue
related to duplicate macro definitions. On one hand, _ADIOS2 and
_HDF5 are defined using CMake's target_compile_definitions() for
lib pioc. On the other hand, they are also explicitly defined in
pio.h of lib pioc:
The Fortran code relies on these flags to determine support for
ADIOS and HDF5 libraries. For NetCDF and PnetCDF libraries the
Fortran library, piof, includes config tests for the Fortran
libraries of these 3rd party libs. However ADIOS and HDF5
do not have these config tests (and Fortran libs) in the Fortran
library.
So exporting these flags from the pioc lib for all dependent libs.
(Note: _ADIOS2 flag was being exported inadvertently via the ADIOS
conversion library, now it has been correctly moved out to the
pioc lib config)
See Issue #557
The Fortran code relies on these flags to determine support for
ADIOS and HDF5 libraries. For NetCDF and PnetCDF libraries the
Fortran library, piof, includes config tests for the Fortran
libraries of these 3rd party libs. However ADIOS and HDF5
do not have these config tests (and Fortran libs) in the Fortran
library.
So exporting these flags from the pioc lib for all dependent libs.
(Note: _ADIOS2 flag was being exported inadvertently via the ADIOS
conversion library, now it has been correctly moved out to the
pioc lib config)
See Issue #557
In tests/general/util/pio_tutil.F90, several macros, namely _NETCDF4,
_NETCDF, _PNETCDF, _ADIOS2, and _HDF5, are utilized.
In the case of NetCDF/PnetCDF libraries, the macros _NETCDF4,
_NETCDF, and _PNETCDF are directly defined for lib piof in
src/flib/CMakeLists.txt:
However, for ADIOS2/HDF5 libraries, where no Fortran components
are available, the direct definition of _ADIOS2 and _HDF5 for lib
piof in src/flib/CMakeLists.txt is not feasible.
To overcome this limitation, a workaround is to define these macros
for lib pioc in src/clib/CMakeLists.txt. Consequently, they are indirectly
defined for lib piof.
For _HDF5, it will be something like:
The current definition of _ADIOS2 for lib adios2pio-nm-lib in
tools/adios2pio-nm/CMakeLists.txt may need to be relocated to
src/clib/CMakeLists.txt to ensure consistency for lib pioc:
It is worth noting that this workaround introduces a minor issue
related to duplicate macro definitions. On one hand, _ADIOS2 and
_HDF5 are defined using CMake's target_compile_definitions() for
lib pioc. On the other hand, they are also explicitly defined in
pio.h of lib pioc:
The text was updated successfully, but these errors were encountered: