You are not logged in.

#1 2021-10-03 09:55:16

tilld
Member
Registered: 2021-10-03
Posts: 2

Multiple versions of gcc/g++/gfortran

I need to compile an old piece of software which requires gcc-4.x where x>=8. Newer and older versions are said to fail.
It needs the g++ and gfortran compilers of that version.
I found this thread and downloaded the gcc-48 from the AUR.
Following the steps in the above thread

    export CC=/usr/bin/x86_64-pc-linux-gnu-gcc-4.8 
    export FC=/usr/bin/x86_64-pc-linux-gnu-gfortran-4.8
    export CXX=/usr/bin/x86_64-pc-linux-gnu-g++-4.8

and then running gcc --version results still in 11.1.0.

Is that even the correct way to get the compiler version to 4.8 or am I making some mistakes here ?

Offline

#2 2021-10-03 12:13:50

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,672
Website

Re: Multiple versions of gcc/g++/gfortran

"gcc --version" is still calling the /usr/bin/gcc binary.

How are you building this software?   Does it have a configure script that recognises CC etc?

Offline

#3 2021-10-03 16:34:46

fistrosan
Member
Registered: 2020-04-01
Posts: 171

Re: Multiple versions of gcc/g++/gfortran

You can always download the version of gcc that you need in i.e. /opt/ and run ./configure and make there. However, you might find that it fails to compile due to missing dependencies and you can get yourself in a catch 22 situation.

On the other hand, new gcc and gfortran releases and supposed to be fully compatible with previous versions of the compilers, in particular if you use the -std=legacy flag.

Offline

#4 2021-10-03 17:46:39

tilld
Member
Registered: 2021-10-03
Posts: 2

Re: Multiple versions of gcc/g++/gfortran

I am using a build-script that seems to not reference CC etc.
It just uses g++/gfortran in the script itself. I now changed all of these by hand to g++-4.8 and gfortran-4.8 by hand.
This on the first hand seemed to solve the issue, but I exactly run in to the problem fistrosan mentions - it is missing a bunch of libraries to build.

Not entirely sure how to move on from here.

Offline

#5 2021-10-03 18:12:47

fistrosan
Member
Registered: 2020-04-01
Posts: 171

Re: Multiple versions of gcc/g++/gfortran

Can you post the makefile of the software you are trying to compile ?

Offline

Board footer

Powered by FluxBB