In July 2007 gnu releases itslatest version of gcc (4.2.1 ). This release includes some of the bug fixes as usual – but the most significant part of it is that gcc is now openMP compatible. openMP though the name sounds like a standard open source software it was not really open. The standard was devised in Silliocon Graphics and many vendors including Intel and Microsoft was shipping with their propriority dev tools. openMP is now a standard for writing parallel programs that takes advantage of computing power of multiple processors or multicore processors. As the multicore processors become cheaper the parallel programming paradigm gains its popularity and reaches out to more people. But the hurdle was that it was not available freely – intel and microsoft was selling their compiler at a price that is more than the multicore processors itself. Finally it was released under GPL this july.
So I am happy.. I did a few stuff long back on openMP in my college on an intel compiler I guess. I am evaluating the version of openMP ( GOMP) with gcc 4.2.1 .. I think this link will be simple enough if you want to start programming in openMP.
Let me write you the first few steps to run your first program in gcc as well.
1. Download gcc 4.2.1 (aprox 50 MB) from this mirror
2. You need to have gcc 3.x in your box prior to compile gcc 4.2.1
3. Unzip the package using bunzip if the extension is *.bz or by bunzip2 if its *.bz2
4. Untar it usinf tar -xf [gcc-4.2.1].tar
5. then run ./configure –enable-languages=c,c++ ( i use C/C++ so …)
6. make and then make DESTDIR=[install dir] install
7. all the above process will take 30mins – 2hrs depending on the CPU you have
8. change your PATH to point to DESTDIR/usr/local/bin
9. change your LD_LIBRARY_PATH to point to DESTDIR/usr/local/lib
10. Now try gcc –version . It should give you the vesrion as 4.2.1
11. You can compile your program using g++/gcc as
g++ -otest -g -fopenmp insort.cpp
12. Run ./test
You will find some sample simple program in the tutorial i have mentioned. For some advanced issues like handling recursion and busy waits etc you may refer to this.
Happy programming .. You may leave your comments if you find trouble in some case .. I would happy to help..
Comments