Opened 7 years ago
Closed 7 years 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 7 years ago by pesei
- Description modified (diff)
comment:2 follow-up: ↓ 3 Changed 7 years ago by mhakimzadeh
comment:3 in reply to: ↑ 2 Changed 7 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 7 years 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.
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:
Thanks again for your kind help,
P.S: My FLEXPART-WRF version is 3.1.