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
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.
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.
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
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.
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.
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:
Unpacked the two packages. MM5 first, then unpacked MPP within the new MM5 directory.
Uncommented section 7g in the “configure.users” file.
Changed the “LINUX_MPIHOME” to the base directory of our MPICH installation. In our case this is /usr/pgi/linux86-64/6.1-1.
Added “CC = pgcc” so “parseconfig” is built correctly.
Added “-I/path/to/MM5/include” to the FCFLAGS. This is used to find “parame.incl”.
Added “-DDEC_ALPHA” to FCFLAGS. This is needed to run MM5 correctly in 64-bit mode.
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.
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.
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
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.
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.
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.