E3SM-Project / scorpio

A high-level Parallel I/O Library for structured grid applications
Other
21 stars 16 forks source link

CMake Error at SPIOTypeUtils.cmake when SCORPIO is configured with ADIOS2 lib built with SST option #468

Closed dqwu closed 2 years ago

dqwu commented 2 years ago

ADIOS2 lib has a default CMake option ADIOS2_USE_SST for Simplified Staging Engine (SST) and its dependencies. If SCORPIO is configured with ADIOS2 lib built with that default option, CMake will fail at at cmake/SPIOTypeUtils.cmake:172

This issue was first found with latest ADIOS2 2.8.0, but it can also be reproduced with older versions like 2.5.0.

Steps to reproduce this issue on ANL GCE nodes (compute-01 or compute-02):

module load gcc/11.1.0-5ikoznk
module load cmake/3.20.5-yjp2hz6
export PATH=/nfs/gce/projects/climate/software/mpich/3.4.2/gcc-11.1.0/bin:$PATH

git clone https://github.com/E3SM-Project/scorpio.git
cd scorpio

mkdir build
cd build

ADIOS2_DIR=/nfs/gce/projects/climate/software/adios2/2.8.0.bp4.sst/mpich-3.4.2/gcc-11.1.0 \
CC=mpicc CXX=mpicxx FC=mpifort \
cmake -Wno-dev \
-DWITH_ADIOS2=ON \
-DWITH_NETCDF=OFF \
-DPnetCDF_PATH=/nfs/gce/projects/climate/software/pnetcdf/1.12.2/mpich-3.4.2/gcc-11.1.0 \
-DPIO_USE_MALLOC=ON  \
..

Output messages:

-- Found MPI: TRUE (found version "3.1")  
-- Found atl: /nfs/gce/projects/climate/software/adios2/2.8.0.bp4.sst/mpich-3.4.2/gcc-11.1.0/lib/cmake/adios2/thirdparty/atl-config.cmake (found suitable version "2.2.1", minimum required is "2.2.1") 
-- Found atl: /nfs/gce/projects/climate/software/adios2/2.8.0.bp4.sst/mpich-3.4.2/gcc-11.1.0/lib/cmake/adios2/thirdparty/atl-config.cmake (found version "2.2.1") 
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'libffi'
--   Found libffi, version 3.2.1
-- Found LibFFI: -lffi  
-- Found dill: /nfs/gce/projects/climate/software/adios2/2.8.0.bp4.sst/mpich-3.4.2/gcc-11.1.0/lib/cmake/adios2/thirdparty/dill-config.cmake (found version "2.4.1") 
-- Found ffs: /nfs/gce/projects/climate/software/adios2/2.8.0.bp4.sst/mpich-3.4.2/gcc-11.1.0/lib/cmake/adios2/thirdparty/ffs-config.cmake (found suitable version "1.6.0", minimum required is "1.6.0") 
-- Found dill: /nfs/gce/projects/climate/software/adios2/2.8.0.bp4.sst/mpich-3.4.2/gcc-11.1.0/lib/cmake/adios2/thirdparty/dill-config.cmake (found suitable version "2.4.1", minimum required is "2.4.1") 
-- Found enet: /nfs/gce/projects/climate/software/adios2/2.8.0.bp4.sst/mpich-3.4.2/gcc-11.1.0/lib/cmake/adios2/thirdparty/enet-config.cmake (found suitable version "1.3.14", minimum required is "1.3.14") 
-- Found EVPath: /nfs/gce/projects/climate/software/adios2/2.8.0.bp4.sst/mpich-3.4.2/gcc-11.1.0/lib/cmake/adios2/thirdparty/EVPathConfigCommon.cmake (found version "4.5.0") 
-- Found ADIOS2: /nfs/gce/projects/climate/software/adios2/2.8.0.bp4.sst/mpich-3.4.2/gcc-11.1.0/lib/cmake/adios2/adios2-config.cmake (found suitable version "2.8.0", minimum required is "2.7.0") found components: C CXX MPI missing components: Fortran
-- Found ADIOS library
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of MPI_Offset
-- Check size of MPI_Offset - done
CMake Warning at cmake/SPIOTypeUtils.cmake:83 (message):
  Could not check whether Fortran type sizes match.  Missing template file,
  "TryMPI_OFFSET_TYPE.F90" in module path: ""
Call Stack (most recent call first):
  cmake/SPIOTypeUtils.cmake:161 (check_ftype_size_eq)
  src/clib/CMakeLists.txt:147 (get_pio_offset_type)

CMake Warning at cmake/SPIOTypeUtils.cmake:83 (message):
  Could not check whether Fortran type sizes match.  Missing template file,
  "TryMPI_OFFSET_TYPE.F90" in module path: ""
Call Stack (most recent call first):
  cmake/SPIOTypeUtils.cmake:161 (check_ftype_size_eq)
  src/clib/CMakeLists.txt:147 (get_pio_offset_type)

CMake Warning at cmake/SPIOTypeUtils.cmake:83 (message):
  Could not check whether Fortran type sizes match.  Missing template file,
  "TryMPI_OFFSET_TYPE.F90" in module path: ""
Call Stack (most recent call first):
  cmake/SPIOTypeUtils.cmake:161 (check_ftype_size_eq)
  src/clib/CMakeLists.txt:147 (get_pio_offset_type)

CMake Error at cmake/SPIOTypeUtils.cmake:172 (message):
  Could not find a Fortran type for passing PIO Offsets from Fortran to C
Call Stack (most recent call first):
  src/clib/CMakeLists.txt:147 (get_pio_offset_type)

Note, this issue is not reproducible when ADIOS2 lib is built without SST option, which does not contain the directory lib/cmake/adios2/thirdparty.

-- Found MPI: TRUE (found version "3.1")  
-- Found ADIOS2: /nfs/gce/projects/climate/software/adios2/2.8.0.bp4/mpich-3.4.2/gcc-11.1.0/lib/cmake/adios2/adios2-config.cmake (found suitable version "2.8.0", minimum required is "2.7.0") found components: C CXX MPI missing components: Fortran
-- Found ADIOS library
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of MPI_Offset
-- Check size of MPI_Offset - done
-- Checking whether Fortran type INTEGER(KIND=MPI_OFFSET_KIND) has the same size as INTEGER(KIND=C_LONG_LONG)
-- Using MPI_Offset for PIO Offset. sizeof(PIO_Offset) = 8 bytes
dqwu commented 2 years ago

Before PR 465 was merged, the CMake error is:

-- ===== Configuring SCORPIO File info tool... =====
CMake Error at tools/spio_finfo/CMakeLists.txt:9 (include):
  include could not find requested file:

    SPIOUtils

For SCORPIO release 1.2.2, there is a CMake warning:

CMake Warning at tools/spio_finfo/CMakeLists.txt:74 (find_package):
  By not providing "FindPnetCDF.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "PnetCDF", but
  CMake did not find one.

All these issues seem to be caused by the CMake files inside ADIOS2 lib (configured and built with SST).

jayeshkrishna commented 2 years ago

ADIOS is resetting the CMAKE_MODULE_PATH and hence SCORPIO configure is not able to find local CMake modules (the local modules that are searched for are different in 1.2.2 and 1.3.1 & hence the error messages are different, however the issue is the same - the CMake module path is being reset by ADIOS)