Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29274 Discussions

Issues with implementing MPICH2 in IVF/MVS 2008

adamhoff
Beginner
1,097 Views
I've had some issues implementing MPICH2 in Intel Visual Fortran (11.1) using Microsoft Visual Studio (2008) on my Windows 7 x64 system.
I'm new to IVF and MSV, and that's likely the root cause of my problems.
From the MPICH readme, I am directed to:

Compiling an MPI program:

1) Create a project for Visual Studio 2003, or Intel Fortran 8.0

2) Add mpich2\\include to the include path

3) Add mpich2\\lib to the library path

4) For C applications add mpi.lib to your target link command.

5) For Fortran applications add fmpich2.lib to the link command.

6) Compile

I added the mpich2\\include path to the Fortran 'additional include directories' option and the mpich2\\lib path to the linker 'additional library directories' option. However, I'm not sure what 5) means.
In absence of completing this step, I get a series of unresolved external symbol linker errors. Can anyone shed any light on how to add this file to the link command?
Thanks
0 Kudos
9 Replies
TimP
Honored Contributor III
1,097 Views
VS2003 doesn't support ifort Intel64/X64, nor do I think it is intended to support Win7.
I don't know of anyone working with 32-bit MPICH2, certainly not on Win7 X64. It's difficult to guess what problems you would encounter with such a combination of no longer supported versions with up to date ones, but problems should not be a surprise.
By "implementing MPICH2" do you mean rebuilding it? An easier starting point would be to use the binary installer, along with a compatible combination of ifort and VS.
0 Kudos
adamhoff
Beginner
1,097 Views
To clarify:
I am using Visual Studio 2008, although the MPICH readme references VS 2003. I think this is just because VS 2003 was the latest MVS at the time the readme was written.
Second, I'm not sure what the correct terminology is, but I did use the binary MPICH installer, which created a MPICH directory with subdirectories: lib, include, bin. I have 'installed' MPICH, but I'd like to compile MPI fortran with IVF in MVS 2008. This is what I meant by 'implement'.
I have tried following the steps in the MPICH readme, although I am not sure I have understood them, particularly step 5. I believe the only 'problem' here is that I don't understand how to set this up. This post was seeking clarification.
0 Kudos
Steven_L_Intel1
Employee
1,097 Views
To accomplish step 5, select Project > Add to project > Files... Browse to the .lib and select it to add it to your project. This will cause it to be linked in.
0 Kudos
anishtain4
Beginner
1,097 Views
I have exactly the same problem. I think that the *.lib files don't need compilation right?
I added this file too but the problem is still the same. When I try to link the files I get all the same errors. I thought that maybe the library is wrong but for every library I added the problem sticks. What should I do? this problem is really wearing me out!
0 Kudos
Steven_L_Intel1
Employee
1,097 Views
If you get "all the same errors" then the libraries you're specifying don't have those symbols. Please provide a sample of some of the errors. Yes, if you add a .lib as a "source file" it does not get compiled, just linked.
0 Kudos
anishtain4
Beginner
1,097 Views
It returns error
LNKXXXX: unresolved external symbol _MPI_XXX referenced in function _MAIN_ file:XXX.obj
I think that it should knows the library because I get the following error too:
LNKXXXX: unresolved external symbol _MPI_XXX_FN file:XXX.obj
these routines are not being used inside the program at all.

I'm using MPICH2 and the library "fmpich2.lib". Directories of include and libraries are added too according to the readme file that is mentioned in first post. Don't know what is wrong?
0 Kudos
Steven_L_Intel1
Employee
1,097 Views
Is there some reason you replaced characters in the symbol name with XXX? When you hide information, you may also hide the key to the solution.

Since the missing symbols have a leading underscore, I assume you are building for 32 bits. Which MPICH2 download did you install? There are two, one for 32-bits and one for 64-bits. If you get the wrong one, you will see this error.
0 Kudos
anishtain4
Beginner
1,097 Views
yeah that was the problem. I'm such an idiot, a friend downloaded that on my computer and I just installed that.
that XXX was the MPI routines, since all of them were this kind I just replaced them.

I have written a pause inside the code and it works when I manually run the test.exe file of release folder. but when I run it with wmpiexec it does not. is that for MPI standard? or I'm doing something wrong?

thank you guys for the previous solution.
0 Kudos
Steven_L_Intel1
Employee
1,097 Views
What do you expect a PAUSE in an MPI program to do? That is outside the MPI specification and implies interaction with a user, which the MPI-run programs don't have.
0 Kudos
Reply