Compilation error

Discussions related to downloading and compiling MPAS-Atmosphere.
Post Reply
alang44_gmail
Posts: 5
Joined: Sun Nov 25, 2018 1:36 pm

Compilation error

Post by alang44_gmail » Sun Nov 25, 2018 1:54 pm

I have upgraded my Mac to Mojave, which forced me to wipe the hard disc. Thus I am recompiling MPAS again from scratch.
I compiled with --disable netcdf4 and followed the ppt from the summer Boulder course.

I have a compile error (for init_atmosphere and atmosphere). It looks like I am missing a library, or a path incorrectly set.
Could anyone point me in the right direction. Details of the error are below.

Thanks
Alan Gadian
alan@env.leeds.ac.uk or alang44@gmail.com

- - - -

mpif90 -D_MPI -DUNDERSCORE -DCORE_INIT_ATMOSPHERE -DMPAS_NAMELIST_SUFFIX=init_atmosphere -DMPAS_EXE_NAME=init_atmosphere_model -DMPAS_NATIVE_TIMERS -DMPAS_GIT_VERSION=v6.1 -O3 -m64 -ffree-line-length-none -fconvert=big-endian -ffree-form -fdefault-real-8 -fdefault-double-8 -c mpas_io.F -I/Users/lecag/MPAS-Model/ParallelIO-pio1_7_1/pio/include -I/Users/lecag/MPAS-Model/parallel-netcdf-1.8.1/include -I/Users/lecag/MPAS-Model/ParallelIO-pio1_7_1/pio/include -I/Users/lecag/MPAS-Model/parallel-netcdf-1.8.1/include -I../external/esmf_time_f90
mpas_io.F:30:43:

integer, parameter :: MPAS_INT_FILLVAL = NF_FILL_INT
1
Error: Parameter 'nf_fill_int' at (1) has not been declared or is a variable, which does not reduce to a constant expression
mpas_io.F:31:53:

character, parameter :: MPAS_CHAR_FILLVAL = achar(NF_FILL_CHAR)
1
Error: Parameter 'nf_fill_char' at (1) has not been declared or is a variable, which does not reduce to a constant expression
mpas_io.F:44:54:

real (kind=RKIND), parameter :: MPAS_REAL_FILLVAL = NF_FILL_DOUBLE
1
Error: Parameter 'nf_fill_double' at (1) has not been declared or is a variable, which does not reduce to a constant expression
mpas_io.F:566:79:

pio_ierr = PIO_def_dim(handle % pio_file, trim(dimname), PIO_unlimited, new_dimlist_node % dimhandle % dimid)
1
Error: Symbol 'pio_unlimited' at (1) has no IMPLICIT type
mpas_io.F:278:37:

pio_mode = PIO_64BIT_DATA
1
Error: Symbol 'pio_64bit_data' at (1) has no IMPLICIT type
make[3]: *** [mpas_io.o] Error 1
make[2]: *** [frame] Error 2
make[1]: *** [mpas_main] Error 2
make: *** [gfortran] Error 2

- - - -

kwthomas
Posts: 73
Joined: Tue Nov 06, 2018 10:25 pm

Re: Compilation error

Post by kwthomas » Mon Nov 26, 2018 10:44 pm

Alan...

Older versions of NETCDF contain interfaces for Fortran and C. Newer versions contain
only the C interface. I suspect you are using one of these. You need NETCDFF which is
the Fortran version. You will still need the standard version. The Fortran version will make
C calls.
Kevin W. Thomas
Center for Analysis and Prediction of Storms
University of Oklahoma
Norman, Oklahoma

alang44_gmail
Posts: 5
Joined: Sun Nov 25, 2018 1:36 pm

Re: Compilation error

Post by alang44_gmail » Tue Nov 27, 2018 11:01 am

Kevin,
Thanks. I thought I was using an older netcdf. I will check again. Do you have any suggestion for which versions are recommended?
Thanks
Alan

kwthomas
Posts: 73
Joined: Tue Nov 06, 2018 10:25 pm

Re: Compilation error

Post by kwthomas » Tue Nov 27, 2018 9:44 pm

Alan...

I use NETCDF 3.6.2 on BRIDGES/PSC with no problems.
Kevin W. Thomas
Center for Analysis and Prediction of Storms
University of Oklahoma
Norman, Oklahoma

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

Re: Compilation error

Post by mgduda » Tue Nov 27, 2018 11:13 pm

For what it's worth, I've been using the following library versions with generally good results:
  • zlib 1.2.11
  • HDF5 1.8.20
  • parallel-netCDF 1.9.0
  • netCDF C 4.6.1
  • netCDF Fortran 4.4.4
  • PIO2 master
Attached is a script that I follow (with some variation depending on compiler) to build these libraries assuming a working MPI installation.
With the current (v6.x) MPAS build system it will also be necessary to set the environment variables MPAS_EXTERNAL_LIBS and MPAS_EXTERNAL_INCLUDES as mentioned at the bottom of the script.

Hopefully this helps!
Attachments
iolib_installation.txt
(3.27 KiB) Downloaded 73 times
NCAR/MMM

alang44_gmail
Posts: 5
Joined: Sun Nov 25, 2018 1:36 pm

Re: Compilation error

Post by alang44_gmail » Wed Nov 28, 2018 10:10 am

Thanks to all.
I will retry when I get back from London .. I need to restart from scratch (again)
Best wishes
Alan

alang44_gmail
Posts: 5
Joined: Sun Nov 25, 2018 1:36 pm

Re: Compilation error

Post by alang44_gmail » Thu Dec 06, 2018 9:38 pm

Micheal &Kevin

Thanks for your comments
I think the script has worked now. Can't be sure, but the libraries seem to have compiled. I have put everything in the bin and lib.
I now get an error when I try to compile on the Mac. I used the old command

make gfortran CORE=init_atmosphere

I need to sort out my variables and paths, but a quick question .. (a) are there any other env variables other than

export PIO=$LIBBASE
########################################
# Other environment vars needed by MPAS
########################################
export MPAS_EXTERNAL_LIBS="-L${LIBBASE}/lib -lhdf5_hl -lhdf5 -ldl -lz"
export MPAS_EXTERNAL_INCLUDES="-I${LIBBASE}/include"

or (b)

any options needed to compile on MAC Mojave (i.e.where I can find info)

Thanks again
Alan

p.s. error is (which implies can't find pio)

> mpas_derived_types.F:30:7:
>
> use pio
> 1
> Fatal Error: Can't open module file 'pio.mod' for reading at (1): No such file or directory
> compilation terminated.

jokervtv
Posts: 11
Joined: Fri Jul 27, 2018 12:05 pm

Re: Compilation error

Post by jokervtv » Mon May 27, 2019 9:08 am

`pio.mod` need you use `--enable-fortran` when you use `autoreconf` to build it. Or try using cmake.

Good luck.

Post Reply

Return to “Compilation / installation”