Opened 2 years ago

Closed 20 months ago

#180 closed Support (fixed)

Error in compiling MPI (instaling Flexpart-WRF)

Reported by: mhakimzadeh Owned by: pesei
Priority: major Milestone:
Component: FP other Version: FLEXPART-WRF
Keywords: Cc:

Description (last modified by pesei)

I am installing FLEXPART-WRF on intel compiler with mpich library, while I type make -f makefile.mom mpi, I get the following error:

echo 'Compiling MPI'
Compiling MPI
ifort -openmp  *.o -o flexwrf31_intel_mpi -L/home/maryam/net4/netcdf4/lib -mcmodel=medium -shared-intel -lnetcdff  -debug all -lpthread -L/lib -lmpi
flexwrf.o: In function `flexwrf':
/home/maryam/FPW/src_flexwrf_v3.1/flexwrf.f90:23: multiple definition of `MAIN__'
flexwrf_mpi.o:/home/maryam/FPW/src_flexwrf_v3.1/flexwrf_mpi.f90:23: first defined here
timemanager_serial.o: In function `timemanager':
/home/maryam/FPW/src_flexwrf_v3.1/timemanager_serial.f90:24: multiple definition of `timemanager_'
timemanager.o:/home/maryam/FPW/src_flexwrf_v3.1/timemanager.f90:24: first defined here
ld: cannot find -lmpi
make: *** [mpi] Error 1

Thanks in advance for your help,

Change History (4)

comment:1 Changed 2 years ago by pesei

  • Description modified (diff)

comment:2 follow-up: Changed 2 years ago by mhakimzadeh

I installed openmp library and I defined MPI_ROOT in makefile.mom as the adress of openmp library. By doing so, the error of ld: cannot find -lmpi is resolved. However, I faced a new error when I typed make -f makefile.mom mpi which is as below:

echo 'Compiling MPI'
Compiling MPI
ifort -openmp  *.o -o flexwrf31_intel_mpi -L/home/maryam/net4/netcdf4/lib -mcmodel=medium -shared-intel -lnetcdff  -debug all -lpthread -L/home/maryam/openmpfile/openmp/lib -lmpi
flexwrf.o: In function `flexwrf':
/home/maryam/FPW/src_flexwrf_v3.1/flexwrf.f90:23: multiple definition of `MAIN__'
flexwrf_mpi.o:/home/maryam/FPW/src_flexwrf_v3.1/flexwrf_mpi.f90:23: first defined here
timemanager_serial.o: In function `timemanager':
/home/maryam/FPW/src_flexwrf_v3.1/timemanager_serial.f90:24: multiple definition of `timemanager_'
timemanager.o:/home/maryam/FPW/src_flexwrf_v3.1/timemanager.f90:24: first defined here
flexwrf_mpi.o: In function `MAIN__':
flexwrf_mpi.f90:(.text+0xfd): undefined reference to `mpi_init_'
flexwrf_mpi.f90:(.text+0x128): undefined reference to `mpi_comm_rank_'
flexwrf_mpi.f90:(.text+0x153): undefined reference to `mpi_comm_size_'
flexwrf_mpi.f90:(.text+0xff0): undefined reference to `mpi_barrier_'
flexwrf_mpi.f90:(.text+0x1104): undefined reference to `mpi_finalize_'
senddouble_mpi.o: In function `senddouble_mpi':
/home/maryam/FPW/src_flexwrf_v3.1/senddouble_mpi.f90:46: undefined reference to `mpi_comm_rank_'
/home/maryam/FPW/src_flexwrf_v3.1/senddouble_mpi.f90:47: undefined reference to `mpi_comm_size_'
/home/maryam/FPW/src_flexwrf_v3.1/senddouble_mpi.f90:60: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/senddouble_mpi.f90:86: undefined reference to `mpi_recv_'
/home/maryam/FPW/src_flexwrf_v3.1/senddouble_mpi.f90:87: undefined reference to `mpi_recv_'
/home/maryam/FPW/src_flexwrf_v3.1/senddouble_mpi.f90:93: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/senddouble_mpi.f90:94: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/senddouble_mpi.f90:99: undefined reference to `mpi_recv_'
senddrydep_mpi.o: In function `senddrydep_mpi':
/home/maryam/FPW/src_flexwrf_v3.1/senddrydep_mpi.f90:46: undefined reference to `mpi_comm_rank_'
/home/maryam/FPW/src_flexwrf_v3.1/senddrydep_mpi.f90:47: undefined reference to `mpi_comm_size_'
/home/maryam/FPW/src_flexwrf_v3.1/senddrydep_mpi.f90:58: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/senddrydep_mpi.f90:62: undefined reference to `mpi_recv_'
senddrydep_nest_mpi.o: In function `senddrydep_nest_mpi':
/home/maryam/FPW/src_flexwrf_v3.1/senddrydep_nest_mpi.f90:46: undefined reference to `mpi_comm_rank_'
/home/maryam/FPW/src_flexwrf_v3.1/senddrydep_nest_mpi.f90:47: undefined reference to `mpi_comm_size_'
/home/maryam/FPW/src_flexwrf_v3.1/senddrydep_nest_mpi.f90:58: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/senddrydep_nest_mpi.f90:62: undefined reference to `mpi_recv_'
sendint2_mpi.o: In function `sendint2_mpi':
/home/maryam/FPW/src_flexwrf_v3.1/sendint2_mpi.f90:45: undefined reference to `mpi_comm_rank_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint2_mpi.f90:46: undefined reference to `mpi_comm_size_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint2_mpi.f90:58: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint2_mpi.f90:79: undefined reference to `mpi_recv_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint2_mpi.f90:84: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint2_mpi.f90:88: undefined reference to `mpi_recv_'
sendint_mpi.o: In function `sendint_mpi':
/home/maryam/FPW/src_flexwrf_v3.1/sendint_mpi.f90:43: undefined reference to `mpi_comm_rank_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint_mpi.f90:44: undefined reference to `mpi_comm_size_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint_mpi.f90:61: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint_mpi.f90:105: undefined reference to `mpi_recv_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint_mpi.f90:106: undefined reference to `mpi_recv_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint_mpi.f90:107: undefined reference to `mpi_recv_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint_mpi.f90:108: undefined reference to `mpi_recv_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint_mpi.f90:109: undefined reference to `mpi_recv_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint_mpi.f90:114: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint_mpi.f90:115: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint_mpi.f90:116: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint_mpi.f90:117: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint_mpi.f90:118: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/sendint_mpi.f90:123: undefined reference to `mpi_recv_'
sendreal2d_mpi.o: In function `sendreal2d_mpi':
/home/maryam/FPW/src_flexwrf_v3.1/sendreal2d_mpi.f90:45: undefined reference to `mpi_comm_rank_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal2d_mpi.f90:46: undefined reference to `mpi_comm_size_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal2d_mpi.f90:62: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal2d_mpi.f90:80: undefined reference to `mpi_recv_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal2d_mpi.f90:87: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal2d_mpi.f90:91: undefined reference to `mpi_recv_'
sendreal_mpi.o: In function `sendreal_mpi':
/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:43: undefined reference to `mpi_comm_rank_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:44: undefined reference to `mpi_comm_size_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:67: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:127: undefined reference to `mpi_recv_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:128: undefined reference to `mpi_recv_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:129: undefined reference to `mpi_recv_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:130: undefined reference to `mpi_recv_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:131: undefined reference to `mpi_recv_'
sendreal_mpi.o:/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:132: more undefined references to `mpi_recv_' follow
sendreal_mpi.o: In function `sendreal_mpi':
/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:140: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:141: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:142: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:143: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:144: undefined reference to `mpi_send_'
sendreal_mpi.o:/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:145: more undefined references to `mpi_send_' follow
sendreal_mpi.o: In function `sendreal_mpi':
/home/maryam/FPW/src_flexwrf_v3.1/sendreal_mpi.f90:151: undefined reference to `mpi_recv_'
timemanager_mpi.o: In function `timemanager_mpi':
/home/maryam/FPW/src_flexwrf_v3.1/timemanager_mpi.f90:165: undefined reference to `mpi_comm_rank_'
/home/maryam/FPW/src_flexwrf_v3.1/timemanager_mpi.f90:166: undefined reference to `mpi_comm_size_'
/home/maryam/FPW/src_flexwrf_v3.1/timemanager_mpi.f90:543: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/timemanager_mpi.f90:544: undefined reference to `mpi_send_'
/home/maryam/FPW/src_flexwrf_v3.1/timemanager_mpi.f90:547: undefined reference to `mpi_recv_'
/home/maryam/FPW/src_flexwrf_v3.1/timemanager_mpi.f90:548: undefined reference to `mpi_recv_'
/home/maryam/FPW/src_flexwrf_v3.1/timemanager_mpi.f90:556: undefined reference to `mpi_barrier_'
/home/maryam/FPW/src_flexwrf_v3.1/timemanager_mpi.f90:991: undefined reference to `mpi_barrier_'
/home/maryam/FPW/src_flexwrf_v3.1/timemanager_mpi.f90:1083: undefined reference to `mpi_barrier_'
make: *** [mpi] Error 1

Thanks again for your kind help,

P.S: My FLEXPART-WRF version is 3.1.

Last edited 2 years ago by pesei (previous) (diff)

comment:3 in reply to: ↑ 2 Changed 2 years ago by pesei

  • Owner set to pesei
  • Status changed from new to accepted
  • Type changed from Defect to Support

Replying to mhakimzadeh:

echo 'Compiling MPI'
Compiling MPI
ifort -openmp  *.o -o flexwrf31_intel_mpi -L/home/maryam/net4/netcdf4/lib -mcmodel=medium -shared-intel -lnetcdff  -debug all -lpthread -L/home/maryam/openmpfile/openmp/lib -lmpi

}}}

So here you see that you are linking all *.o files in your working directory.

> flexwrf.o: In function `flexwrf':
> /home/maryam/FPW/src_flexwrf_v3.1/flexwrf.f90:23: multiple definition of `MAIN__'
> flexwrf_mpi.o:/home/maryam/FPW/src_flexwrf_v3.1/flexwrf_mpi.f90:23: first defined here
> timemanager_serial.o: In function `timemanager':
> /home/maryam/FPW/src_flexwrf_v3.1/timemanager_serial.f90:24: multiple definition of `timemanager_'
> timemanager.o:/home/maryam/FPW/src_flexwrf_v3.1/timemanager.f90:24: first defined here

This tells you that both the main programme and the subroutine timemanager are multiply defined, in different source (or object) files, e.g. flexwrf.o flexwrf_mpi.o. So you have make sure that you have only one set of object files, either for scalar code, or for mpi. Delete all other *.o files!

> flexwrf_mpi.o: In function `MAIN__':
> flexwrf_mpi.f90:(.text+0xfd): undefined reference to `mpi_init_'
etc.

Obviously your mpi library is still not found. Check the paths in your makefile!

comment:4 Changed 20 months ago by pesei

  • Resolution set to fixed
  • Status changed from accepted to closed

As we have not heard anything since 6 months, I assume that this is solved.

Note: See TracTickets for help on using tickets.
hosted by ZAMG