The latest version of GCC (4.6.0) was downloaded and installed on Kubuntu using the source code. This required quite a bit of work to accomplish (for complete details, hit the continue link). Now that the project was building on both Linux and Windows, it was time to introduce it to the NetBeans IDE (which was now at version 7.0, version 6.9.1 was being used for development on Windows).
Before GCC 4.6.0 could be built on Linux, some prerequisite packages and libraries need to be installed first. The packages include m4, autoconf, automake, libtool and libc6-dev-i386. Each of these can be installed with this command:
sudo apt-get install <package>The libraries include GMP (GNU Multiple Precision arithmetic library), MPFR (Multiple Precision Floating point library with correct Rounding) and MPC (Multiple Precision Complex number library). The sources of the latest version of each of these were downloaded and installed (GMP 5.0.1, MPFR 3.0.1 and MPC 0.9). The procedure used for installing each of these were:
- uncompress the library source (tar xjf xxx.tar.bz2 or tar xjf xxx.tar.gz)
- change to the new directory created (cd xxx)
- ./configure
- make
- sudo make install
- tar xjf gcc‑4.6.0.tar.bz2 ‑or‑ tar tzf gcc‑4.6.0.tar.gz
- mkdir gcc-4.6.0-build
- cd gcc-4.6.0-build
- ../gcc‑4.6.0/configure ‑‑prefix=/usr/gcc‑4.6.0 ‑‑with‑gmp=/usr/local ‑‑with‑mpfr=/usr/local ‑‑with‑mpc=/usr/local
- export LD_LIBRARY_PATH=/usr/local/lib
- make bootstrap-lean
- sudo make install
export PATH=/usr/gcc‑4.6.0/bin:$PATHWhich can be put into a script file (for example ~/bin/gcc460) and executed using the command ". ~/bin/gcc460" to set the variables. The period tells the current shell to execute the script directly, otherwise the script is executed in a new shell and when done, terminates having no effect in the current shell. The gcc‑4.6.0 (source) and gcc‑4.6.0‑build directories can safely be removed once GCC 4.6.0 is successfully installed, along with the directories used to build the three prerequisite libraries.
export LD_LIBRARY_PATH=/usr/gcc‑4.6.0/lib64:/usr/gcc‑4.6.0/lib:/usr/local/lib
No comments:
Post a Comment
All comments and feedback welcomed, whether positive or negative.
(Anonymous comments are allowed, but comments with URL links or unrelated comments will be removed.)