Tiny Core Base > Raspberry Pi

troubleshooting compilation of gfortran

(1/6) > >>

xenodius:
Hello, I see gcc.tcz contains gfortran however, when trying to compile scipy it is not recognized. So, I set out to compile just gfortran with gcc... I haven't compiled anything on linux before.

My first try, I ran out of memory. So I tried compiling on the 2nd partition (mmcblk0p2, ~60gb) which appeared to configure; 

--- Code: ---sudo git clone https://gcc.gnu.org/git/gcc.git
sudo ./contrib/download_prerequisites
sudo tar -xvf gmp-6.1.0.tar.bz2
sudo tar -xvf mpc-1.0.3.tar.gz
sudo tar -xvf mpfr-3.1.4.tar.bz2
sudo /mnt/mmcblk0p2/build/gcc/configure --prefix=/mnt/mmcblk0p2/build/gcc --enable-languages=c,fortran
sudo make -j4 DESTDIR=/mnt/mmcblk0p2/build/gcc-build

--- End code ---

however, make eventually returned:

--- Code: ---checking how to run the C preprocessor... /lib/cpp
configure: error: in `/mnt/mmcblk0p2/build/gcc-build/armv7l-unknown-linux-gnueabihf/libgcc':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
make[2]: *** [Makefile:20136: configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory '/mnt/mmcblk0p2/build/gcc-build'
make[1]: *** [Makefile:25512: stage1-bubble] Error 2
make[1]: Leaving directory '/mnt/mmcblk0p2/build/gcc-build'
make: *** [Makefile:1001: all] Error 2

--- End code ---

Seems like I'm missing something needed to compile C, or a path to it? I have gcc, gmp, mpfr, and mpc tcz's... however, gcc would not configure without the source for gmp, mpfr, and mpc, detecting gmp but not mpfr/mpc the first try, so I grabbed them all via './contrib/download_prerequisites' as above before I ran out of memory and tried it on mmcblk0p2.

I've attached the config.log, which included some surprisingly kinky commentary that may be irrelevant but I feel compelled to draw attention to below. Easter egg?

--- Code: ---conftest.c:17:5: error: unknown type name 'choke'
   17 |     choke me
      |     ^~~~~
........
| {
|     #if MPFR_VERSION < MPFR_VERSION_NUM(3,1,6)
|     choke me
|     #endif
|   ;
|   return 0;
| }
configure:7812: result: buggy but acceptable
--- End code ---


Rich:
Hi xenodius

--- Quote from: xenodius on December 22, 2020, 12:32:17 AM --- ... I have gcc, gmp, mpfr, and mpc tcz's... however, gcc would not configure without the source for gmp, mpfr, and mpc, ...
--- End quote ---
You might need the  dev  files (gmp-dev.tcz, mpfr-dev.tcz, and mpc-dev.tcz), not the source packages.

bmarkus:
When you are reporting a bug, please report OS release version and the version, packing date of extension.

Juanito:
To compile gcc you need something like:
--- Code: ---$ tce-load compiletc mpc-dev python3.8
--- End code ---

snecker:

--- Quote from: xenodius on December 22, 2020, 12:32:17 AM ---Hello, I see gcc.tcz contains gfortran however, when trying to compile scipy it is not recognized. So, I set out to compile just gfortran with gcc... I haven't compiled anything on linux before.

My first try, I ran out of memory. So I tried compiling on the 2nd partition (mmcblk0p2, ~60gb) which appeared to configure; 

--- Code: ---sudo git clone https://gcc.gnu.org/git/gcc.git
sudo ./contrib/download_prerequisites
sudo tar -xvf gmp-6.1.0.tar.bz2
sudo tar -xvf mpc-1.0.3.tar.gz
sudo tar -xvf mpfr-3.1.4.tar.bz2
sudo /mnt/mmcblk0p2/build/gcc/configure --prefix=/mnt/mmcblk0p2/build/gcc --enable-languages=c,fortran
sudo make -j4 DESTDIR=/mnt/mmcblk0p2/build/gcc-build

--- End code ---

--- End quote ---

I would add that you shouldn't do any of this as root. You are also downloading a git checkout which will likely be the development branch and possibly broken, therefore try with the current stable 10.2 release:

https://gcc.gnu.org/mirrors.html

e.g.

ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-10.2.0/gcc-10.2.0.tar.gz

Navigation

[0] Message Index

[#] Next page

Go to full version