Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

PIO make fail

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

JCollins

New member
Hello everyone.

I am compiling MPAS. I have compiled the libraries NetCDF-C, NetCDF-Fortran and Parallel-NetCDF. Now I am compiling PIO. I put:
Code:
# cmake -DPIO_ENABLE_TIMING=OFF /home/collins/libraries/source/ParallelIO
-- The C compiler identification is GNU 4.8.5
-- The Fortran compiler identification is GNU
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/gfortran
-- Check for working Fortran compiler: /usr/bin/gfortran  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/gfortran supports Fortran 90
-- Checking whether /usr/bin/gfortran supports Fortran 90 -- yes
-- Importing CMake_Fortran_utils
-- Importing CMake_Fortran_utils - success
-- Found MPI_C: /home/collins/libraries/openmpi/lib/libmpi.so  
-- Found MPI_Fortran: /home/collins/libraries/openmpi/lib/libmpi_usempi.so;/home/collins/libraries/openmpi/lib/libmpi_mpifh.so;/home/collins/libraries/openmpi/lib/libmpi.so  
-- 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
-- Check if the system is big endian
-- Searching 16 bit integer
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Found NetCDF_C: /home/collins/libraries/netcdf/lib/libnetcdf.so  
-- Checking NetCDF version
-- Checking NetCDF version - 4.6.1./*!<
-- Checking whether NetCDF has parallel support
-- Checking whether NetCDF has parallel support - no
-- Looking for nc_set_log_level
-- Looking for nc_set_log_level - not found
-- Found PnetCDF_C: /home/collins/libraries/pnetcdf/lib/libpnetcdf.a  
-- Checking PnetCDF version
-- Checking PnetCDF version - 1.10.0
-- Looking for ncmpi_get_varn
-- Looking for ncmpi_get_varn - not found
-- Check size of size_t
-- Check size of size_t - done
-- Check size of long long
-- Check size of long long - done
-- Checking whether Fortran compiler supports c_sizeof
-- Checking whether Fortran compiler supports c_sizeof - no
-- Found Git: /usr/bin/git (found version "1.8.3.1") 
-- Checking whether MPIIO is supported
-- Checking whether MPIIO is supported - no
-- MPIIO failed verification and therefore disabled.
-- Checking whether MPI Fortran module is supported
-- Checking whether MPI Fortran module is supported - yes
-- MPI Fortran module verified and enabled.
-- Found NetCDF_Fortran: /home/collins/libraries/netcdf/lib/libnetcdff.so  
-- Found PnetCDF_Fortran: /home/collins/libraries/pnetcdf/lib/libpnetcdf.a  
-- Looking for ncmpi_get_varn
-- Looking for ncmpi_get_varn - not found
-- Cannot build performance test without gptl timing library
-- Could NOT find MPE_C (missing:  MPE_C_LIBRARY MPE_C_INCLUDE_DIR) 
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.5") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/collins/libraries/pio

Then:
Code:
# make
Scanning dependencies of target pioc
[  3%] Building C object src/clib/CMakeFiles/pioc.dir/topology.c.o
[  7%] Building C object src/clib/CMakeFiles/pioc.dir/pio_file.c.o
In file included from /home/collins/libraries/source/ParallelIO/src/clib/pio_file.c:6:0:
/home/collins/libraries/source/ParallelIO/src/clib/pio.h:16:17: fatal error: mpi.h: No such file or directory
 #include <mpi.h>
                 ^
compilation terminated.
make[2]: *** [src/clib/CMakeFiles/pioc.dir/pio_file.c.o] Error 1
make[1]: *** [src/clib/CMakeFiles/pioc.dir/all] Error 2
make: *** [all] Error 2

I have OpenMPI installed and the rest of the libraries did not fail.

I edited the pio_file.c and pio.h files, indicating in #include <mpi.h> the full path to the OpenMPI include folder. But it keeps giving more errors in other files.

How can I indicate the mpi.h path for everything?
 
I think the FC and CC environment variables need to be set to, e.g., mpif90 and mpicc before running cmake. Here's what seems to work well for me when compiling PIO2 after installing netCDF and parallel-netCDF (and setting the NETCDF and PNETCDF environment variables):
Code:
export FC=mpif90
export CC=mpicc
git clone https://github.com/NCAR/ParallelIO
cd ParallelIO
export PIOSRC=`pwd`
cd ..
mkdir pio_build
cd pio_build
cmake -DNetCDF_C_PATH=$NETCDF -DNetCDF_Fortran_PATH=$NETCDF -DPnetCDF_PATH=$PNETCDF -DCMAKE_INSTALL_PREFIX=/where/to/install/pio2 -DPIO_ENABLE_TIMING=OFF $PIOSRC
make
make install
In the above, you'll just need to change "/where/to/install/pio2" to the actual path where you'd like to install the PIO2 library.
 
Thank you very much mgduda. I had set the variables before make, but after cmake. I did it as you told me and it was compiled without problems.
 
Top