Solving OpenMPI Problems on Windows

  • Thread starter FunkyDwarf
  • Start date
  • Tags
    Windows
In summary, the problem is that mpicc is not finding the required libraries and Visual Studio doesn't seem to be able to help because the paths are incorrect.
  • #1
FunkyDwarf
489
0
Hey gang,

I'm trying to get started with OpenMPI on my windows machine (crazy/stupid I know, one day I will man up and dual boot linux) but I'm running into a few problems.

I can get mpiexec to work fine to run jobs, i.e. examples that come with various installs, but mpicc doesn't seem to want to work.

Specifically, it doesn't seem to find basic libraries used by mpi.h. I get errors like:

fatal error c1083: Cannot open include file: 'stdio.h' no such file or directory.

I have MingW installed for gcc/g++ and they work fine. My environment variable paths are as follows:

C:\OpenMPI\bin;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin;C:\MinGW\bin;

The only reason Visual studio is there is for cl.exe which is apparently needed by MPI. The IDE path is there for some .dll.

Am I doing something stupid (apart from using windows to code on) or missing something obvious?

Thanks!

EDIT:
I tried including
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include
to the path as well and now it can't find stddef.h even though it resides in this folder as well :\
 
Technology news on Phys.org
  • #2
Hey FunkyDwarf.

I have a few suggestions.

The first relates to the order of included directories in Visual C++ IDE. Sometimes if they are in the wrong order, weird errors happen and it's mainly got to do with when you have different include file specifications.

The second relates to the nature of the actual include directories themselves. If they are like say http://blogs.msdn.com/b/vsproject/archive/2009/07/07/vc-directories.aspx (scroll down to include screen shot), then you will have more directories to include than the one you mentioned above.

The other thing relates to versions of include files and what comes with each compiler (in this case the VC++ one as part of of the Visual Studio Suite). In this case, wrong versions will tend to create lots of errors.
 
  • #3
Hi chrio,

Thanks for the reply. Just to qualify your statement, do you mean the order of Visual C++ stuff in that program, or in the path I listed?

I'm not actually using VC, I only installed it for the cl.exe file. I'm trying to run everything from command line and I use a different IDE for the programming itself.

I tried seeing if there is a way to do all of this without VC but I'm yet to find one, is it possible?
 
  • #4
FunkyDwarf said:
Hi chrio,

Thanks for the reply. Just to qualify your statement, do you mean the order of Visual C++ stuff in that program, or in the path I listed?

I'm not actually using VC, I only installed it for the cl.exe file. I'm trying to run everything from command line and I use a different IDE for the programming itself.

I tried seeing if there is a way to do all of this without VC but I'm yet to find one, is it possible?

One thing that you can do is to use a program that converts the argument list given to cl.exe to an argument list used for say the GNU C (or C++ depending the code) compiler and then simply call the other compiler to compile the code.

If for some reason though the DLL uses some kind of specialized Microsoft functionality (like a .NET, COM, MFC, whatever type structure/interface) then you will need to use the Microsoft Compiler.

For the path information, if you are passing path information to cl.exe then yes it is this order that I'm referring to and the order is important especially if you are using different code-repositories with different versions, or different meanings. For example, if you've ever done windows programming, you may have realized that when you include "windows.h", you are including a plethora of definitions of all kinds and including stuff at the wrong time will give you a tonne of compiler errors associated with redefinitions and other messages that fill the error window in a few seconds (or less).

So if you give a path, pass this to cl.exe in the right order and make sure that the list is also complete.

The other thing is stddef.h is actually synonymous with an application header and not necessarily a standard library or SDK header (it may be, but I do know that certain IDE's set this up to put all the standard application definitions in one place), so you should also make sure if you have special SDK include files, that this directory is referenced before every other include directory.
 
  • #5


Hi there,

It sounds like you are on the right track with installing OpenMPI on your Windows machine. However, it seems like you may be missing some important dependencies for the mpicc command to work properly.

One thing to check is if you have the Microsoft Visual C++ compiler installed. This is different from the Visual Studio IDE and is necessary for compiling C code on Windows. You can download it from Microsoft's website.

Another thing to check is if you have all the necessary libraries and headers installed for your MinGW installation. It's possible that some of these are missing or not configured properly, which could be causing the errors you are seeing.

Lastly, make sure that all of your environment variables are set correctly and that the paths are pointing to the correct locations. It's possible that there may be a typo or a missing directory in one of the paths, which could be causing issues.

I hope this helps and good luck with your OpenMPI setup!
 

FAQ: Solving OpenMPI Problems on Windows

How do I install OpenMPI on Windows?

To install OpenMPI on Windows, you can follow these steps:

  • Download the Windows installer for OpenMPI from the official website.
  • Run the installer and follow the prompts to complete the installation.
  • Make sure to select the appropriate options for your system, such as the compiler and architecture.
  • Once the installation is complete, you can test it by running a sample MPI program.

Why am I getting errors when trying to compile my MPI program on Windows?

There could be several reasons for this. One common issue is that the compiler is not properly configured to work with OpenMPI. Make sure you have selected the correct compiler during the installation process. Another possibility is that the necessary libraries are not linked correctly. Check your compilation settings and make sure the OpenMPI libraries are included.

How do I set up a cluster of Windows machines for OpenMPI?

To set up a cluster for OpenMPI on Windows, you will need to follow these steps:

  • Install OpenMPI on each of the machines in the cluster.
  • Make sure all machines are connected to the same network and can communicate with each other.
  • Set up a shared file system or network file system to enable communication between the nodes.
  • Configure the hosts file on each machine to include the IP addresses and hostnames of all other machines in the cluster.
  • Test the cluster by running a sample MPI program.

How do I troubleshoot common errors with OpenMPI on Windows?

If you encounter errors while using OpenMPI on Windows, here are some steps you can take to troubleshoot the issue:

  • Check the OpenMPI documentation for common errors and their solutions.
  • Make sure all necessary libraries are linked correctly and the paths are set up properly.
  • Check for any conflicting libraries or dependencies that may be causing the error.
  • Try running the program on a different machine to see if the error persists.
  • If all else fails, try reinstalling OpenMPI and make sure to carefully follow the installation instructions.

Can I use OpenMPI with other programming languages on Windows?

Yes, OpenMPI can be used with other programming languages on Windows, including C++, Fortran, and Python. However, some additional steps may be required to set up the environment and ensure compatibility. Make sure to refer to the documentation and resources specific to your chosen language for more information.

Similar threads

Back
Top