| View previous topic :: View next topic |
| Author |
Message |
AZaldei
Joined: 22 Apr 2013 Posts: 9
|
Posted: Wed May 22, 2013 1:09 am Post subject: Problem compiling distributed memory code (MPI-MPICH) |
|
|
Hi everybody!
I'm trying to compile the model WRF-CHEM model using the PGI compiler and the dmpar option (i.e.: distributed memory option using mpich). I've already installed MPICH following the PGI tutorial, and set the environmental variable MPI_ROOT pointing to the MPICH installation directory.
The problem is that the software does not compile correctly complaining that:
| Code: | pgf90 -w -Mfree -byteswapio -c -I/home/modelstation/pgnetcdf/include -I../ioapi_share diffwrf.f
diffwrf io_netcdf is being built now.
/usr/bin/ld: cannot find -lmpi
make[2]: [diffwrf] Error 2 (ignored) |
What is -lmpi? is it a compiler flag? A header to include? In the MPICH folder I cannot find any file with that string in the name.
Sorry for the probably stupid question, I'm quite new at parallel computing.
Thanks in advance for all your help! |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4995 Location: The Portland Group Inc.
|
Posted: Wed May 22, 2013 9:45 am Post subject: |
|
|
Hi AZaldei,
"-l<name>" is a compiler/linker flag stating the "libname.a" library should be linked with the user's compiled code.
| Quote: | | /usr/bin/ld: cannot find -lmpi | The linker can find where "libmpi.a" is located. You're options are to use the "-L<libdir>" to tell the linker the directory where this library is located, or use the "mpif90" driver instead of "pgf90". "mpif90" is a wrapper which will automatically add the necessary MPI libraries.
If you are using the prebuilt MPICH libraries that we ship with the compilers, a third option would be to add the "-Mmpi=mpich" flag. This flag will set the appropriate "-L" and "-l" linker flags.
Hope this helps,
Mat |
|
| Back to top |
|
 |
AZaldei
Joined: 22 Apr 2013 Posts: 9
|
Posted: Thu May 23, 2013 10:26 am Post subject: |
|
|
Thanks, Mat that was very helpful!
I was able to solve the problem following your suggestions! |
|
| Back to top |
|
 |
|