You are not logged in.

#1 2022-03-27 14:17:25

marcello003
Member
Registered: 2019-05-14
Posts: 10

[SOLVED] Temporarily installing older versions of gcc/g++

Hi,
in order to compile a library that is not compiling anymore with any version of gcc later than 9.x.x I'm forced to temporarily install gcc-9.

They say it's ok to do so. I'm also aware that changing, even temporarily, gcc version may temporarily break things.

Current installed version is 11.2.0


I've read (route A)
Archlinux downgrade gcc from 5.2 to 4.8
in which they essentially suggest to do

$ sudo pacman -U gcc-9.4.0.tar.xz 

because I've previously successfully done

$ cd ~/Downloads/gcc/gcc9/gcc9
$ git clone https://aur.archlinux.org/gcc9.git
$ makepkg -si

and also read (route B)
How to temporarily change default version of gcc in ArchLinux
in which they essentially suggest to do

$ sudo ln -s $(which gcc-9) /usr/local/bin/gcc
$ sudo ln -s $(which g++-9) /usr/local/bin/g++
$ hash -r

Now the first (route A) doesn't work, despite the fact that `makepkg -si` seem successful
Error message is:

loading packages...
error: missing package metadata in gcc-9.4.0.tar.xz
:: Import PGP key 3AB00996FC26A641? [Y/n] Y
error: 'gcc-9.4.0.tar.xz': invalid or corrupted package (PGP signature)



so I'd follow the other (route B)
but I'm puzzled because in the directory /usr/bin/
I find many gcc entries, not just gcc and g++

/usr/bin/gcc
/usr/bin/gcc-9
/usr/bin/gcc-ar
/usr/bin/gcc-ar-9
/usr/bin/gcc-nm
/usr/bin/gcc-nm-9
/usr/bin/gcc-ranlib
/usr/bin/gcc-ranlib-9
...
/usr/bin/g++
/usr/bin/g++-9

so I don't know what is the best and safest way to proceed.



Besides, after that I also read somewhere that I should also do

$ export CXX=/usr/bin/gcc-9.4

but I'm probably confusing things on this point since I guess that creating the symbolic links shouldn't make that necessary.


Thanks in advance for any help,

Marcello

Last edited by marcello003 (2022-04-20 16:12:31)

Offline

#2 2022-03-27 14:44:37

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: [SOLVED] Temporarily installing older versions of gcc/g++

https://aur.archlinux.org/packages/gcc9

Then set the CC and CXX env variables.

DO NOT try to install ancient packages or create symlinks in /usr/local/ overriding the default.

Also note that 'gcc-9.4.0.tar.xz ' is not a pacman package.

Last edited by Scimmia (2022-03-27 14:47:29)

Offline

#3 2022-03-30 17:18:13

marcello003
Member
Registered: 2019-05-14
Posts: 10

Re: [SOLVED] Temporarily installing older versions of gcc/g++

I tried as described in Marcello commented on 2022-03-28 12:08 (UTC)
but still it doesn't work as the compilation of the library in question, ATLAS, seems to operate differently.

Given your expertise, would you, or someone else, have maybe a suggestion on what to do in this specific case? Thanks

Last edited by marcello003 (2022-03-30 17:23:05)

Offline

#4 2022-03-30 17:24:36

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: [SOLVED] Temporarily installing older versions of gcc/g++

Why in the world are you running yay here. Step 1 in troubleshooting is ALWAYS to get rid of the AUR helper.

Edit: and if the PKGBUILD in question actually requires gcc9, why is it not set up there? I'm thinking that you've got a different issue.

Last edited by Scimmia (2022-03-30 17:27:46)

Offline

#5 2022-03-30 17:51:22

marcello003
Member
Registered: 2019-05-14
Posts: 10

Re: [SOLVED] Temporarily installing older versions of gcc/g++

Thank you for checking. I'm going to read the full install documentation as I should have done in first place (file doc/atlas_install.pdf) and then see.

I tend to agree, yet I've seen in two different places that setting a different version of the gcc compiler solves the issue with some 'FORTRAN post install check scripts' of the ATLAS library (not the tuning phase I believe)

I'll write here how it goes.

Last edited by marcello003 (2022-03-30 18:24:45)

Offline

#6 2022-03-30 17:58:15

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: [SOLVED] Temporarily installing older versions of gcc/g++

Mod note: moving to AUR Issues


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#7 2022-04-03 11:52:36

FabioLolix
Member
Registered: 2021-06-27
Posts: 5
Website

Re: [SOLVED] Temporarily installing older versions of gcc/g++

Build gcc9 from the AUR in a clean chroot https://wiki.archlinux.org/title/Develo … nience_way for starting

Which is the library?

Offline

#8 2022-04-04 22:27:28

marcello003
Member
Registered: 2019-05-14
Posts: 10

Re: [SOLVED] Temporarily installing older versions of gcc/g++

I immediately feel you gave me the right solution, thank you for the link. I'll try tomorrow the instructions you have given me.

The library is atlas and I just posted a full description of the problems here

Offline

#9 2022-04-04 22:54:15

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: [SOLVED] Temporarily installing older versions of gcc/g++

Did you try the fix from https://github.com/Reference-LAPACK/lap … dce055a7d0
Edit:

grep -rF ',STEMP,' 
src/ATLAS/src/blas/f77reference/srotmg.f:     +     SQ2,STEMP,SU,TWO,ZERO
src/ATLAS/interfaces/blas/F77/testing/sblat1.f:               CALL STEST1(SNRM2(N,SX,INCX),STEMP(1),STEMP,SFAC)
src/ATLAS/interfaces/blas/F77/testing/sblat1.f:               CALL STEST1(SASUM(N,SX,INCX),STEMP(1),STEMP,SFAC)
src/ATLAS/interfaces/blas/F77/testing/dblat1.f:               CALL STEST1(DNRM2(N,SX,INCX),STEMP(1),STEMP,SFAC)
src/ATLAS/interfaces/blas/F77/testing/dblat1.f:               CALL STEST1(DASUM(N,SX,INCX),STEMP(1),STEMP,SFAC)
src/ATLAS/interfaces/blas/C/testing/c_sblat1.f:               CALL STEST1(SNRM2TEST(N,SX,INCX),STEMP,STEMP,SFAC)
src/ATLAS/interfaces/blas/C/testing/c_sblat1.f:               CALL STEST1(SASUMTEST(N,SX,INCX),STEMP,STEMP,SFAC)
src/ATLAS/interfaces/blas/C/testing/c_dblat1.f:               CALL STEST1(DNRM2TEST(N,SX,INCX),STEMP,STEMP,SFAC)
src/ATLAS/interfaces/blas/C/testing/c_dblat1.f:               CALL STEST1(DASUMTEST(N,SX,INCX),STEMP,STEMP,SFAC)

The calls in c_sblat1.f have not been changed while it those in sblat1.f have.
Edit2:
I produced a different failure in check:

/usr/bin/x86_64-pc-linux-gnu-gfortran -fallow-argument-mismatch -o xzuumtst zuumtst.o \
                   /build/atlas-lapack/src/ATLAS/build/lib/libtstatlas.a /build/atlas-lapack/src/ATLAS/build/lib/liblapack.a /build/atlas-lapack/src/ATLAS/build/lib/libcblas.a /build/atlas-lapack/src/ATLAS/build/lib/libf77blas.a \
                   /build/atlas-lapack/src/ATLAS/build/lib/libatlas.a -lpthread -lm
/build/atlas-lapack/src/ATLAS/build/bin/ATLrun.sh /build/atlas-lapack/src/ATLAS/build/bin xzslvtst -n 167 -r 83 -O 2 c r \
                  >> /build/atlas-lapack/src/ATLAS/build/bin/sanity.out
/build/atlas-lapack/src/ATLAS/build/bin/ATLrun.sh: line 4: 1367908 Segmentation fault      (core dumped) $atldir/$*
make[3]: *** [Makefile:9114: zsanity_test] Error 139
make[3]: Leaving directory '/build/atlas-lapack/src/ATLAS/build/bin'
make[2]: *** [Makefile:376: sanity_test] Error 2
make[2]: Leaving directory '/build/atlas-lapack/src/ATLAS/build/bin'
make[1]: *** [Make.top:28: sanity_test] Error 2
make[1]: Leaving directory '/build/atlas-lapack/src/ATLAS/build'
make: *** [Makefile:626: test] Error 2
==> ERROR: A failure occurred in check()

Edit3:
https://sources.debian.org/src/atlas/3. … -10.patch/ in case it helps on your system

Last edited by loqs (2022-04-05 09:35:09)

Offline

#10 2022-04-20 15:10:14

marcello003
Member
Registered: 2019-05-14
Posts: 10

Re: [SOLVED] Temporarily installing older versions of gcc/g++

Solved.
I confirm loqs findings, that is the segmentation fault error.

For the library to compile you need to also fix the four files in F77
so that you have:

[ATLAS3.10.3]$ grep -rnF ",STEMP,"
src/blas/f77reference/srotmg.f:55:     +     SQ2,STEMP,SU,TWO,ZERO
interfaces/blas/C/testing/c_dblat1.f:250:               CALL STEST1(DNRM2TEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
interfaces/blas/C/testing/c_dblat1.f:254:               CALL STEST1(DASUMTEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
interfaces/blas/C/testing/c_sblat1.f:250:               CALL STEST1(SNRM2TEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
interfaces/blas/C/testing/c_sblat1.f:254:               CALL STEST1(SASUMTEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
interfaces/blas/F77/testing/dblat1.f:313:               CALL STEST1(DNRM2(N,SX,INCX),STEMP(1),STEMP,SFAC)
interfaces/blas/F77/testing/dblat1.f:317:               CALL STEST1(DASUM(N,SX,INCX),STEMP(1),STEMP,SFAC)
interfaces/blas/F77/testing/sblat1.f:313:               CALL STEST1(SNRM2(N,SX,INCX),STEMP(1),STEMP,SFAC)
interfaces/blas/F77/testing/sblat1.f:317:               CALL STEST1(SASUM(N,SX,INCX),STEMP(1),STEMP,SFAC)

You also need to restart clean, otherwise you still get a segmentation fault error.

Thank you all for the help.

Offline

#11 2022-04-20 15:19:11

marcello003
Member
Registered: 2019-05-14
Posts: 10

Re: [SOLVED] Temporarily installing older versions of gcc/g++

I can't see an obvious way to rename the title of this post and prefix [solved] to it.

Offline

#12 2022-04-20 15:27:44

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,428

Re: [SOLVED] Temporarily installing older versions of gcc/g++

You can edit the title when you edit your first post in the thread.

Online

Board footer

Powered by FluxBB