MPAS-Tools Make Error

Discussions related to downloading and compiling MPAS-Atmosphere.
Post Reply
yuyangyang0709
Posts: 8
Joined: Wed Dec 11, 2019 8:37 am

MPAS-Tools Make Error

Post by yuyangyang0709 » Fri Dec 20, 2019 6:08 am

I want to build the grid_rotate utility with the make command, but there are some errors about the compilation environment.
The error messages are as follow:

[lulv@ln02 grid_rotate]$ make
gfortran grid_rotate.f90 -o grid_rotate -m64 -O2 -ffree-line-length-none -ffree-form -Wall -I/home/lulv/yuyy/software2/include -L/home/lulv/yuyy/software2/lib -lnetcdff -L/home/lulv/yuyy/software2/lib -lnetcdf -lcurl -lm -lnetcdf -lhdf5_hl -lhdf5 -lz -ldl
/home/lulv/yuyy/software2/lib/libhdf5.a(H5.o): In function `H5_init_library':
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5.c:121: undefined reference to `MPI_Initialized'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5.c:122: undefined reference to `MPI_Finalized'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5.c:141: undefined reference to `MPI_Comm_create_keyval'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5.c:146: undefined reference to `MPI_Comm_set_attr'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5.c:149: undefined reference to `MPI_Comm_free_keyval'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5.c:150: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5.c:144: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5.c:147: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/software2/lib/libhdf5.a(H5C.o): In function `H5C_load_entry':
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5C.c:6605: undefined reference to `MPI_Bcast'
/home/lulv/yuyy/software2/lib/libhdf5.a(H5C.o): In function `H5C_protect':
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5C.c:2297: undefined reference to `MPI_Bcast'
/home/lulv/yuyy/software2/lib/libhdf5.a(H5C.o): In function `H5C_load_entry':
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5C.c:6651: undefined reference to `MPI_Bcast'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5C.c:6652: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/software2/lib/libhdf5.a(H5C.o): In function `H5C_protect':
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5C.c:2298: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/software2/lib/libhdf5.a(H5C.o): In function `H5C_load_entry':
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5C.c:6606: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/software2/lib/libhdf5.a(H5Cimage.o): In function `H5C__read_cache_image':
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Cimage.c:1071: undefined reference to `MPI_Bcast'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Cimage.c:1076: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Cimage.c:1083: undefined reference to `MPI_Bcast'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Cimage.c:1088: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Cimage.c:1071: undefined reference to `MPI_Bcast'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Cimage.c:1083: undefined reference to `MPI_Bcast'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Cimage.c:1088: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Cimage.c:1076: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/software2/lib/libhdf5.a(H5Cimage.o): In function `H5C__prep_image_for_file_close':
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Cimage.c:1448: undefined reference to `MPI_Bcast'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Cimage.c:1454: undefined reference to `MPI_Bcast'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Cimage.c:1449: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Cimage.c:1455: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/software2/lib/libhdf5.a(H5CX.o): In function `H5CX_set_apl':
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5CX.c:853: undefined reference to `MPI_Barrier'
/home/lulv/yuyy/software2/lib/libhdf5.a(H5CX.o): In function `H5CX_set_loc':
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5CX.c:912: undefined reference to `MPI_Barrier'
/home/lulv/yuyy/software2/lib/libhdf5.a(H5Dchunk.o): In function `H5D__chunk_collective_fill':
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dchunk.c:4740: undefined reference to `MPI_Type_free'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dchunk.c:4742: undefined reference to `MPI_Type_free'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dchunk.c:4743: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dchunk.c:4741: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dchunk.c:4698: undefined reference to `MPI_Type_create_hindexed'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dchunk.c:4700: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dchunk.c:4701: undefined reference to `MPI_Type_commit'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dchunk.c:4702: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dchunk.c:4704: undefined reference to `MPI_Type_create_hvector'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dchunk.c:4706: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dchunk.c:4707: undefined reference to `MPI_Type_commit'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dchunk.c:4708: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dchunk.c:4730: undefined reference to `MPI_Barrier'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dchunk.c:4731: undefined reference to `MPI_Error_string'
/home/lulv/yuyy/software2/lib/libhdf5.a(H5Dcontig.o): In function `H5D__contig_fill':
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dcontig.c:318: undefined reference to `MPI_Barrier'
/home/lulv/yuyy/installation/mpas_source/hdf5-1.10.5/src/H5Dcontig.c:319: undefined reference to `MPI_Error_string

My MPAS environment is set according to https://www2.mmm.ucar.edu/people/duda/f ... s/sources/
Is there anything missing or wrong with my environment?

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

Re: MPAS-Tools Make Error

Post by mgduda » Fri Dec 20, 2019 6:20 pm

The error messages show that the HDF5 library references MPI symbols (which is expected if the library was built with support for parallel I/O), in which case it will probably be necessary to link to the MPI libraries when compiling any programs that use HDF5 directly or indirectly. The simplest solution would be to just change 'gfortran' to 'mpif90' in the Makefile for the grid_rotate tool.
NCAR/MMM

yuyangyang0709
Posts: 8
Joined: Wed Dec 11, 2019 8:37 am

Re: MPAS-Tools Make Error

Post by yuyangyang0709 » Sat Dec 21, 2019 2:40 am

Thanks a bunch for the help. The problem has been solved.

Post Reply

Return to “Compilation / installation”