-1

I am trying to run a MPI program with C language. I have installed GCC compiler and the openmpi libraries. I am running ubuntu Linux and Netbeans IDE. My challenge is that after including ‘mpi.h’ in my header file and compiling the application, I still get ‘fatal error : cannot find file mpi.c’. I have the files in home/user/lib/openmpi/include, but I cant get it too work.

Can anyone help?

Ryan M
  • 269
  • 2
  • 11
shubie
  • 91
  • 2
  • 2
  • `mpi.c`, what's that? Better show actual compile output, and show how the project is set up... What does it use as build system, ant or make or what? – hyde Jan 21 '13 at 17:23

2 Answers2

0

You could try to change the compiler to /path/mpicc and the debugger to mpirun. This should work, although I did not test it, but probably the best way to compile MPI code is via terminal.

If you really depend on the IDE you cound try writing your code with it (to take advantage of auto-completion and such) and compile it in terminal using mpicc -o main.exe main.cpp [other .cpp files] and run it with mpirun -np number_of_processes_to_use ./main.exe [args]. You could write a small script or a Makefile to do it all in one command.

Good luck!

cpp_ninja
  • 337
  • 2
  • 5
  • 15
0

to save yourself some sanity, I'd recommend opening up a terminal and going from there (at least until you figure out what's what).

Also, using the mpi compiler to do things would simplify your life. (and likely automatically solve the missing source issue, as it should know where they are by default).

If you still can't locate them during compile then I'd look at adding the location where mpi.c & mpi.h are located to your C Include Path: How to add a default include path for gcc in linux?

Community
  • 1
  • 1
CasualT
  • 4,869
  • 1
  • 31
  • 53
  • If you are running things on a shared system (eg. super computer...because why else would you be running mpi :P), then the steps are potentially a little more involved. Depending on your environment I might be able to help you out a bit more, so comment if you are still stuck. :) – CasualT Jan 21 '13 at 22:15