[mpich-discuss] C++ for Visual studio code
Jayesh Krishna
jayesh at mcs.anl.gov
Mon Aug 4 10:14:09 CDT 2008
Hi,
Since your MPI program requires MPICH2 (an "Additional" lib apart from
the libs provided with VS) you need to specify the paths for the header
files ("Additional Include directories") and the library files
("Additional library directories") when compiling your program. In the
project properties, look for the "C/C++ --> General" settings to set the
path for include directories and "Linker-->General" settings to set the
path for MPICH2 libs. After setting the path correctly specify the MPICH2
libs (cxx.lib & mpi.lib for C++ programs) in the "Additional dependencies"
section (Look for "Linker-->Input") of the project properties.
Note that the MPI include files are provided in
<INSTALL-PATH>\MPICH2\include & the libs are provided in
<INSTALL-PATH>\MPICH2\lib (where <INSTALL-PATH> is your install directory
--- Usually the paths are "C:\program files\MPICH2\include" & "C:\program
files\MPICH2\lib").
Let us know if you need any further help.
(PS: Since Visual Studio C++ runtime libs are not backward compatible we
recommend users to use VS 2005 to compile their C++ MPI programs with the
latest version of MPICH2 libs.)
Regards,
Jayesh
_____
From: owner-mpich-discuss at mcs.anl.gov
[mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of Gholamreza
Sobhaninejad
Sent: Sunday, August 03, 2008 7:48 PM
To: mpich-discuss at mcs.anl.gov
Subject: Re: [mpich-discuss] C++ for Visual studio code
Hi rebecca,
I was using vs 2005 and vs 2008. But since there are some inconsistencies
between VS compilers and Linux based compilers, I am not using VS for
programming.
I wanna suggest you if you are going to use clusters which use Linux OP
just move to Netbeans or Eclipse IDEs and compile your code with GNU or
Intel compileres.
Anyway, as I see you are in correct tab but please have a look in
Input,System and Advanced section too. It should be somewhere there.
Additional libraries directory should be set to MPI->LIB directory. But
still you need to link mpichxx and mpich to your code.
Please don't hesitate to ask question.
Sincerely,
Reza
On Mon, Aug 4, 2008 at 9:18 AM, Rebecca <rebeccakern at sbcglobal.net> wrote:
Thank you for responding Reza! I am having trouble seeing the additional
dependencies in VS .NET 2003. What version of VS do you use?
_____
From: owner-mpich-discuss at mcs.anl.gov
[mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of Gholamreza
Sobhaninejad
Sent: Saturday, August 02, 2008 9:18 PM
To: mpich-discuss at mcs.anl.gov
Subject: Re: [mpich-discuss] C++ for Visual studio code
Hi Rebecca,
When you use MPICH with C++ , you need to link "mpicxx" and "mpich"
libraries. you can determine this two file in project properties/
Linker/Additional Dependencies.
Reza
On Sun, Aug 3, 2008 at 8:13 AM, Rebecca <rebeccakern at sbcglobal.net> wrote:
I am having trouble accessing the MPI.h library from C++ in Visual Studio.
I am getting an unresolved external symbol for MPI::Init() and if I try to
use MPI_Init() the code ends unexpectedly. I am able to use MPI_Init() in
c without any problem. Does anyone have sample code I could see with C++?
--
Gholamreza Sobhaninejad(Reza)
PhD candidate, University of Tokyo
Earthquake Research Institute
Tel: 090-9807-2477
--
Gholamreza Sobhaninejad(Reza)
PhD candidate, University of Tokyo
Earthquake Research Institute
Tel: 090-9807-2477
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20080804/8a71c8ff/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 51576 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20080804/8a71c8ff/attachment.jpeg>
More information about the mpich-discuss
mailing list