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

problems with installing PIO

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.


New member

I'm trying to install the parallel libraries for use with MPAS. I downloaded all the files from
Then I modified LIBSRC and LIBBASE in to point to my directories, following which I executed the script

Things ran fine till it got to PIO (I see from the previous posts, a rather common problem).
First it complained about cmake, so our system admin told me I had to module load that
module load CMake/3.16.4-GCCcore-9.3.0
Plus he also also told to avoid mpifort etc on our computers, so I made a small subset of the shell script, which uses the recommended compilers,
export MPI_FC=mpiifort
export MPI_F77=mpiifort
export MPI_CC=mpiicc
export MPI_CXX=mpiicpc
and then starts from the PIO cloning and installation. The script progresses till I get the error messages (in the attached file).

I'm not very familiar with MPI programming, so would appreciate some help on this. Plus I'm also worried I am starting the PIO compiling with mpiifort, while the packages before it were compiled with what was originally in the .sh script, namely
export MPI_FC=mpifort
export MPI_F77=mpifort
export MPI_CC=mpicc
export MPI_CXX=mpic++
should I re-compile those afresh




  • error_msg.txt
    2.1 KB · Views: 48
I was able to have better luck by going back to the original compilers in the script ie mpifort,mpicc,mpicc+

So now if I look at the lib directory I can see
[sergio@taki-usr2 MPAS_sources]$ ls /asl/s1/sergio/MPAS_sources/mpas-libs-gnu8.3.0/lib/ libpiof.a pkgconfig
libhdf5.a libhdf5.settings libnetcdf.a libnetcdf.settings libpnetcdf.a
libhdf5_hl.a libmpi.a libmpicxx.a libnetcdff.a libmpifort.a libpioc.a libz.a

However now I have problems in compiling MPAS, as it says it cannot find the PIO environment?

export PIO="/asl/s1/sergio/MPAS_sources/mpas-libs-gnu8.3.0/lib/"
echo ${PIO}
make ifort CORE=init_atmosphere


make[1]: Entering directory `/umbc/xfs2/strow/asl/s1/sergio/home/IR_NIR_VIS_UV_RTcodes/MPAS_ClimateModelbyNCAR/MPAS-Model'
Checking for a usable PIO library...
************ ERROR ************
Failed to compile a PIO test program
Please ensure the PIO environment variable is set to the PIO installation directory
************ ERROR ************
make[1]: *** [pio_test] Error 1
make[1]: Leaving directory `/umbc/xfs2/strow/asl/s1/sergio/home/IR_NIR_VIS_UV_RTcodes/MPAS_ClimateModelbyNCAR/MPAS-Model'
make: *** [ifort] Error 2

Any suggestions? Apparently I am using a "bash" shell environment.


Hi Sergio, sorry about the slow response. A couple of questions for you:

First, could you attach the entire make log from your make command as a text file?

And second could you 'ls' on the 'include' folder (similar to what you've done for the lib folder) i.e.:

ls /asl/s1/sergio/MPAS_sources/mpas-libs-gnu8.3.0/include
# or
ls $PIO/include

And copy the output here?
Sure thing. I'm not exactly sure where the make log shows up (I just looked for it); so I have cut and paste the screen output into a file. I have attached a text file, it is divided into four parts (using the %%%%% sign), where I show what happens after

a) I check that "PIO" is in my environment

b) I looked at the Makefile in MPAS_Model, realized the errors are coming from trying to compile a PIO test program; so I cut and paste the part which generates "program pio1.f90" so I actually have it on my directory, to try to compile with ifort (and got an error about path to module file)

c) running
make ifort CORE=init_atmosphere

d) listing ${PIO}/include

View attachment mpas_2021_04_08_6pm.txt

BTW I've also tried gfortran, same problems


Great! Thanks for including file. I apologize about these problems. The PIO library often, frustratingly, is difficult to install (as you have noticed earlier), so I thank you for your patience.

Ah! And I see your problem, which I may have missed earlier.. You need to set the PIO directory one directory up. So you should set it to:

 export PIO="/asl/s1/sergio/MPAS_sources/mpas-libs-gnu8.3.0/"

And not to /asl/s1/sergio/MPAS_sources/mpas-libs-gnu-8.3.0/lib

Give that a try and see if it works!

As well, the command you have to compile the pio1.f90 program (i.e. `ifort pio1.f90`), wont work because you need to tell the compiler to include the library file and link the PIO library and its location. Assuming your PIO environment is set correctly (which it looks like it is) the following can be used to compile either pio1.f90 or pio2.f90:

ifort -I $PIO/include pio2.f90 -L$PIO/lib -lpiof -lpioc

If you've installed PIO2, then of course the above won't work on pio1.f90 as we wrote pio1.f90 to not be compatible with PIO2 and vice versa. (Just in case you're interested on why the pio2.f90 program didn't compile).
Hi Miles

OK thanks for the suggestions. At first glance they did not work, I was puzzled but then I realized that the "" was using gfortran, not ifort. So then I tried to compile pio2.f90 .. and it worked!
gfortran -ffree-line-length-none -I $PIO/include pio2.f90 -L$PIO/lib -lpiof -lpioc

Then I turned my attention to compiling MPAS (it asked me to set USE_PIO2 to true)
make gfortran CORE=init_atmosphere USE_PIO2=true
and things looked like they would complete, but then I believe at link time it cannot find some files. And when I look, lo and behold, they really are not there! So I'm a little puzzled by that

[sergio@taki-usr2 MPAS_sources]$ ls /asl/s1/sergio/MPAS_sources/ParallelIO/src/clib/pio_file.c
ls: cannot access /asl/s1/sergio/MPAS_sources/ParallelIO/src/clib/pio_file.c: No such file or directory

If I look at environment variables, they seem ok
[sergio@taki-usr2 MPAS-Model]$ echo ${PIO}
[sergio@taki-usr2 MPAS-Model]$ echo ${MPAS_EXTERNAL_INCLUDES}
[sergio@taki-usr2 MPAS-Model]$ echo ${MPAS_EXTERNAL_LIBS}
-L/asl/s1/sergio/MPAS_sources/mpas-libs-gnu8.3.0/lib -lhdf5_hl -lhdf5 -ldl -lz

I have attached a text file with
a) the beginning of and
b) (a very long) listing of the log while compiling MPAS
I'm no expert but looks like some netcdf stuff is missing now ...but shouldn't that have been caught earlier?




  • mpas_2021_04_08_8pm.txt
    96.8 KB · Views: 45

I was rather surprised about the nc problems since they persisted even after I double checked that I module loaded netcdf libraries. I happened to look at the next to last page on the tutorial, which gives the steps to compile on your machines .. and realized that you'll explicitly swap netcdf and load in pnetcdf before compiling

So I went back to the , looked through it and added in all of the exports

export PIO="/asl/s1/sergio/MPAS_sources/mpas-libs-gnu8.3.0/"
export NETCDF="/asl/s1/sergio/MPAS_sources/mpas-libs-gnu8.3.0/"
export PNETCDF="/asl/s1/sergio/MPAS_sources/mpas-libs-gnu8.3.0/"
export MPAS_EXTERNAL_LIBS="-L/asl/s1/sergio/MPAS_sources/mpas-libs-gnu8.3.0/lib -lhdf5_hl -lhdf5 -ldl -lz"
export MPAS_EXTERNAL_INCLUDES="-I/asl/s1/sergio/MPAS_sources/mpas-libs-gnu8.3.0/include"
and it compiled! Now I have to try some test cases ...!