[MPICH] mixing MPI with other libraries

James S Perrin james.s.perrin at manchester.ac.uk
Mon Jun 27 08:35:22 CDT 2005


Hi,
	mpicc and mpicxx are scripts that simple add the correct include path, and 
library path and libraries if linking, to the compile command. It will call the 
default C or C++ compiler with the added arguments. You don't need to added any 
mpich specific paths/libs yourself. So you can use the scripts to compile and 
standard projects.

	Since mpicxx doesn't actaul compile you code but the default compiler, say g++, 
thst will respond to compiling c code in exactly the same way as the it would if 
called directly. Further mpicxx simply passes the mpich cxx library as and 
additional argument. If you have used any C++ MPI calls then it will be ignored 
(you may get a "not used for linked warning")

Regards
James

Kevin C. wrote:


> 1. If one had an existing project, say a GTK or QT application with 
> Makefile and everything. If one wanted to incorporate MPI into this 
> project, one would just replace (in the Makefile) the 'GCC = gcc' to 
> 'GCC = mpicc', 'GXX = g++' to 'GXX = mpicxx', and also maybe include 
> some MPI lib paths to the INCPATHs? Is this how one can convert normal 
> projects into projects incorporating MPI calls?
> 
> 2. If one had an existing C MPI program. What would be the side-effects 
> of using the mpicxx to compile C code? Is it strict for one to use the 
> MPI:: classes opposed to MPI_ C functions.. when force compiling under C++?
-- 
-----------------------------------------------------------------------------
James S. Perrin,                   | email: james.perrin at manchester.ac.uk
Manchester Visualization Centre,   | www.sve.man.ac.uk/General/Staff/perrin
Kilburn Building, The University,  | tel: +44 161 275 6945
Manchester, England. M13 9PL.      | fax: +44 161 275 6800/6040
-----------------------------------------------------------------------------
"The test of intellect is the refusal to belabour the obvious" -Alfred Bester
-----------------------------------------------------------------------------




More information about the mpich-discuss mailing list