Thursday, December 10, 2015
GCC on Tru64
Follow the instructions from Babak Salamat, here:
http://www.babaks.com/misc/compilegcc.html
Alternatively, before starting to download and install gcc, you need GMP and MPFR if you want to enable Fortran language.
If you don't need Fortran, you can skip the installation of GMP and MPFR.
To download and install GMP follow these steps:
To do so follow these steps:
Libraries have been installed in:
/usr/users/gilemon/gcc/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
Now it is time to remove the folders and files that you have created in /tmp.
In our example: /tmp/gcc-4.2.1, /tmp/gcc-build, /tmp/libiconv, /tmp/mpfr-3.1.3, /tmp/gmp-4.2.1
If you want the compiled result for Tru64 5.1a, download it here:
http://nthinking.net/vrak/gcc.4.2.1.osf5.1a.tar
BTW, who is still working on Tru64?
http://www.babaks.com/misc/compilegcc.html
Alternatively, before starting to download and install gcc, you need GMP and MPFR if you want to enable Fortran language.
If you don't need Fortran, you can skip the installation of GMP and MPFR.
To download and install GMP follow these steps:
- Download GMP from http://nthinking.net/vrak/gmp-4.2.1.tar.gz
- copy the file to /tmp and uncompress it there. Let's assume that the extracted files are in /tmp/gmp-4.2.1
- cd /tmp/gmp-4.2.1
- ./configure --prefix=$HOME/progs/gmp
- make
- make check
Check the messages and make sure that no test failed. - make install
To do so follow these steps:
- Download MPFR from http://nthinking.net/vrak/mpfr-3.1.3.tar.gz
- copy the file to /tmp and uncompress it there. Let's assume that the extracted files are in /tmp/mpfr-3.1.3
- Check the website for any available patches and apply them if there is any Note: Use /usr/local/bin/patch to apply any existing patch.
- cd /tmp/mpfr-3-1.3
- LD_LIBRARY_PATH=$HOME/progs/gmp/lib:$LD_LIBRARY_PATH ./configure --prefix=$HOME/progs/mpfr --with-gmp=$HOME/progs/gmp
- gmake
- gmake check
- gmake install
- Download libiconv from http://nthinking.net/vrak/libiconv-1.14.tar.gz
- copy the file to /tmp and uncompress it there. Let's assume that the extracted files are in /tmp/libiconv
- cd /tmp/libiconv
- ./configure --prefix=$HOME/progs/libiconv
- make
- make install
- Download gcc from https://ftp.gnu.org/gnu/gcc/gcc-4.2.1/
- Uncompress the file under a directory in /tmp. Let's assume that the extracted files are in /tmp/gcc-4.2.1/ Note: You should use gtar to untar the file, otherwise you will get some errors similar to this:
- Create another directory in /tmp. Let's call this directory gcc-build Note: If you are using HP TestDrive systems, it is important to use /tmp, because you don't have enough disk quota in your home directory to compile gcc.
- cd /tmp/gcc-build
- CC="gcc -Wa,-oldas" /tmp/gcc-4.2.1/configure --prefix=$HOME/gcc --enable-languages=c,c++,fortran --with-gmp=$HOME/progs/gmp --with-mpfr=$HOME/progs/mpfr --with-libiconv-prefix=$HOME/progs/libiconv If you don't need C++, omit it from --enable-languages. C++ takes a relatively large amount of disk space.
- LD_LIBRARY_PATH=$HOME/progs/gmp/lib:$LD_LIBRARY_PATH gmake bootstrap-lean Note: You should use GNU make (gmake) version 3.80 or higher to build gcc.
- gmake install If tar complains that it failed to preserve ownership of files, you'll need to change the ownership of /tmp/gcc-build.
tar: ././@LongLink : Unknown filetype
You can get gtar from the Open Source Software Collection or here:
http://nthinking.net/vrak/gtar-1.13-4.alpha.rpm
If you don't need Fortran, use this command instead:
CC="gcc -Wa,-oldas" /tmp/gcc-4.2.1/configure --prefix=$HOME/gcc --enable-languages=c,c++ --with-libiconv-prefix=$HOME/progs/libiconv
You can get it from the Open Source Software Collection or here:
http://nthinking.net/vrak/gmake-3.79.1-4.alpha.rpm
This step takes a long time, usually a few hours!
If you don't want to install Fortran simply use:
gmake bootstrap-lean
Go to your home directory and run ls -l. In my case the problem was from group name. The group name of all the files in my home directory was nis while the group name of /tmp/gcc-build and all the files under the directory was system.
So, I ran chown -hR MyUsername:nis /tmp/gcc-build then I removed $HOME/gcc and ran gmake install again.
Libraries have been installed in:
/usr/users/gilemon/gcc/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
Now it is time to remove the folders and files that you have created in /tmp.
In our example: /tmp/gcc-4.2.1, /tmp/gcc-build, /tmp/libiconv, /tmp/mpfr-3.1.3, /tmp/gmp-4.2.1
If you want the compiled result for Tru64 5.1a, download it here:
http://nthinking.net/vrak/gcc.4.2.1.osf5.1a.tar
BTW, who is still working on Tru64?