Hacker News new | ask | show | jobs
Building gcc-4.7 on Ubuntu 12.04 (solarianprogrammer.com)
8 points by RSeldon 5171 days ago
3 comments

For those who are building gcc-4.7 from scratch, the cilk/ branch sure looks interesting. It has the Cilk runtime and the cilk extensions to the language built in.

http://en.wikipedia.org/wiki/Cilk http://software.intel.com/en-us/articles/intel-cilk-plus/

As far as language extensions go, it may seem that Cilk does not add much, but to me the advantage of not manually assigning tasks to threads and work stealing seems like a big win.

Looking forward to try it out in a week. Stoked.

Well, C++11 has native threads now and OpenMP looks like a good alternative to Cilk.

Any performance reason for which one would prefer Cilk vs OpenMP ?

Not to be facetious but, one is C the other is C++ and on occaisons it does matter a lot.

OpenMP is good for Fortran style code, where you decorate loops, although I havent looked at the latest OpenMP standards. But on its own C++11 looks very good. I will (and I do) use it where I have uses of C++ template mechanism. But now I am porting some that stuff to D. Generics is so much less verbose and nicer over all.

Though I love the support for type inference in C++11, it does not play well with expression templates, which is my go to reason to turn to C++ in the first place (perhaps the only one prior to C++11).

I know there is a big difference between modern C++11 and C.

C11 has standard threads similarly with what you find in C++11, unfortunately you won't find this implemented by all vendors. I hope to see complete support for C11 threads in GCC and Clang in the near future.

> I was surprised to find that the process of building gcc-4.7 from sources on Ubuntu is so complicated, after all, this is a Linux system …

It didn't look all that complicated to me. It seems like it is just the standard steps for installing gcc? Or am I missing something?

If you have installed before gcc from sources on Ubuntu you will notice that this time you need to do some extra steps.

A typical build should be as simple as:

./configure --prefix=where_you_want_this_installed make -j number_of_processors sudo make install

this is not the case if you read the various "bugs" reported on Ubuntu mailing lists.

I have manually installed a local gcc from patched sources on gentoo, and this seems like the standard procedure.

There might be a few more helper libraries needed now than in earlier versions, but this isn't really complicated...

And the need for setting a few environment variables is hardly very taxing.

patched sources ... gentoo ... environment variables ...

Please stop right there and think at the average Ubuntu user, or at a person that has used Windows as his primary OS and just recently has tried Linux hoping to learn/try/test some C++0x/C++11 codes.

Obviously the linked article was not written with a hard core Linux user in mind.

I understand that, from where you stand, this is trivially simple. Just don't assume everyone has your experience.

> patched sources

it was for... I don't recall exactly, something non-standard gcc did with templates, possibly? Anyways, they sent me the sources pre-patched, I just compiled it.

> gentoo

that I didn't administer, I only used it. I was a real newbie at the time. I just figured that since you specified ubuntu...

> I understand that, from where you stand, this is trivially simple. Just don't assume everyone has your experience.

I see your point, though. I might be looking back at it with the rose-tinted glasses of experience. Also, when I first skimmed through it I only read up until the point where it said that it was complicated and then I got interrupted by the real world for a while, building suspense.

I like step-by-step instructions like this. Is there an equivalent for OSX somewhere?
Same website look at the right links, or go directly here:

http://solarianprogrammer.com/2012/02/20/living-on-the-edge-...