MM5 MPP

Hi,
I am trying to compile MM5-urban with MPP but I have problems. In the file produced during compilation there are lots of warning messages some error messages for particular programs for example

/usr/local/topspin/mpi/mpich/bin/mpif77.p -c -O2 -Mcray=pointer -Mnoframe -byteswapio -DDEC_ALPHA gspbl.f 2> gspbl.lis
make[1]: [gspbl.o] Error 2 (ignored)
echo gspbl.b gspbl.dm gspbl.f
gspbl.b gspbl.dm gspbl.f
cut -c1-72 slab.F | sed ‘s/`//’ | expand |

and the end of this file is

L/librsl.a -O2 -Mcray=pointer -Mnoframe -byteswapio -L/usr/local/topspin/mpi/mpich/lib64 -lfmpich -lmpich
transm_col.o(.text+0x0): In function transm_col_': : multiple definition of transm_col_’
transm_col.o(.text+0x0): first defined here
/usr/bin/ld: gspbl.o: No such file: No such file or directory
make[1]: [all] Error 2 (ignored)
/bin/mv mm5.mpp …/…/Run/mm5.mpp
/bin/mv: cannot stat mm5.mpp': No such file or directory make[1]: [all] Error 1 (ignored) make[1]: Leaving directory /home/hris/IBM/MPP/build’

I suppose that there are very strange mixture of compilation options- in fact I think that these options are not the correct ones. In fact when I tried to compile a single program I received this message

[slunce@efd bulk]$ /usr/local/topspin/mpi/mpich/bin/mpif77.p -c -O2 -Mcray=pointer -Mnoframe -byteswapio -DDEC_ALPHA blkpbl.F
PGFTN-F-0226-Can’t find include file parame.incl (blkpbl.F: 15)

And of course the file parame.incl is in directory that it is supposed to be.
So may be there is a problem with compilation of statement

include <file_name>

because I tried with different programs and in each of them in which there are include <file_name> there is a message that the file with a particular name which is written in the first include statement cannot be found.

My options in configure.user file are

RUNTIME_SYSTEM = “linux”
MPP_TARGET=$(RUNTIME_SYSTEM)
LINUX_MPIHOME = /usr/local/topspin/mpi/mpich
MFC = $(LINUX_MPIHOME)/bin/mpif77.p
MCC = $(LINUX_MPIHOME)/bin/mpicc
MLD = $(LINUX_MPIHOME)/bin/mpif77.p
FCFLAGS = -O2 -Mcray=pointer -Mnoframe -byteswapio -DDEC_ALPHA
LDOPTIONS = -O2 -Mcray=pointer -Mnoframe -byteswapio
LOCAL_LIBRARIES = -L$(LINUX_MPIHOME)/lib64 -lfmpich -lmpich
MAKE = make -i -r
AWK = awk
SED = sed
CAT = cat
CUT = cut
EXPAND = expand
M4 = m4
CPP = /lib/cpp -C -P -traditional -DDEC_ALPHA
CPPFLAGS = -DMPI -Dlinux -DSYSTEM_CALL_OK -DDEC_ALPHA
CFLAGS = -DMPI -I$(LINUX_MPIHOME)/include
ARCH_OBJS = milliclock.o
IWORDSIZE = 4
RWORDSIZE = 4
LWORDSIZE = 4
#---------------------------------------

and in the makefile.linux

OBJ = $(CORE_OBJ) rsl_mpi_compat.o mpi_init_f.o debug.o fort_doubleread.o fort_doublewrite.o rsl_error_dup.o fort_bdyin_dbl.o vicopy.o
HDR = $(CORE_HDR)
TAR = $(CORE_TAR)

IDIR=$(LINUX_MPIHOME)/include
CC = $(LINUX_MPIHOME)/bin/mpicc
FC = $(LINUX_MPIHOME)/bin/mpif77.p

LIB =



I hope that someone can help me to fix my compilation options

Thank you very much

Hi slunce,

I think you just need to add the “-I/path/to/mm5/include” flag to let the compiler know where “parame.incl” is located. Please change the path to the actual path to the MM5 include directory.

Example:

slunce@efd bulk]$ /usr/local/topspin/mpi/mpich/bin/mpif77.p -c -O2 -Mcray=pointer -Mnoframe -byteswapio -DDEC_ALPHA -I/path/to/mm5/include blkpbl.F
  • Mat

Hi,
Used Mat’s recommendation and thanks to him I have no error message in the file created during compilation except:) at the end of this file


milliclock.o …/…/MPP/RSL/RSL/librsl.a -O2 -Mcray=pointer -Mnoframe -byteswapio -L/usr/local/topspin/mpi/mpich/lib64 -lfmpich -lmpich
transm_col.o(.text+0x0): In function transm_col_': : multiple definition of transm_col_’
transm_col.o(.text+0x0): first defined here
…/…/MPP/RSL/RSL/librsl.a(rsl_malloc.o)(.text+0x20a): In function rsl_free': : undefined reference to errno’
…/…/MPP/RSL/RSL/librsl.a(rsl_malloc.o)(.text+0x22a): In function rsl_free': : undefined reference to errno’
make[1]: [all] Error 2 (ignored)
/bin/mv mm5.mpp …/…/Run/mm5.mpp
/bin/mv: cannot stat mm5.mpp': No such file or directory make[1]: [all] Error 1 (ignored) make[1]: Leaving directory /home/hris/IBM/MPP/build’

and I have no idea what is the meaning of these messages

So can you help me with this?

Thank you very much

Hi sluce,

The MM5 help desk (http://www.mmm.ucar.edu/mm5/mpp/helpdesk/) shows that they have a fix for the ‘errno’ problem in the latest release (See http://www.mmm.ucar.edu/mm5/mpp/helpdesk/20030725.html). Linux changed how it handles the global variable ‘errno’ and many programs needed to be updated.

As for the multple definition error, I’m not sure. While I haven’t built MM5 MPP for a while, I don’t remember encountering this. If I had to guess, I’d say that ‘transm.o’ and ‘transm_col.o’ are on the link line and when you compiled ‘transm.o’ (source physics/radiation/sfc/transm.F) you used the define flag ‘-DMPP1_COLUMNWISE’. This define flag toggles which TRANSM function definition to use.

Try downloading the latest MM5 and MPP versions from ftp://ftp.ucar.edu/mesouser/MM5V3 to see if this takes care of the problem. If not, next week I’ll try to write up a guide on compiling MPP.

  • Mat

Hi, Mat
I used http://www.mmm.ucar.edu/mm5/mpp/helpdesk/20030725.html) and now I have problems only with

L/librsl.a -O2 -Mcray=pointer -Mnoframe -byteswapio -L/usr/local/topspin/mpi/mpich/lib64 -lfmpich -lmpich
transm_col.o(.text+0x0): In function transm_col_': : multiple definition of transm_col_’
transm_col.o(.text+0x0): first defined here
make[1]: [all] Error 2 (ignored)
/bin/mv mm5.mpp …/…/Run/mm5.mpp
/bin/mv: cannot stat mm5.mpp': No such file or directory ......... \ \ \ Following your recommendations I tried with the newest version of MPP and the same copilation options but something strange happened ..................... /usr/local/topspin/mpi/mpich/bin/mpicc -c -I/usr/local/topspin/mpi/mpich/include -DMPI -DRSL_SYNCIO -Dlinux -DSWAPBYTES -O -DIMAX_MAKE= -DJMAX_MAKE= -DMAXDOM_MAKE=6 -DMAXPROC_MAKE=256 -DHOST_NODE=0 -DMON_LOW=1 -DALLOW_RSL_168PT=1 set_padarea.c In file included from /usr/local/topspin/mpi/mpich/include/mpidefs.h:7, from /usr/local/topspin/mpi/mpich/include/mpi.h:230, from rsl_comm.h:266, from rsl.h:839, from set_padarea.c:59: /usr/local/topspin/mpi/mpich/include/mpi_fortdefs.h:5: error: redefinition of typedef 'MPI_Fint' rsl.h:832: error: previous declaration of 'MPI_Fint' was here make[2]: [set_padarea.o] Error 1 (ignored) /usr/local/topspin/mpi/mpich/bin/mpif77.p -c -O set_f_padarea.F /usr/local/topspin/mpi/mpich/bin/mpicc -c -I/usr/local/topspin/mpi/mpich/include -DMPI -DRSL_SYNCIO -Dlinux -DSWAPBYTES -O -DIMAX_MAKE= -DJMAX_MAKE= -DMAXDOM_MAKE=6 -DMAXPROC_MAKE=256 -DHOST_NODE=0 -DMON_LOW=1 -DALLOW_RSL_168PT=1 domain_def.c In file included from /usr/local/topspin/mpi/mpich/include/mpidefs.h:7, from /usr/local/topspin/mpi/mpich/include/mpi.h:230, from rsl_comm.h:266, from rsl.h:839, from domain_def.c:59: /usr/local/topspin/mpi/mpich/include/mpi_fortdefs.h:5: error: redefinition of typedef 'MPI_Fint' rsl.h:832: error: previous declaration of 'MPI_Fint' was here make[2]: [domain_def.o] Error 1 (ignored) ...................... \ \ and at the end of compilation .................. cc -DMPI -I/usr/local/topspin/mpi/mpich/include -o col_cutter ./col_cutter.c; /tmp/ccshoBmx.o(.text+0xe): In function main’:
: warning: the gets' function is dangerous and should not be used. make[1]: Leaving directory /home/hris/P/IBM/MPP’
(cd MPP/build;
/bin/rm -f .tmpobjs ;
/lib/cpp -C -P -traditional -DDEC_ALPHA -D"linux" -I…/…/pick …/mpp_objects_all > .tmpobjs ;
make -i -r -f Makefile.RSL )
make[1]: Entering directory /home/hris/P/IBM/MPP/build' cut -c1-72 ../../include/parame >> parame.incl /bin/mv parame.incl ../../pick make[1]: Leaving directory /home/hris/P/IBM/MPP/build’


And when I typed “make mpclean”, “make uninstall” the tast message was:

make[1]: Entering directory /home/hris/P/IBM/MPP/RSL/RSL' make[1]: *** No rule to make target super’. Stop.
make[1]: Leaving directory `/home/hris/P/IBM/MPP/RSL/RSL’
make: *** [uninstall] Error 2


So may be I have no other choice expect to use the MPP which is provided with the version of MM5 which I used.

Hi Sluce,

We were able to compile and link MM5 MPP without problems here using the PGI 6.1-1 CDK which includes a precomiled version of MPICH. We used the MM5.TAR.gz and MPP.TAR.gz packages found at UCAR’s ftp site and performed the following steps:

  1. Unpacked the two packages. MM5 first, then unpacked MPP within the new MM5 directory.
  2. Uncommented section 7g in the “configure.users” file.
  3. Changed the “LINUX_MPIHOME” to the base directory of our MPICH installation. In our case this is /usr/pgi/linux86-64/6.1-1.
  4. Added “CC = pgcc” so “parseconfig” is built correctly.
  5. Added “-I/path/to/MM5/include” to the FCFLAGS. This is used to find “parame.incl”.
  6. Added “-DDEC_ALPHA” to FCFLAGS. This is needed to run MM5 correctly in 64-bit mode.
  7. Removed “-tp p6 -pc 32” from FCFLAGS and LDOPTIONS. “-tp p6” sets the target architecture to a 32-bit Pentium II. “-pc 32” sets the x87 precision control to 32-bits. This flag is not needed on a 64-bit target system.
  8. Typed ‘make’


    As for your errors. MPI_Fint is typedef’d in both “mpi_fortdefs.h” and “mpio.h”. However, in my MPICH install it’s guarded by a define flag “NEEDS_MPI_FINT” in “mpio.h”. Either your install does not have this guard or “NEEDS_MPI_FINT” is defined in your mpicc script or another header file. If you can figure out why MPI_Fint is being typedef’d twice, you should be able to proceed.

I don’t know what version of MPICH your using, but if your so inclined, you can try building MPICH from scratch using the same source use use. We wrote a guide on building MPICH 1.2.7 which might be helpful. Of course, this should not be neccessary.

I hope this helps but since I can’t recreate your exact error it’s difficult to give anything but an educated guess as to the problem.

  • Mat

Hi,
Mat thank you for your help
Mat it impossible to follow your recommendation: to download the latest version of MM5, because I have to work with MM5-urbanized version. In this urbanized version there are some additional files and and there are some changes in programs. So if download the newest version of MM5 that means that I have rewrite the code, but I can do this . I have no idea how to solve this multiple definition problem
L/librsl.a -O2 -Mcray=pointer -Mnoframe -byteswapio -L/usr/local/topspin/mpi/mpich/lib64 -lfmpich -lmpich
transm_col.o(.text+0x0): In function transm_col_': : multiple definition of transm_col_’
transm_col.o(.text+0x0): first defined here
make[1]: [all] Error 2 (ignored)

but I hope that someone can guess how it can be fixed it

hris

Ok, let’s figure out where the second “transm_col_” definition is coming from. Run the following commands to determine which objects contain this definition:

foreach i ( `find ./ -name "*.o"` )
echo $i
nm $i | grep -i transm_col
end

My guess is that you have compiled physics/radiation/sfc/transm.F twice, once as transm.o and an second as transm_col.o, but used the define flag “-DMPP1_COLUMNWISE” in both cases. Transm has two interfaces, transm and transm_col, and the define flag chooses which one to use. If this is the case, then recompile transm.o without the define flag.

  • Mat

Mat, here is the result of

foreach i ( find ./ -name "*.o" )
echo $i
nm $i | grep -i transm_col
end

/MPP/RSL/RSL/set_padarea.o
./MPP/RSL/RSL/set_f_padarea.o
./MPP/RSL/RSL/domain_def.o
./MPP/RSL/RSL/mesh_topo.o
./MPP/RSL/RSL/decomp.o
./MPP/RSL/RSL/within_nest.o
./MPP/RSL/RSL/show_decomp.o
./MPP/RSL/RSL/rsl_nl.o
./MPP/RSL/RSL/rsl_new_decom.o
./MPP/RSL/RSL/rsl_malloc.o
./MPP/RSL/RSL/index.o
./MPP/RSL/RSL/border.o
./MPP/RSL/RSL/pt.o
./MPP/RSL/RSL/rsl_initial.o
./MPP/RSL/RSL/proc.o
./MPP/RSL/RSL/proc_f.o
./MPP/RSL/RSL/buf_for_proc.o
./MPP/RSL/RSL/comp_sten.o
./MPP/RSL/RSL/message_def.o
./MPP/RSL/RSL/stencil_def.o
./MPP/RSL/RSL/pack_message.o
./MPP/RSL/RSL/rsl_io.o
./MPP/RSL/RSL/exch_sten.o
./MPP/RSL/RSL/rsl_probe.o
./MPP/RSL/RSL/comp_cells_f.o
./MPP/RSL/RSL/comp_cells.o
./MPP/RSL/RSL/fort_realread.o
./MPP/RSL/RSL/fort_intread.o
./MPP/RSL/RSL/fort_complexread.o
./MPP/RSL/RSL/fort_characterread.o
./MPP/RSL/RSL/fort_close.o
./MPP/RSL/RSL/fort_realwrite.o
./MPP/RSL/RSL/fort_intwrite.o
./MPP/RSL/RSL/fort_complexwrite.o
./MPP/RSL/RSL/rsl_ioserve.o
./MPP/RSL/RSL/cd.o
./MPP/RSL/RSL/fort_characterwrite.o
./MPP/RSL/RSL/rsl_init_f.o
./MPP/RSL/RSL/rsl_mm_io.o
./MPP/RSL/RSL/handle_spec1.o
./MPP/RSL/RSL/handle_spec2.o
./MPP/RSL/RSL/rsl_funit_close.o
./MPP/RSL/RSL/rsl.o
./MPP/RSL/RSL/fort_bdyin_real.o
./MPP/RSL/RSL/xpose.o
./MPP/RSL/RSL/rsl_bcast.o
./MPP/RSL/RSL/rsl_merge.o
./MPP/RSL/RSL/rsl_order.o
./MPP/RSL/RSL/handle_spec3.o
./MPP/RSL/RSL/rsl_bcast_f.o
./MPP/RSL/RSL/rsl_merge_f.o
./MPP/RSL/RSL/rsl_move.o
./MPP/RSL/RSL/rsl_debug.o
./MPP/RSL/RSL/rsl_mon_bcast.o
./MPP/RSL/RSL/rsl_fopen_f.o
./MPP/RSL/RSL/rsl_socket.o
./MPP/RSL/RSL/debug.o
./MPP/RSL/RSL/rsl_fclose_f.o
./MPP/RSL/RSL/comp_slabs.o
./MPP/RSL/RSL/comp_slabs_f.o
./MPP/RSL/RSL/destroy_list.o
./MPP/RSL/RSL/comp_world.o
./MPP/RSL/RSL/rsl_child_info.o
./MPP/RSL/RSL/get_bdy_info.o
./MPP/RSL/RSL/patchmap.o
./MPP/RSL/RSL/default_decomposition.o
./MPP/RSL/RSL/rsl_remap_state.o
./MPP/RSL/RSL/boundary_safe.o
./MPP/RSL/RSL/period_def.o
./MPP/RSL/RSL/fill_boundary.o
./MPP/RSL/RSL/process_refs.o
./MPP/RSL/RSL/comp_xpose.o
./MPP/RSL/RSL/rsl_error_dup.o
./MPP/RSL/RSL/fort_bdyin_dbl.o
./MPP/RSL/RSL/xpose_def.o
./MPP/RSL/RSL/mpi_init_f.o
./MPP/RSL/RSL/vicopy.o
./MPP/RSL/RSL/fort_doubleread.o
./MPP/RSL/RSL/fort_doublewrite.o
./MPP/RSL/RSL/comp_period.o
./MPP/RSL/RSL/exch_period.o
./MPP/RSL/RSL/period_refs.o
./MPP/RSL/RSL/rsl_hemiforce.o
./MPP/RSL/RSL/rsl_mpi_compat.o
./MPP/build/acm.o
./MPP/build/addall.o
./MPP/build/addrx1c.o
./MPP/build/addrx1n.o
./MPP/build/after_surface.o
./MPP/build/after_urbsol.o
./MPP/build/bare.o
./MPP/build/before_surface.o
./MPP/build/before_urbsol.o
./MPP/build/bdyin.o
./MPP/build/bdyrst.o
./MPP/build/bdyten.o
./MPP/build/bdyval.o
./MPP/build/cadjmx.o
./MPP/build/cal_albedo.o
./MPP/build/coef_diffu.o
./MPP/build/coefcd2d.o
./MPP/build/coefcd3d.o
./MPP/build/condload.o
./MPP/build/consat.o
./MPP/build/convad.o
./MPP/build/couple.o
./MPP/build/date.o
./MPP/build/dcpl3d.o
./MPP/build/dcpl3dwnd.o
./MPP/build/decouple.o
./MPP/build/define_comms.o
./MPP/build/diffu.o
./MPP/build/dm_io.o
./MPP/build/dots.o
./MPP/build/dtfrz.o
./MPP/build/eddymm4.o
./MPP/build/fcqvsat.o
./MPP/build/fcqvsat_snow.o
./MPP/build/fillcrs.o
./MPP/build/fkill_model.o
./MPP/build/gamma.o
./MPP/build/gauss.o
./MPP/build/hadv.o
./MPP/build/init.o
./MPP/build/initsav.o
./MPP/build/initts.o
./MPP/build/kfbmdata.o
./MPP/build/kill_model.o
./MPP/build/lb_alg.o
./MPP/build/lbdyin.o
./MPP/build/mhz.o
./MPP/build/mm5.o
./MPP/build/mp_equate.o
./MPP/build/mp_initdomain.o
./MPP/build/mp_shemi.o
./MPP/build/mparrcopy.o
./MPP/build/mpaspect.o
./MPP/build/nconvp.o
./MPP/build/nudge.o
./MPP/build/output.o
./MPP/build/outsav.o
./MPP/build/outtap.o
./MPP/build/outts.o
./MPP/build/outts_c.o
./MPP/build/param.o
./MPP/build/paramr.o
./MPP/build/qflux.o
./MPP/build/radsfc.o
./MPP/build/rdinit.o
./MPP/build/savread.o
./MPP/build/settbl.o
./MPP/build/setvegfr.o
./MPP/build/sfcmm4.o
./MPP/build/sfcrad.o
./MPP/build/shutdo.o
./MPP/build/slab.o
./MPP/build/smass.o
./MPP/build/soilav.o
./MPP/build/solar1.o
./MPP/build/solve.o
./MPP/build/sound.o
./MPP/build/subch.o
./MPP/build/surface_soil.o
./MPP/build/trans.o
./MPP/build/transm.o
./MPP/build/upshot_mm5.o
./MPP/build/urbevapflx.o
./MPP/build/urbradnet.o
./MPP/build/urbsol.o
./MPP/build/vadv.o
./MPP/build/vdiff.o
./MPP/build/vecgath.o
./MPP/build/vegeland.o
./MPP/build/write_big_header.o
./MPP/build/write_fieldrec.o
./MPP/build/write_flag.o
./MPP/build/exmoisr.o
./MPP/build/exmoiss.o
./MPP/build/cup.o
./MPP/build/cupara3.o
./MPP/build/maximi.o
./MPP/build/minimi.o
./MPP/build/gspbl.o
./MPP/build/slab_col.o
./MPP/build/sfcrad_col.o
U transm_col_
./MPP/build/transm_col.o
0000000000000000 T transm_col_
./MPP/build/acm_col.o
./MPP/build/after_urbsol_col.o
./MPP/build/before_urbsol_col.o
./MPP/build/eddymm4_col.o
./MPP/build/radsfc_col.o
U transm_col_
./MPP/build/sfcmm4_col.o
./MPP/build/smass_col.o
./MPP/build/urbsol_col.o
./MPP/build/vdiff_col.o
./MPP/build/urbevapflx_col.o
./MPP/build/urbradnet_col.o
./MPP/build/cal_albedo_col.o
./MPP/build/coefcd2d_col.o
./MPP/build/coefcd3d_col.o
./MPP/build/lwrad.o
./MPP/build/swrad.o
./MPP/build/inirad.o
./MPP/build/o3data.o
./MPP/build/mm5atm.o
./MPP/build/rrtm.o
./MPP/build/rrtm_gasabs.o
./MPP/build/rrtm_init.o
./MPP/build/rrtm_k_g.o
./MPP/build/rrtm_rtrn.o
./MPP/build/rrtm_setcoef.o
./MPP/build/rrtm_taumol.o
./MPP/build/milliclock.o

Hmmm. Since it’s only defined once in the MPP objects, the second reference could be coming from a library. Use ‘nm’ and ‘grep’ again with the libraries to see if it’s coming from one of them.

Also, why don’t you try removing “transm_col.o” from the link.

  • Mat

Here is the result for the libraries

./MPP/FLIC/Parser/parselib.a
./MPP/FLIC/bin/parselib.a
./MPP/RSL/RSL/librsl.a

hris

Hi hris,

I’ve taken a second pass to try and recreate the error, but have been unable to do so. The linker is complaining that it has two objects that have the same symbol name and it doesn’t know which one to use. However, it appears that this symbol is defined only once in the objects you have listed. Can you double check using ‘nm’ and ‘grep’ that for all the objects and libraries listed on the link line, ‘transm_col’ only appears once? Perhaps an object not from the MPP directories is being linked in which contains the symbol?

The best way to fix this is to find the two objects that define ‘transm_col’. However, if you simply can’t figure it out, you can add the following flag “-Wl,–allow-multiple-definition” to the link line. This tells the linker to allow multiple definitions and will work around this error.

  • Mat

Mat, I recieved a recommendation how to fix this multiple definition problem ;

in IBM/MPP/mpp_objects_all
line 233 is
transm_col.o urbevapflx_col.o urbradnet_col.o cal_albedo_col.o


and it have to be
urbevapflx_col.o urbradnet_col.o cal_albedo_col.o \

but now another problems are appeared so I will try to fix by myself and if I fail I will ask you again

Thank you very much

hris