Bash script to download, build and install gcc 4.6.3 and boost 1.49

I recently had to build gcc 4.6.3 on CentOS 5.5 so I put together this script to do all of the work. It is released in text mode so that you can cut-n-paste it from the web page. The shell version is also available: if you want to download it directly using a tool like wget.

The full installation of gcc-4.6.3 and boost-1.49 requires about 4GB of disk space. After the build is complete you can delete the archives, bld and src directory trees to reclaim about 3.4GB of disk space.


Here is how you might use build script described above to install gcc-4.6.3 and boost-1.49 on your system.

Simple Test Program:

If you want, you can create a simple program like this:

Then compile, link and run it as follows.

or if you prefer make…

Final Thoughts

This script has been tested on CentOS 5.5.

Note that I decided to use the latest version CLooG (0.17.0) so I had to put in a small hack to fix the gcc/g++ source code. Specifically I had to change LANGUAGE_C to CLOOG_LANGUAGE_C in the <gcc-4.6.3-source>/gcc/graphite-clast-to-gimple.c to track the same change in CLooG. This hack is done automatically by the script. I also had to turn off version checking because it specifically requires 0.16.0.

Please report problems or suggestions via the comments section.


6 thoughts on “Bash script to download, build and install gcc 4.6.3 and boost 1.49”

  1. Hi– I think this script looks really helpful, and will probably save me a whole day of work… However, I think a lot of people might be stymied from using it because it carries no copyright and no license information. Would you be willing to make an update with a license and copyright? Maybe post it on github so that others can fork and contribute? Thanks!

    1. I am happy to do that.

      This script is free to use and modify by anyone. My only goal is to share and increase general knowledge. There are no restrictions.

      What license do you suggest I use?

  2. I personally was basically researching for ideas for my website and discovered your own
    article, “Bash script to download, build and install gcc 4.

    6.3 and boost 1.49 | Joe’s Blog” universityofbridgeport , do you really mind in cases where I employ a number of your own concepts? Appreciate it -Geoffrey

    1. Thank you for asking. I do not mind. Please feel free to use the information on this site. I would appreciate a citation if the information is published but it is not necessary.

  3. Hey there! This post could not be written any better!
    Reading this post reminds me of my previous room mate!
    He always kept talking about this. I will forward this post to him.

    Fairly certain he will have a good read. Many thanks for sharing!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.