[MITgcm-support] Problem with MPI (cannot find -lmpi)

Martin Losch Martin.Losch at awi.de
Mon Feb 9 03:51:26 EST 2009


Hi Abbas,

I am not quite clear about when you get this error, and what compiler  
you use (probably g77?), but I would suggest that remove the -lmpi  
from this line:
>> LIBS='-L/usr/local/netcdf4/lib -L/usr/local/lib -lmpi'
because your mpif77 should take care of which library to link. Also  
you probably need to include a path to the MPICH2 header files in  
INCLUDES (unless they are in /usr/local/include which is in your  
path), because the MITgcm does not use mpif77 to preprocess the code.

Unrelated: your genmake2 output suggests that you cannot build  
executables with netcdf librabries. If you care about netcdf, have a  
look at genmake_warnings for further error messages; probably your  
paths to netcdf are not correct, or the libraries are compiled with a  
different compiler and the namemangling goes wrong ...

Martin

On Feb 6, 2009, at 11:24 PM, Abbas Dorostkar wrote:

> Dear all,
> I try to compile MITgcm with –mpi option on my Opteron machine with  
> RedHat Linux. The MPI environment (MPICH2) is tested by a simple  
> "hello world" program. However, I get this error message:
>
> -L/usr/local/netcdf4/lib -L/usr/local/lib -lmpi
> /usr/bin/ld: cannot find -lmpi
> collect2: ld returned 1 exit status
> make: *** [mitgcmuv] Error 1
>
> ===  Checking system libraries  ===
>   Do we have the system() command using /usr/local/bin/mpif77...  yes
>   Do we have the fdate() command using /usr/local/bin/mpif77...  yes
>   Do we have the etime() command using /usr/local/bin/mpif77...  yes
>   Can we call simple C routines (here, "cloc()") using /usr/local/ 
> bin/mpif77...  yes
>   Can we unlimit the stack size using /usr/local/bin/mpif77...  yes
>   Can we register a signal handler using /usr/local/bin/mpif77...  yes
>   Can we use stat() through C calls...  yes
>   Can we create NetCDF-enabled binaries...  no
>
> The opt file I use is as follows:
>
> #!/bin/bash
> #
> FC='/usr/local/bin/mpif77'
> CC='/usr/local/bin/mpicc'
> DEFINES='-DALLOW_USE_MPI -DALWAYS_USE_MPI -D_BYTESWAPIO - 
> DWORDLENGTH=4'
> LIBS='-L/usr/local/netcdf4/lib -L/usr/local/lib -lmpi'
> INCLUDES='-I/usr/local/netcdf4/include -I/usr/local/include'
> CPP='/usr/bin/cpp -traditional -P'
> NOOPTFLAGS='-O0'
> #MAKEDEPEND=/usr/X11R6/bin/gccmakedep
> #MAKEDEPEND=/usr/X11R6/bin/makedepend
> #  For IEEE, use the "-ffloat-store" option
> if test "x$IEEE" = x ; then
>     FFLAGS='-Wimplicit -Wunused -Wuninitialized'
>     FOPTIM='-O3 -funroll-loops'
> else
>     FFLAGS='-Wimplicit -Wunused -ffloat-store'
>     FOPTIM='-O0 '
> fi
>
> I am not sure If something is wrong with my opfile. It would be  
> great If I could have your ideas.
> Thanks very much
> Abbas
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support





More information about the MITgcm-support mailing list