Re: Installing gfortran-14

2024-08-28 Thread John Harper

Hi Thomas

Thank you! I got part of the way there after discovering that 
download-prerequisites had to be download_prerequisites, but make -j12

had a fatal error. What I did was

$ cd
% mkdir Gcc
% cd ~/Gcc
$ tar xvjf  ../Downloads/gmp-6.2.1.tar.bz2
$ tar -zxvf ../Downloads/mpc-1.2.1.tar.gz
$ tar xvjf  ../Downloads/mpfr-4.1.0.tar.bz2
$ tar -x -f ../Downloads/gcc-14.2.0.tar
$ cd gcc-14.2.0
$ contrib/download_prerequisites 
$ cd

$ mkdir Gcc-build
$ cd Gcc-build
$ ../Gcc/gcc-14.2.0/configure --prefix=$HOME --enable-multilib 
--enable-languages=c,c++,fortran

$ make -j12

After several minutes of checking and compilation, that ended with

In file included from 
../../../../Gcc/gcc-14.2.0/libgcc/../gcc/tsystem.h:95,

 from ../../../../Gcc/gcc-14.2.0/libgcc/libgcov.h:42,
 from 
../../../../Gcc/gcc-14.2.0/libgcc/libgcov-merge.c:26:
/usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such 
file or directory

   27 | #include 
  |  ^~
compilation terminated.
make[5]: *** [Makefile:931: _gcov_merge_add.o] Error 1
make[5]: Leaving directory 
'/home/john/Gcc-build/x86_64-pc-linux-gnu/32/libgcc'

make[4]: *** [Makefile:1221: multi-do] Error 1
make[4]: Leaving directory 
'/home/john/Gcc-build/x86_64-pc-linux-gnu/libgcc'

make[3]: *** [Makefile:127: all-multi] Error 2
make[3]: *** Waiting for unfinished jobs
make[3]: Leaving directory 
'/home/john/Gcc-build/x86_64-pc-linux-gnu/libgcc'

make[2]: *** [Makefile:24838: all-stage1-target-libgcc] Error 2
make[2]: Leaving directory '/home/john/Gcc-build'
make[1]: *** [Makefile:30438: stage1-bubble] Error 2
make[1]: Leaving directory '/home/john/Gcc-build'
make: *** [Makefile:1108: all] Error 2

That error message is puzzling because the offending file seems to exist:

(lf) john:~/Gcc-build$ ls -l /usr/*/*/bits/libc*
-rw-r--r-- 1 root root 4286 May  7 08:34 
/usr/include/x86_64-linux-gnu/bits/libc-header-start.h


(I know Fortran much better than bash and make)

John

On Thu, 22 Aug 2024, Thomas Koenig wrote:


Date: Thu, 22 Aug 2024 05:19:16 +
From: Thomas Koenig 
To: John Harper ,
Damian Rouson 
Cc: "fortran@gcc.gnu.org" 
Subject: Re: Installing gfortran-14
Resent-Date: Thu, 22 Aug 2024 17:19:33 +1200 (NZST)
Resent-From: 

[You don't often get email from tkoe...@netcologne.de. Learn why this is 
important at https://aka.ms/LearnAboutSenderIdentification ]

Hi John,


Thank you Damian. Tried the first suggestion. It said I already had
gfortran; it turned out to be version 13. Tried the second suggestion.
My system has not heard of git. Managed to find gcc-14.2.0.tar so I am
now struggling to do something with that.


Assuming you have the top level of the gcc sources (where the configure
script resides) in the ~/Gcc directory, you can do the following:

$ cd ~/Gcc
$ contrib/download-prerequisites
$ cd
$ mkdir Gcc-build
$ cd Gcc-build
$ ../Gcc/configure --prefix=$HOME --enable-languages=c,c++,fortran
$ make -j8
$ make -j4 install

The --prefix=$HOME option will install binaries, support libraries etc
under your home directory; if you want to put it somewhere else, specify
it as an alternative argument.

The build directory has to be separate from the source directory,
this is a frequent source of weird build errors.  Adjust directory
names to taste.

The "-j8" option will use eight parallel compilations if possible;
adjust to approximately the number of CPUs on your system. Having
2GB memory per job is quite sufficient.

Hope this helps

   Thomas






-- John Harper, School of Mathematics and Statistics
Victoria Univ. of Wellington, PO Box 600, Wellington 6140, New Zealand.
e-mail john.har...@vuw.ac.nz


Re: Installing gfortran-14

2024-08-28 Thread Jerry D

On 8/28/24 8:33 PM, John Harper wrote:

Hi Thomas

Thank you! I got part of the way there after discovering that 
download-prerequisites had to be download_prerequisites, but make -j12

had a fatal error. What I did was

$ cd
% mkdir Gcc
% cd ~/Gcc
$ tar xvjf  ../Downloads/gmp-6.2.1.tar.bz2
$ tar -zxvf ../Downloads/mpc-1.2.1.tar.gz
$ tar xvjf  ../Downloads/mpfr-4.1.0.tar.bz2
$ tar -x -f ../Downloads/gcc-14.2.0.tar
$ cd gcc-14.2.0
$ contrib/download_prerequisites $ cd
$ mkdir Gcc-build
$ cd Gcc-build
$ ../Gcc/gcc-14.2.0/configure --prefix=$HOME --enable-multilib 
--enable-languages=c,c++,fortran

$ make -j12

After several minutes of checking and compilation, that ended with

In file included from 
../../../../Gcc/gcc-14.2.0/libgcc/../gcc/tsystem.h:95,

  from ../../../../Gcc/gcc-14.2.0/libgcc/libgcov.h:42,
  from 
../../../../Gcc/gcc-14.2.0/libgcc/libgcov-merge.c:26:
/usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No 
such file or directory

    27 | #include 
   |  ^~
compilation terminated.


Hi John,

You may need to install a devel library package. However, missing a 
dependency should not get passed the configure step.


This leads me to guess use a lower -j value.  I would try with -j4. I 
say this only because I have seen make get ahead of itself and error out.


Regards,

Jerry



Re: Installing gfortran-14

2024-08-28 Thread Thomas Koenig

Hi John,

/usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No 
such file or directory

    27 | #include 


I'm not sure what system you are running. On my Ubuntu system,
which is Debian-based, you can search for the package that provides a
file with

$ dpkg -S libc-header-start.h

which, for me, returns libc6-dev.  You can then install that with

$ apt install libc6-dev

If your system does not provide dpkg and apt, you'll have to use
whatever tool there is.

Best regards

Thomas