MPAS library building error

Discussions related to downloading and compiling MPAS-Atmosphere.
Post Reply
sekluzia
Posts: 180
Joined: Mon Oct 15, 2018 12:42 pm

MPAS library building error

Post by sekluzia » Mon Jun 24, 2019 12:14 pm

Dear Sir/Madam,

I am trying to build MPAS libraries using the script provided by the post of wrf forum:
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
config.txt
(11.24 KiB) Downloaded 45 times
log.txt
(405.92 KiB) Downloaded 46 times
scripts.txt
(3.29 KiB) Downloaded 47 times

mgduda
Posts: 374
Joined: Mon Feb 26, 2018 7:35 pm

Re: MPAS library building error

Post by mgduda » Mon Jun 24, 2019 6:40 pm

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: Select all

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: Select all

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".
NCAR/MMM

mgduda
Posts: 374
Joined: Mon Feb 26, 2018 7:35 pm

Re: MPAS library building error

Post by mgduda » Mon Jun 24, 2019 6:47 pm

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: Select all

########################################
# 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.
NCAR/MMM

sekluzia
Posts: 180
Joined: Mon Oct 15, 2018 12:42 pm

Re: MPAS library building error

Post by sekluzia » Tue Jun 25, 2019 11:24 am

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
log.out.txt
(1.13 MiB) Downloaded 45 times
scripts_new.txt
(3.32 KiB) Downloaded 43 times
mpas.log.txt
(5.69 KiB) Downloaded 50 times

mgduda
Posts: 374
Joined: Mon Feb 26, 2018 7:35 pm

Re: MPAS library building error

Post by mgduda » Tue Jun 25, 2019 4:29 pm

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.
NCAR/MMM

sekluzia
Posts: 180
Joined: Mon Oct 15, 2018 12:42 pm

Re: MPAS library building error

Post by sekluzia » Thu Jun 27, 2019 12:15 pm

Thank you very much for your helpful suggestions!
I successfully built the MPAS model.

Best regards,
Artur

mgduda
Posts: 374
Joined: Mon Feb 26, 2018 7:35 pm

Re: MPAS library building error

Post by mgduda » Thu Jun 27, 2019 4:01 pm

That's good to hear!
NCAR/MMM

Post Reply

Return to “Compilation / installation”