The method @Beliavsky gave nearly 3 years ago to install the latest gfortran no longer works. I use Ubuntu 24.10. This is what I tried today:
(lf) john:~$ sudo apt install gfortran-15
Error: Unable to locate package gfortran-15
(lf) john:~$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
PPA publishes dbgsym, you may need to include 'main/debug' component
Repository: 'Types: deb
URIs: https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu/
Suites: oracular
Components: main
'
Description:
Toolchain test builds; see https://wiki.ubuntu.com/ToolChain
More info: https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
Adding repository.
Press [ENTER] to continue or Ctrl-c to cancel.
Found existing deb entry in /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-oracular.sources
Hit:1 http://archive.ubuntu.com/ubuntu oracular InRelease
Hit:2 http://security.ubuntu.com/ubuntu oracular-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu oracular-updates InRelease
Ign:4 https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu oracular InRelease
Err:5 https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu oracular Release
404 Not Found [IP: 185.125.190.80 443]
Reading package lists... Done
E: The repository 'https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu oracular Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
(lf) john:~$
It’s not clear whether Ubuntu offers any way to get gfortran-15.
So I copied gengtype-lex.cc from another directory where a previous attempt to install gfortran-15 had failed and got the same error message from make -j in spite of this (remember my time zone is 12h ahead of UT):
(lf) john:~/gcc$ ls -o gengtype*
-rw-rw-r-- 1 john 99343 May 1 11:17 gengtype-lex.cc
(lf) john:~/gcc$
(lf) john:~$ cd gcc
(lf) john:~/gcc$ ./contrib/download_prerequisites
gettext-0.22.tar.gz: OK
gmp-6.2.1.tar.bz2: OK
mpfr-4.1.0.tar.bz2: OK
mpc-1.2.1.tar.gz: OK
isl-0.24.tar.bz2: OK
All prerequisites downloaded successfully.
(lf) john:~/gcc$
The gcc I used to try to compile gfortran-15 would seem to be 14.2.0:
(lf) john:~$ gcc --version
gcc (GCC) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
(lf) john:~$
I wonder whether this sort of thing is why the SciPy people have trouble with gfortran. (See the Conda + Fortran = Profit discussion.) In the meantime I suppose I’ll have to try installing gfortran 15 from source using their instructions designed for earlier versions of both gfortran and Ubuntu
First attempt at installing gfortran 15 from source ran for over 4 hours and then failed complaining there was no " at the end of my string of configure options. I found that if the options were longer than one screen line, tempting a bash user to use \ at the end of a line, then configure does not interpret \ in the same way. Rewriting my shell script to avoid it I got a compiler that works! Pity that conda seemed not to have version 15, which might have saved a lot of time. It would be nice if configure checked its options for validity before running.
nooooooo so annoying that you ran into that…but glad that it now works! if you are not afraid of heat you can always make -j I think my poor little laptop suffers when I do that haha
Just to confirm that this works perfectly on an “oldish” Linux Mint 21.3, thanks for sharing this information.
Is there a way to estimate how much RAM make -j would require? If I don’t reduce the number of threads with make -j, I run out of RAM and I’d like to test if using a swapfile, instead of reducing the number of threads, is faster.
to my knowledge there is no other way other than “the vibes” to feel this one out. I usually run make -j and go get some coffee with top running in a separate tab and if it dies, I do take nproc/2 and rerun haha. Sorry for the lack of a scientific approach.
If you see the movie “The Castle” and see the scene in court about “vibes”, this is exactly it.