PDA

View Full Version : How to install GCC 4.2.1?



hello31415926
25th July 2007, 06:41 PM
Hi,

It seems that GCC 4.2.1 was just released on July 18, 2007. I tried "yum search gcc" but didn't find the latest version. Anyone knows when yum search will get updated?

Thanks
Roy

SlowJet
25th July 2007, 06:57 PM
4.2 is not in Fedora yet.
You would need to compile it from some src and then if you compiled Fedora src programs, you would need to correct any compile errors.

If you can do all that go join the devel team. :)

SJ

lazlow
25th July 2007, 08:01 PM
Hello

Is there some problem that you are having with the current F7 GCC? Most of the GCC updates effect only a very few individuals. SJ is right in that change GCC is a MAJOR PITA. something to be done only when absolutely required.

hello31415926
25th July 2007, 08:58 PM
My current gcc is 4.1.1 20070105. Seems that it does not support OpenMP. I heard that OpenMP is standard in the gcc 4.2 compiler. That is why I want to try gcc 4.2.

Thanks
Roy

lazlow
25th July 2007, 09:53 PM
From:
http://en.wikipedia.org/wiki/OpenMP


OpenMP has been implemented in many commercial compilers. For instance, Visual C++ 2005 supports it (in its Professional and Team System editions [1]), and so do the Intel compilers for their x86 and IPF product series. Sun Studio supports the latest OpenMP 2.5 specification with productivity enhancements for Solaris OS (UltraSPARC and x86/x64) and is planning similar support for the Linux platform in its next release.

GCC 4.2 supports OpenMP, and some distributions (such as Fedora Core 5 gcc) have support for OpenMP in their GCC 4.1 based compilers.

If it was in FC5 I doubt they have dropped it since.

You need libgomp installed.

This package contains GCC shared support library which is needed
for OpenMP 2.5 support.

phkahler
1st September 2007, 02:45 AM
I just updated to a AMD x2 and added a #omp parallel for in one of my programs. It didn't do anything. I'm running Fedora 7. The code is designed to run parallel - someone even tried it for me years ago on a 2 processor system. All the work is done in a function that take 2 extra parameters - total blocks and block number. Total blocks tells how many blocks to break the work into, while block number tells which piece to do on a given function call. I just put a loop around it to count to 4, and pass the loop variable as the block number and put 4 in for the total blocks. Hope that is clear enough.

Anyway, is just putting the single #pragma above the loop all that's required for openMP?
Has Fedora 7 retained the backport of opemMP that was allegedly in FC5? I see libgomp was installed by default.
What else might I need to do to make this work? Something in the makefile?

Thanks,
Paul

phkahler
1st September 2007, 08:45 PM
I just did the obvious and RTFM. If you want to use "#pragma parallel for" or any of the other OpenMP features in your software, you need to use the compiler switch -fopenmp. That makes the compiler pay attention to the pragmas. After that, you'll run into linking problems until you also link in GOMP via -lgomp. All this comes out of the box with Fedora 7, and now my code runs about twice as fast on the dual core as it does without using OpenMP.

If your code can be written with parallel loops in mind, or some of the other OpenMP constructs, this has got to be the simplest way to take advantage of multicore ever invented.

Thanks for supporting it Fedora!