Tiny Core Base > Raspberry Pi

troubleshooting compilation of gfortran

<< < (5/6) > >>

Juanito:
gfortran posted to piCore-12.x armv7 repo

xenodius:
Juanito, very kind of you to go out of your way to do that! Seems like getting a toolchain is the hardest part of this process. I actually wanted to try the aarch64 version of piCore 12, so I tried to build a piCore 12.x aarch64 version using the gcc build notes from the repo-- had to use -march=armv8-a instead of armv8.1-a+crc, and use the ./download_prerequisites gcc script for source instead of flagging local gmp, mpc, and mpfr libs of the same version to avoid errors, but it seems to have worked.

Oddly on my first reboot after the make, I got a
--- Code: ---wpa_supplicant: error while loading shared libraries: libnl-3.so.200
--- End code ---
during wifi autoconnect, which failed. It didn't happen again after a 2nd reboot and wifi now works fine again :o Did not call filetool.sh -b between setting up wifi, and making gfortran.

I would like to submit gfortran and some of the other packages I'll build, e.g. scipy, to the piCore-12.x aarch64 repo. There's a dead link to tcztools in the Creating Extensions page of the wiki that sounds very useful-- is it still around and working somewhere? If not I can use the extensive build notes as a guide-- I just don't want to make a mistake in the process, some of the commands are still over my linux noob head =)

Juanito:
Are you sure that you didn’t mistype something, gcc will compile using the build notes and the gmp/isl/mpc/mpfr-dev extensions.

xenodius:
I don't think i did, I tried it cut/pasted via SSH first changing only enable-languages then repeated it directly on the pi;
--- Code: ---export CFLAGS="-O2 -march=armv8-a+crc -mtune=cortex-a53 -use-ld=gold -lpthread"
export CXXFLAGS="-O2 -march=armv8-a+crc -mtune=cortex-a53 -use-ld=gold"
../configure \
--libdir=/usr/lib \
--enable-shared \
--enable-threads=posix \
--enable-__cxa_atexit \
--enable-c99 \
--enable-long-long \
--enable-clocale=gnu \
--enable-languages=fortran \
--disable-multilib \
--disable-libstdcxx-pch \
--enable-cloog-backend=isl \
--with-isl=/usr/local \
--with-mpfr=/usr/local \
--with-gmp=/usr/local \
--with-mpc=/usr/local \
--with-system-zlib \
--enable-frame-pointer \
--disable-bootstrap \
--enable-lto \
--with-pkgversion=piCore64 \
--with-arch=armv8-a+crc \
--enable-fix-cortex-a53-843419 \
--with-gxx-include-dir=/usr/include/c++/10.1.0
--- End code ---

Consistently got this error on make:

--- Code: ---sh: AARCH64_FL_CRC: unknown operand
Unknown extension used in --with-arch=armv8-a+crc
--- End code ---

And got the same error with these flags and tuning to my pi4b cpu:

--- Code: ---export CC="gcc -march=armv8-a+crc -mtune=cortex-a72 -Os -pipe"
export CXX="g++ -march=armv8-a+crc -mtune=cortex-a72 -Os -pipe -fno-exceptions -fno-rtti"
OR
export CFLAGS="-O2 -march=armv8-a+crc -mtune=cortex-a72 -use-ld=gold -lpthread"
export CXXFLAGS="-O2 -march=armv8-a+crc -mtune=cortex-a72 -use-ld=gold

--- End code ---

The 'mismatch' error I got from mpfr only happened when specifying mpfr|gmp|mpc=/usr/local in configure after running download_prerequisites, I loaded it in one of several tests with the CRC error. Re-extracted and rebuilt with mpfr|gmp|mpc=/usr/local instead of same source using --with-arch=armv8-a option successfully.

The gcc documentation states:
--- Code: ---The value ‘armv8.1-a’ implies ‘armv8-a’ and enables compiler support for the ARMv8.1-A architecture extension. In particular, it enables the ‘+crc’, ‘+lse’, and ‘+rdma’ features.
--- End code ---

So for one test I tried replacing armv8-a+crc with armv8.1-a+crc in CFLAGS/CXXFLAGS/configure. This returned a similar error:

--- Code: ---sh: AARCH64_FL_CRC: unknown operand
Unknown extension used in --with-arch=armv8.1-a+crc
--- End code ---

Obviously it has worked so there's probably some difference in our setup, but as best I can google the Cortex-A72 on my pi4B doesn't support armv8.1 and gcc doesn't seem to support +crc with anything less than armv8.1 so I think it's okay. I'll try to compile scipy with it and run some tests on the package to double check before I send it in.

Juanito:
If your build does not use the gmp, isl, mpc and mpfr extensions from the repo and the same compiler flags then there is the risk of problems with applications compiled with it.

I'm note sure where you got the build notes from, but using the last build of gcc from here: http://tinycorelinux.net/12.x/aarch64/releases/RPi/src/toolchain/compile_tc12_aarch64 gives the following configure switches:
--- Code: ---LD=ld CFLAGS="-march=armv8-a+crc -mtune=cortex-a53 -Os -pipe" CXXFLAGS="-march=armv8-a+crc -mtune=cortex-a53 -Os -pipe" ../configure --prefix=/usr/local --enable-languages=c,c++,fortran --disable-multilib --disable-bootstrap --with-system-zlib --enable-fix-cortex-a53-843419 --libexecdir=/usr/local/lib --with-mpfr=/usr/local --with-gmp=/usr/local --with-mpc=/usr/local
--- End code ---

..and it compiles natively without errors.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version