Setting Code Block to run MPICH2

Shahril Abu Bakar picture Shahril Abu Bakar · Feb 28, 2011 · Viewed 9.6k times · Source

Greeting Everyone!

I am a student and currently I got problem in setting Code Block. Can anyone help me or guide me how to configure Code Block so it can run MPI?

I already install Code Block and MPICH2.

But when I trying to compile the code, it does not work. Code block doesn't detect MPI.

Anyone can show to me step by step to configure it. Really Appreciate it :)

Answer

osgx picture osgx · Mar 2, 2011

I assume you are asking about Code::Blocks IDE.

I think, you should modify your IDE and project settings and switch from default GCC compiler setup to MPI one.

First your should to clone GCC Compiler Setup in IDE Settings (menu "Settings" -> "Compiler and debugger"). http://www.codeblocks.org/docs/main_codeblocks_en3.html#x3-270001.11.6 You must clone the some complier settings (I recommend to copy a default "GNU GCC Compiler"), then you can change new settings set on the tab "Toolchain executables" -- replace the gcc and g++ by mpicc and mpicxx.

Second step is to change your MPI project build settings to use new compiler settings.

This will allow you to build MPI applications with Code::Blocks IDE.

To run them you can use the command line, and to debug them... debugging of MPI is not so easy...