This week I created a script to install the gcc-4.9.3 compiler and linker with boost 1.5.7. A very simple Makefile is also available. Both files are based on scripts I have created for earlier versions of the compiler. This version also includes tcmalloc for linux platforms.
This script is also available on github:
https://github.com/jlinoff/gcc-4.9.2-boost-1.57
https://github.com/jlinoff/gcc-4.9.2-boost-1.57
To use it just download bld.sh and Makefile and type “make” as shown below:
1 2 3 4 5 6 7 8 9 |
$ # Download the scripts using wget. $ mkdir /opt/gcc-4.9.2 $ cd /opt/gcc-4.9.2 $ wget http://projects.joelinoff.com/gcc-4.9.2/bld.sh $ wget http://projects.joelinoff.com/gcc-4.9.2/Makefile $ chmod a+x bld.sh $ make [output snipped] $ # The compiler is installed in /opt/gcc-4.9.2/rtf/bin |
At this point the compiler is installed and you can use it as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
$ # Compile, link and run a small test program. $ # Note that LD_LIBRARY_PATH must be used unless the $ # compiler is installed in standard place. $ export PATH="/opt/gcc-4.9.2/bin:${PATH}" $ export LD_LIBRARY_PATH="/opt/gcc/4.9.2/lib64:/opt/gcc-4.9.2/lib:${LD_LIBRARY_PATH}" $ cat >test.cc <<EOF #include <iostream> using namespace std; main() { cout << "Hello, World!" << endl; } EOF $ g++ -o test.exe -g -Wall test.cc $ ./test.exe Hello, World! |
Enjoy!