PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Problem compiling distributed memory code (MPI-MPICH)

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
AZaldei



Joined: 22 Apr 2013
Posts: 9

PostPosted: Wed May 22, 2013 1:09 am    Post subject: Problem compiling distributed memory code (MPI-MPICH) Reply with quote

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
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6129
Location: The Portland Group Inc.

PostPosted: Wed May 22, 2013 9:45 am    Post subject: Reply with quote

Hi AZaldei,

Quote:
What is -lmpi?
"-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
View user's profile
AZaldei



Joined: 22 Apr 2013
Posts: 9

PostPosted: Thu May 23, 2013 10:26 am    Post subject: Reply with quote

Thanks, Mat that was very helpful!

I was able to solve the problem following your suggestions!
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group