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

MPAS library building error

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.

sekluzia

Member
Dear Sir/Madam,

I am trying to build MPAS libraries using the script provided by the post of wrf forum:
http://forum.mmm.ucar.edu/phpBB3/viewtopic.php?f=10&t=460#p1365

Please, find attached slightly modified script (script.txt). As far as I understand the netcdf-fortran-4.4.4 is failed to build (log.txt). The config.txt is also attached to see errors of netcdf-fortran-4.4.4 compilation. Could you please look into the files and help me?

Artur
 

Attachments

  • scripts.txt
    3.3 KB · Views: 98
  • log.txt
    405.9 KB · Views: 91
  • config.txt
    11.2 KB · Views: 90
From the "config.txt" and "log.txt" files, it looks like the HDF5 and netCDF-C libraries may not have been installed correctly. Here are the relevant lines from the "config.txt" file:
Code:
configure:4068: mpicc  -I/home/ubuntu/MPAS-Model/LIBRARIES//include -L/home/ubuntu/MPAS-Model/LIBRARIES//lib conftest.c -lnetcdf -lhdf5_hl -lhdf5 -lz -ldl >&5
/usr/bin/ld: cannot find -lnetcdf
/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status

Looking in the "log.txt" file, it looks like the HDF5 library may not have been compiled due to a mismatch in path names in the HDF5 section of your modified "scripts.txt" file. Can you try correcting the "cd" and "rm" command in this section of your "scripts.txt" file:
Code:
tar xjvf ${LIBSRC}/hdf5-1.10.5.tar.bz2
cd hdf5-1.8.20
export FC=$MPI_FC
export CC=$MPI_CC
export CXX=$MPI_CXX
./configure --prefix=${LIBBASE} --enable-parallel --with-zlib=${LIBBASE} --disable-shared
make
make check
make install
cd ..
rm -rf hdf5-1.8.20

I think "hdf5-1.8.20" should be "hdf5-1.10.5".
 
Also, it might be worth updating to parallel-netCDF 1.11.0, and to use PIO 2.4.2 specifically. Inside the PIO section of the compilation script, you can use something like the following:
Code:
########################################
# PIO
########################################
git clone https://github.com/NCAR/ParallelIO
cd ParallelIO
git checkout -b pio-2.4.2 pio2_4_2
export PIOSRC=`pwd`
cd ..
mkdir pio
cd pio
export CC=$MPI_CC
export FC=$MPI_FC
cmake -DNetCDF_C_PATH=$NETCDF -DNetCDF_Fortran_PATH=$NETCDF -DPnetCDF_PATH=$PNETCDF -DHDF5_PATH=$NETCDF -DCMAKE_INSTALL_PREFIX=$LIBBASE -DPIO_USE_MALLOC=ON -DCMAKE_VERBOSE_MAKEFILE=1 -DPIO_ENABLE_TIMING=OFF $PIOSRC
make
make install
cd ..
rm -rf pio ParallelIO
export PIO=$LIBBASE

The key change is the addition of the command to checkout the "pio2_4_2" tag after cloning the PIO repository.
 
Thanks for your reply!
I modified the script following your suggestions (scripts_new.txt). It seems, the libraries are now built properly. However, I am not sure, since the script stops for hours at the following row (log.out.txt):


**** end of Hint ****
make[4]: Entering directory '/home/ubuntu/MPAS-Model/hdf5-1.10.5/testpar'
============================
Testing t_mpi

After that, when I am trying to compile the MPAS typing
make gfortran CORE=atmosphere PRECISION=single >& mpas.log

The MPAS fails to be built (mpas.log.txt)

Best regards,
Artur
 

Attachments

  • mpas.log.txt
    5.7 KB · Views: 90
  • scripts_new.txt
    3.3 KB · Views: 100
  • log.out.txt
    1.1 MB · Views: 92
If the script to install libraries is hanging while trying to run the HDF5 tests, then it seems like the libraries would not have been installed correctly. From your "scripts_new.txt" file, it looks like you are installing the libraries in /home/ubuntu/MPAS-Model/LIBRARIES/ . From your "mpas.log.txt" file, however, there are references to library paths /home/ubuntu/Build_WRF/LIBRARIES/netcdf/lib and /usr/bin/pnetcdf_version/lib .

I would suggest starting from a clean terminal, un-setting any environment variables that reference any previous installations of the netCDF or parallel-netCDF libraries, and installing the libraries using your script into a clean directory. Before that, however, you may want to ensure that the MPI implementation on your system is working; the HDF5 test seems to have failed while trying to run a test involving MPI, so it could be that there is a problem with your MPI installation.

I would also recommend updating to parallel-netCDF 1.11.0, only because that's the version that I've been using successfully with PIO 2.4.2.
 
Top