This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
Was attempting the build GCC-4.1.0 but recieved the error below. Kernel-2.6.13.4 GCC-4.0.1 [I know, it rolls over to its own compiler - xgcc] Binutils-2.16.90.0.3 Make-3.80 CC="ccache gcc" CXX="ccache g++" CPP="ccache cpp" \ CFLAGS="-O3 -fstrict-aliasing -finline -mieee -fomit-frame-pointer \ -mtune=ev56 -w -pipe" \ CXXFLAGS="-O3 -fstrict-aliasing -finline -mieee -fomit-frame-pointer \ -mtune=ev56 -w -pipe" \ ./configure \ --host=alphapca56-alpha-linux-gnu \ --build=alphapca56-alpha-linux-gnu \ --sysconfdir=/etc \ --prefix=/usr \ --localstatedir=/var \ --infodir=/usr/info \ --mandir=/usr/man \ --x-includes=/usr/X11R6/include \ --x-libraries=/usr/X11R6/lib \ --enable-libada make[2]: Entering directory `/usr2/www/pub/alpha-RH7/programming/compilers/gcc-4.1.0/gcc-4.1.0/alphapca56-alpha-linux-gnu/libgfortran' /bin/sh ../.././libgfortran/mk-kinds-h.sh '/usr2/www/linux-related/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/gfortran -B/usr2/www/linux-related/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/ -B/usr/alphapca56-alpha-linux-gnu/bin/ -B/usr/alphapca56-alpha-linux-gnu/lib/ -isystem /usr/alphapca56-alpha-linux-gnu/include -isystem /usr/alphapca56-alpha-linux-gnu/sys-include -I . -Wall -fno-repack-arrays -fno-underscoring ' > kinds.h || rm kinds.h ../.././libgfortran/mk-kinds-h.sh: Unknown type grep '^#' < kinds.h > kinds.inc /bin/sh: kinds.h: No such file or directory make[2]: *** [kinds.inc] Error 1 make[2]: Leaving directory `/usr2/www/pub/alpha-RH7/programming/compilers/gcc-4.1.0/gcc-4.1.0/alphapca56-alpha-linux-gnu/libgfortran' make[1]: *** [all-target-libgfortran] Error 2 make[1]: Leaving directory `/usr2/www/pub/alpha-RH7/programming/compilers/gcc-4.1.0/gcc-4.1.0' make: *** [all] Error 2
This does not makes sense really unless you /bin/sh is broken. Can you try runing /bin/sh $(srcdir)/libgfortran/mk-kinds-h.sh With replacing "$(srcdir)" with the source directory path?
Actually I take this back. This can happen though it should not happen at all unless your /bin/sh is going bonkers. possible_real_kinds="4 8 10 16" for k in $possible_real_kinds; do case $k in 4) ctype="float" ;; 8) ctype="double" ;; 10) ctype="long double" ;; 16) ctype="long double" ;; *) echo "$0: Unknown type" >&2 ; exit 1 ;; esac largest_ctype="$ctype" ... case $largest_ctype in float) echo "#define GFC_REAL_LARGEST_FORMAT \"\"" ;; double) echo "#define GFC_REAL_LARGEST_FORMAT \"l\"" ;; "long double") echo "#define GFC_REAL_LARGEST_FORMAT \"L\"" ;; *) echo "$0: Unknown type" >&2 ; exit 1 ;; esac
It can happen when the fortran compiler is broken. What do you get when you execute this command (all in one line)? echo " real (kind=4) :: x" > tmp.f90; echo " end" >> tmp.f90; /usr2/www/linux-related/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/gfortran -B/usr2/www/linux-related/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/ -B/usr/alphapca56-alpha-linux-gnu/bin/ -B/usr/alphapca56-alpha-linux-gnu/lib/ -isystem /usr/alphapca56-alpha-linux-gnu/include -isystem /usr/alphapca56-alpha-linux-gnu/sys-include -I . -Wall -fno-repack-arrays -fno-underscoring -c tmp.f90
I tried : sh ./libgfortran/mk-kinds-h.sh #define GFC_INTEGER_LARGEST GFC_INTEGER_ #define GFC_UINTEGER_LARGEST GFC_UINTEGER_ ./libgfortran/mk-kinds-h.sh: Unknown type [root@jericho gcc-4.1.0]# When I run the following command: echo " real (kind=4) :: x" > tmp.f90; echo " end" >> tmp.f90; /usr2/www/linux-related/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/gfortran -B/usr2/www/linux-related/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/ -B/usr/alphapca56-alpha-linux-gnu/bin/ -B/usr/alphapca56-alpha-linux-gnu/lib/ -isystem /usr/alphapca56-alpha-linux-gnu/include -isystem /usr/alphapca56-alpha-linux-gnu/sys-include -I . -Wall -fno-repack-arrays -fno-underscoring -c tmp.f90 cmp.c:39: GNU MP assertion failed: !(((b)->_mpfr_size >> 30) & 1) <built-in>:0: internal compiler error: Aborted Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. I have gmp-4.1.4 installed [installed it before I attempted to compile GCC-4.1.0]
> cmp.c:39: GNU MP assertion failed: !(((b)->_mpfr_size >> 30) & 1) > <built-in>:0: internal compiler error: Aborted > Please submit a full bug report, > with preprocessed source if appropriate. > See <URL:http://gcc.gnu.org/bugs.html> for instructions. This isn't a gfortran problem. How did you install GMP and MPFR? Note, you may want to install GMP without its bundled in version of MPFR; then install the newest version of MPFR. Also, try building GMP without high levels of optimization.
Subject: RE: ../.././libgfortran/mk-kinds-h.sh: Unknown type Alright, I'll try that... rebuilding GMP with base/low level CFLAGS and see how it goes... Will L G -----Original Message----- From: kargl at gcc dot gnu dot org [mailto:gcc-bugzilla@gcc.gnu.org] Sent: Saturday, March 04, 2006 7:40 PM To: diskman@kc.rr.com Subject: [Bug libfortran/26564] ../.././libgfortran/mk-kinds-h.sh: Unknown type ------- Comment #5 from kargl at gcc dot gnu dot org 2006-03-05 01:39 ------- > cmp.c:39: GNU MP assertion failed: !(((b)->_mpfr_size >> 30) & 1) > <built-in>:0: internal compiler error: Aborted > Please submit a full bug report, > with preprocessed source if appropriate. > See <URL:http://gcc.gnu.org/bugs.html> for instructions. This isn't a gfortran problem. How did you install GMP and MPFR? Note, you may want to install GMP without its bundled in version of MPFR; then install the newest version of MPFR. Also, try building GMP without high levels of optimization. -- kargl at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26564 ------- You are receiving this mail because: ------- You reported the bug, or are watching the reporter.
(In reply to comment #6) > Alright, I'll try that... rebuilding GMP with base/low level CFLAGS and see > how it goes... You may want to configure GMP with --host=none --target=none --build=none to disable platform-specific optimization.
Well I went ahead and reinstalled GMP-4.1.4: CC=gcc-3.2.3 CXX=g++-3.2.3 CPP=cpp-3.2.3 \ CFLAGS="-O2 -mieee -mtune=ev56 -w -pipe" \ CXXFLAGS="-O2 -mieee -mtune=ev56 -w -pipe" \ ./configure \ --build=alpha-alpha-linux \ --prefix=/usr \ --sysconfdir=/etc \ --infodir=/usr/info \ --mandir=/usr/man \ --enable-cxx \ --enable-nails \ --disable-mpfr And installed MPFR-2.2.0: CC="ccache gcc-3.2.3" CXX="ccache g++-3.2.3" CPP="ccache cpp-3.2.3" \ CFLAGS="-O2 -mieee -mtune=ev56 -w -pipe" \ CXXFLAGS="-O2 -fomit-frame-pointer -mieee -mtune=ev56 -w -pipe" \ ./configure \ --build=alpha-alpha-linux \ --prefix=/usr \ --sysconfdir=/etc \ --infodir=/usr/info \ --mandir=/usr/man \ --enable-shared and then attempted to rebuild GCC. All the GFORTAN compiler does now, is simply hang at the following: checking whether the linker (/usr2/www/linux-related/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/collect-ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking command to parse /usr2/www/linux-related/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/nm output... ok checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes creating libtool updating cache ./config.cache configure: loading cache ./config.cache checking for alphapca56-alpha-linux-gnu-gfortran... /usr2/www/linux-related/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/gfortran -B/usr2/www/linux-related/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/ -B/usr/alphapca56-alpha-linux-gnu/bin/ -B/usr/alphapca56-alpha-linux-gnu/lib/ -isystem /usr/alphapca56-alpha-linux-gnu/include -isystem /usr/alphapca56-alpha-linux-gnu/sys-include checking whether we are using the GNU Fortran compiler... I let it sit for several hours and it never budged... I think it is now safe to say that GFORTRAN isn't working properly and that GMP/MPFR [will not build with anything greater than GCC-3.2.3] are somewhat dodgey at best. I've tried several different configurations and variation on the deps builds and GCC itself, nothing is working as it should.
Did some hunting around on the net, it seems the 'hanging' problem is happen to others as well. Here's a Solaris user with the same issue: http://gcc.gnu.org/ml/fortran/2005-05/msg00456.html
Could you try to compile a test program under gdb to see where it freezes? $ cat > a.f90 integer :: a = 45 real(8) :: x = 1.78d2 print *, "hello", x / a end $ gdb -args /usr2/www/linux-related/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/gfortran -B/usr2/www/linux-related/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/ -B/usr/alphapca56-alpha-linux-gnu/bin/ -B/usr/alphapca56-alpha-linux-gnu/lib/ -isystem /usr/alphapca56-alpha-linux-gnu/include -isystem a.f90 then interrupt it (^C) and ask "where". I've been doing builds on (i386|sparc)-solaris and alphaev*-alpha-linux-gnu for quite some time now. I don't know alphapca56: how different from the other alphas is it?
The AlphaPC 164SX is basically the same as the AlphaPC 164LX just minus the 96k L1 cache but with additional MVI instructions. [root@jericho gcc-4.1.0]# gdb -args /usr2/www/linux-related/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/gfortran -B/usr2/www/linux-related/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/ -B/usr/alphapca56-alpha-linux-gnu/bin/ -B/usr/alphapca56-alpha-linux-gnu/lib/ -isystem /usr/alphapca56-alpha-linux-gnu/include -isystem a.f90 GNU gdb 6.3 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "alphapca56-alpha-linux-gnu"... (no debugging symbols found) Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run Starting program: /usr2/www/pub/alpha-RH7/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/gfortran -B/usr2/www/linux-related/programming/compilers/gcc-4.1.0/gcc-4.1.0/host-alphapca56-alpha-linux-gnu/gcc/ -B/usr/alphapca56-alpha-linux-gnu/bin/ -B/usr/alphapca56-alpha-linux-gnu/lib/ -isystem /usr/alphapca56-alpha-linux-gnu/include -isystem a.f90 Detaching after fork from child process 24853. /usr/bin/ld: cannot find -lgfortranbegin collect2: ld returned 1 exit status Program exited with code 01. [root@jericho gcc-4.1.0]# find . -name "*.so.*" ./host-alphapca56-alpha-linux-gnu/gcc/libgcc_s.so.1.backup ./host-alphapca56-alpha-linux-gnu/gcc/libgcc_s.so.1 ./alphapca56-alpha-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.7 ./alphapca56-alpha-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6 ./alphapca56-alpha-linux-gnu/libmudflap/.libs/libmudflap.so.0.0.0 ./alphapca56-alpha-linux-gnu/libmudflap/.libs/libmudflap.so.0 ./alphapca56-alpha-linux-gnu/libmudflap/.libs/libmudflapth.so.0.0.0 ./alphapca56-alpha-linux-gnu/libmudflap/.libs/libmudflapth.so.0 ./alphapca56-alpha-linux-gnu/libssp/.libs/libssp.so.0.0.0 ./alphapca56-alpha-linux-gnu/libssp/.libs/libssp.so.0
Did I scare everyone off? I have a feeling that the GCC-4.x Fortran code may have never worked on the Alpha... I could be wrong...
Subject: Re: ../.././libgfortran/mk-kinds-h.sh: Unknown type On Tue, Mar 07, 2006 at 04:12:10AM -0000, diskman at kc dot rr dot com wrote: > > Did I scare everyone off? I have a feeling that the GCC-4.x Fortran code may > have never worked on the Alpha... I could be wrong... > The fortran code works just fine. It's gmp that is fubar. Also, note FX has told you that he build gfortran on alpha for some version of linux.
(In reply to comment #12) > Did I scare everyone off? > I have a feeling that the GCC-4.x Fortran code may > have never worked on the Alpha... I could be wrong... We have had reports of successful building on alphaev67-unknown-linux-gnu, alphaev6-unknown-linux-gnu, alpha-dec-osf4.0f. As I do personnaly have access to: HP Tru64 UNIX 5.1B AlphaServer DS15 2 EV68, 1.0GHz HP Tru64 UNIX 5.1B AlphaServer ES45 4 EV68, 1 GHz HP Tru64 UNIX 5.1B AlphaServer ES47 2 EV7, 1.0 GHz Debian GNU/Linux 3.1r0 AlphaServer DS20 2 EV6, 500 MHz FreeBSD 6.0 AlphaStation XP1000 1 EV67, 667 MHz Is any of those close enough of your own machine (I don't know alphas very well) so that I could probably reproduce your bug? Or could I build a working GMP/MPFR on any of those and send it to you for testing? Also, you did not say how you compiled your gmp "without optimization". Did you try the --target=none --host=none --build=none trick?
The closest would be the "AlphaServer DS20", mine is the EV56 [PCA56] and the DS20 is the EV6 [the very next generation]. I did manage to get GCC-4.1.0 Fortran to build, I simple 'reworked' GMP/MPFR... I built GMP with the following: CC=gcc-3.2.3 CXX=g++-3.2.3 CPP=cpp-3.2.3 \ CFLAGS="-O2 -mieee -finline -fomit-frame-pointer -mtune=ev56 -w -pipe" \ CXXFLAGS="-O2 -mieee -finline -fomit-frame-pointer -mtune=ev56 -w -pipe" \ ./configure \ --build=alpha-alpha-linux \ --prefix=/usr \ --sysconfdir=/etc \ --infodir=/usr/info \ --mandir=/usr/man \ --disable-cxx \ --disable-nails \ --disable-mpfr MPFR: CC="ccache gcc-3.2.3" CXX="ccache g++-3.2.3" CPP="ccache cpp-3.2.3" \ CFLAGS="-O2 -fno-strict-aliasing -fomit-frame-pointer -mtune=ev56 -w -pipe" \ CXXFLAGS="-O2 -fomit-frame-pointer -mtune=ev56 -w -pipe" \ ./configure \ --build=alpha-alpha-linux \ --prefix=/usr \ --sysconfdir=/etc \ --infodir=/usr/info \ --mandir=/usr/man \ --enable-shared \ --enable-mpfr Now Fortran is working as it should. Right now, at the moment, its compiling the GCJ portion of the build
Oh one other thing, I just wanted to thank everyone for pointing me in the right direction and taking the time to help me out... To everyone, thank you!
(In reply to comment #15) > I did manage to get GCC-4.1.0 Fortran to build, I simple 'reworked' > GMP/MPFR... OK. I'm closing this PR since it's not a bug in gfortran, but a mis-compilation in GMP/MPFR. > I built GMP with the following: > > CC=gcc-3.2.3 CXX=g++-3.2.3 CPP=cpp-3.2.3 \ > CFLAGS="-O2 -mieee -finline -fomit-frame-pointer -mtune=ev56 -w -pipe" \ > CXXFLAGS="-O2 -mieee -finline -fomit-frame-pointer -mtune=ev56 -w -pipe" \ > ./configure \ > --build=alpha-alpha-linux \ > --prefix=/usr \ > --sysconfdir=/etc \ > --infodir=/usr/info \ > --mandir=/usr/man \ > --disable-cxx \ > --disable-nails \ > --disable-mpfr > > MPFR: > > CC="ccache gcc-3.2.3" CXX="ccache g++-3.2.3" CPP="ccache cpp-3.2.3" \ > CFLAGS="-O2 -fno-strict-aliasing -fomit-frame-pointer -mtune=ev56 -w -pipe" \ > CXXFLAGS="-O2 -fomit-frame-pointer -mtune=ev56 -w -pipe" \ > ./configure \ > --build=alpha-alpha-linux \ > --prefix=/usr \ > --sysconfdir=/etc \ > --infodir=/usr/info \ > --mandir=/usr/man \ > --enable-shared \ > --enable-mpfr Please note that GMP/MFPR are well known for miscompiling. The GMP webpage is full of warnings that builds with non-default options (and exotic or recent compilers) are very risky. As gfortran uses GMP/MPFR only at compile time (it's not used in the generated code) and for very few tasks, I'd advise not to look for performance but for safety. CFLAGS="-O2 -mieee -finline -fomit-frame-pointer -mtune=ev56 -w -pipe" seems very risky to me, given my bad experiences with GMP.
I have just experienced exactly the same error on a NetBSD-current/i386 system. There the problem is not gmp et al.'s fault, and I can't see quite enough detail in the problem on alpha below to see that it isn't the same. My system uses ELF binaries, and I don't set half the world in LD_LIBRARY_PATH nor ld.so.conf. I have libmpfr.so.2.1 and libgmp.so.7.1 in /usr/local/lib. The error /usr/src/local/gcc/libgfortran/mk-kinds-h.sh: Unknown type happens because gfortran was compiled without -Wl,-R/usr/local/lib, so it cannot find libmpr. The top level configure accepts --with-mpfr=/usr/local --with-gmp=/usr/local, and doesn't spot any problems, as it AC_TRY_LINKs the libraries rather than AC_TRY_RUN them. gcc/configure --help mentions GMPLIBS How to link GMP but setting that environment variable (or HOST_GMPLIBS) before running the top level configure doesn't seem to help, as --with-gmp sets gmplibs, which in top level Makefile.in sets HOST_GMPLIBS, which in turn is what GMPLIBS is set to, which is what reaches gcc/Makefile.in (AFAICT) The way I worked around this is after running configure --with-gmp..., edit the top level Makefile, and set HOST_GMPLIBS to include -Wl,-R/usr/local/lib. There ought to be a more user friendly way of doing this, so I think this bug ought to be reopened...
Subject: Re: ../.././libgfortran/mk-kinds-h.sh: Unknown type On Sat, May 20, 2006 at 04:24:25PM -0000, prlw1 at cam dot ac dot uk wrote: > > > ------- Comment #18 from prlw1 at cam dot ac dot uk 2006-05-20 16:24 ------- > I have just experienced exactly the same error on a > NetBSD-current/i386 system. > There the problem is not gmp et al.'s fault, and I can't see quite enough > detail in the problem on alpha below to see that it isn't the same. > > My system uses ELF binaries, and I don't set half the world in > LD_LIBRARY_PATH nor ld.so.conf. What happens if you use LD_LIBRARY_PATH? What happens if you use the dynamic loader as intended? > There ought to be a more user friendly way of doing this, so I think > this bug ought to be reopened... I disagree with your conclusion. LD_LIBRARY_PATH and ldconfig are user friendly if you actually use the features as intended.
(In reply to comment #18) > The error > /usr/src/local/gcc/libgfortran/mk-kinds-h.sh: Unknown type > happens because gfortran was compiled without -Wl,-R/usr/local/lib, so it > cannot find libmpr. > > The top level configure accepts --with-mpfr=/usr/local --with-gmp=/usr/local, > and doesn't spot any problems, as it AC_TRY_LINKs the libraries rather than > AC_TRY_RUN them. I'll note a few things here: - what you report is why PR 21547 was opened for: when you specify --with-gmp=/usr/local, you still need to have /usr/local/lib in your LD_LIBRARY_PATH to build libgfortran - this can be both seen as a bug or a non-bug; I think it's a bug, and if deemed a feature, it should be strongly emphasized in the docs - I once proposed a patch, but top-level configury is a tough matter and we never reached a consensus on how this should be handled, so the bug is still there If you want to be kept informed of the resolution of this issue, please add yourself in the CC list of PR 21547.