Friday, 29 January 2016

openMP

It is a pain that each and every library has to downloaded and installed and configured but it is a necessary evil in most cases. If we had each and every tool in our computer then we would have no space and our systems would be slow as there are other tools which we don't know about. For those who are using:

  • Windows 
If an Intel compiler is already present in Windows, simply launch the software development environment (Intel parallel studio XE) and you will get a command prompt. Next  type icl /QopenMP c_code.cpp.
The standard compiler for Windows comes from Microsoft Visual C/C++ compiler from Visual Studio. Unfortunately its OpenMP support is a bit outdated. To use it simply Start a project in Visual studio.
  1. Start a new Project
  2. Select a Win 32 console project
  3.  Set name and path
  4. Select an empty project in the next panel
  5. Drag and drop source file into solution explorer
Next to run openMP
  1. Goto Project properties -->configuration properties/C.C++/language
  2. Activate the openMP tab
Check out the link
  • Linux 
To install and try out openMP (if you have the gcc compiler already) you have to do ....nothing
If you are using gcc as the compiler then you have done it already. All there is to do is create a c/c++ code and while compiling the program simply use the following statement
   gcc    -fopenmp   c_code.cpp   -o  c_obj

where c_code.cpp is the source code and c_obj is the object /exe file to run

No comments:

Post a Comment