compiling gcc 4.1.2 to get gfortran-4.1.2

I need to do this to use thermocalc tq on my linux computer (debian squeeze).

1) Download
I think I downloaded and untarred (I had these on my computer from previous time)
gcc-4.1.2.tar.gz
gcc-fortran-4.1.2.tar.gz (not sure this is needed — I think other folder contains everything!?)

2) Install prerequisites

3) Make a new directory in which you will compile gcc (first trick you can learn from reading the documentation — unlike most other packages it is not intended to build gcc in the src directory)

4) Configure
enter DIR and run

/blah/blah/gcc-4.1.2/configure --prefix=/opt/gcc412 
--program-suffix=412 --enable-shared 
--enable-threads=posix --enable-checking=release 
--with-system-zlib --disable-libunwind-exceptions 
--enable-__cxa_atexit --disable-multilib

(ALL ONE LINE)
5) Avoid a bug
then edit the make file to remove error about makeinfo

MAKEINFO = /blah/missing makeinfo
needs to be changed to (make sure you actually have makeinfo! which is in texinfo package I think)
MAKEINFO = makeinfo

6) Compile and install
I think after that you can just compile with make or make all

More sophisticated things are possible build gcc, to bootstrap the compiler. I don’t think this is necessary for what I need.

Making destination be /opt means that gcc should not appear in the PATH with higher priority than /usr/bin, as will happen if you place in /usr/local. Suffix of 412 means you will get binaries with different name than gcc so it should not allow any confusion to occur.

Advertisements

One Response

  1. p.s. you will need to install make if you didn’t have it already.

    actually
    make
    fastjar
    zlib1g-dev

    …GMP-4.2.2 which I can no longer install on debian wheezy so probably have to compile and build gcc-4.1.2 to make it, to make prerequisites for gfortran.

    ..MPFR which i compiled last time.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: