I need to compare performance of various C,C++, Fortran,Go and ADA compiler. So I need to install or build various version of GCC compilers. Installing from apt is easier but not all versions are available from apt.
Most gcc is in C/C++, so we need to install any gcc compiler
To build Ada compiler (gnat), we need other Ada compiler. Hence we install any gnat version.
Clone gcc github repository. Only need to do once. When building each gcc version, we need only to clone from this local repository.
git clone https://github.com/gcc-mirror/gcc
Some gcc versions can only be built on a specific Ubuntu version. Here is the summary result of compiling gcc in various Ubuntu versions. Old versions can only be built on Ubuntu 16.04. Modern versions can be built/compiled on Ubuntu 20.04
Summary
GCC Version
Ubuntu 16.04
Ubuntu 18.04
Ubuntu 20.04
GCC 4.9.3 (gnat)
install from apt
GCC 5.1.0
build ok
build fail
build fail
GCC 5.2.0
build fail
build fail
GCC 5.3.0
build fail
build fail
GCC 5.4.0
install from apt
build fail
build fail
GCC 5.5.0
install from apt
build fail
GCC 6.1.0
build fail
build fail
GCC 6.2.0
(building)
build fail
build fail
GCC 6.3.0
build fail
build fail
GCC 6.4.0
build fail
build fail
GCC 6.5.0
apt not available
install from apt
build fail
GCC 7.1.0
build ok
build fail
build fail
GCC 7.2.0
build ok
build fail
GCC 7.3.0
build ok
build fail
GCC 7.4.0
build ok
build fail
GCC 7.5.0
install from apt
install from apt
GCC 8.1.0
build ok
build fail
GCC 8.2.0
build ok
build fail
GCC 8.3.0
build ok
build fail
GCC 8.4.0
install from apt
install from apt
GCC 8.5.0
build ok
build ok
GCC 9.1.0
build ok
build fail
GCC 9.2.0
build ok
build fail
GCC 9.3.0
(building)
???
GCC 9.4.0
apt not available
install from apt
GCC 9.5.0
build ok
GCC 10.1.0
build ok
GCC 10.2.0
build ok
GCC 10.3.0
build ok
GCC 10.4.0
apt not available
build ok
GCC 11.1.0
build ok
GCC 11.2.0
build ok
GCC 11.3.0
apt not available
apt
GCC 12.1.0
build ok
GCC 12.2.0
apt not available
build ok
cd ~
git clone https://github.com/gcc-mirror/gcc
GCC 5.1.0
Install gcc 5.1.0 in Ubuntu 18.04
gnatgcc version 6.5.0
gcc version 6.5.0
cd ~
mkdir gcc-5.1
cd gcc-5.1
mkdir build
git clone ../gcc
cd gcc
git checkout releases/gcc-5.1.0
contrib/download_prerequisites
cd ../build
../gcc/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-5.1 --enable-checking=release --enable-languages=c,c++,fortran,go,ada --disable-multilib --program-suffix=-5.1 CC=gnatgcc
make
make install
Build failed with the following message:
In file included from ../../gcc/gcc/cp/except.c:1023:0:
cfns.gperf: In function ‘const char* libc_name_p(const char*, unsigned int)’:
cfns.gperf:101:1: error: ‘const char* libc_name_p(const char*, unsigned int)’ redeclared inline with ‘gnu_inline’ attribute
cfns.gperf:26:14: note: ‘const char* libc_name_p(const char*, unsigned int)’ previously declared here
cfns.gperf: At global scope:
cfns.gperf:26:14: warning: inline function ‘const char* libc_name_p(const char*, unsigned int)’ used but never defined
Discussion of the problem: https://stackoverflow.com/questions/41204632/unable-to-build-gcc-due-to-c11-errors
GCC 5.2.0
cd ~
mkdir gcc-5.2
cd gcc-5.2
mkdir build
git clone ../gcc
cd gcc
git checkout releases/gcc-5.2.0
contrib/download_prerequisites
cd ../build
../gcc/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-5.2 --enable-checking=release --enable-languages=c,c++,fortran,go,ada --disable-multilib --program-suffix=-5.2 CC=gnatgcc
make -j 8
make install
Error
x86_64-linux-gnu-g++ -c -DIN_GCC_FRONTEND -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -Icp -I../../gcc/gcc -I../../gcc/gcc/cp -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I/root/gcc-5.2/build/./gmp -I/root/gcc-5.2/gcc/gmp -I/root/gcc-5.2/build/./mpfr -I/root/gcc-5.2/gcc/mpfr -I/root/gcc-5.2/gcc/mpc/src -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/gcc/../libbacktrace -I/root/gcc-5.2/build/./isl/include -I/root/gcc-5.2/gcc/isl/include -o cp/except.o -MT cp/except.o -MMD -MP -MF cp/.deps/except.TPo ../../gcc/gcc/cp/except.c
In file included from ./tm.h:27:0,
from ../../gcc/gcc/cp/except.c:27:
../../gcc/gcc/config/elfos.h:102:21: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\
^
../../gcc/gcc/config/elfos.h:170:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
^
In file included from ./tm.h:48:0,
from ../../gcc/gcc/cp/except.c:27:
../../gcc/gcc/defaults.h:126:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
^
In file included from ../../gcc/gcc/cp/except.c:1023:0:
cfns.gperf: In function ‘const char* libc_name_p(const char*, unsigned int)’:
cfns.gperf:101:1: error: ‘const char* libc_name_p(const char*, unsigned int)’ redeclared inline with ‘gnu_inline’ attribute
cfns.gperf:26:14: note: ‘const char* libc_name_p(const char*, unsigned int)’ previously declared here
cfns.gperf: At global scope:
cfns.gperf:26:14: warning: inline function ‘const char* libc_name_p(const char*, unsigned int)’ used but never defined
Makefile:1065: recipe for target 'cp/except.o' failed
make[3]: *** [cp/except.o] Error 1
GCC 5.3.0
cd ~
mkdir gcc-5.3
cd gcc-5.3
mkdir build
git clone ../gcc
cd gcc
git checkout releases/gcc-5.3.0
contrib/download_prerequisites
cd ../build
../gcc/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-5.3 --enable-checking=release --enable-languages=c,c++,fortran,go,ada --disable-multilib --program-suffix=-5.3 CC=gnatgcc
make -j 8
make install
Result: compile fail on Ubuntu 18.04
x86_64-linux-gnu-g++ -c -DIN_GCC_FRONTEND -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -Icp -I../../gcc/gcc -I../../gcc/gcc/cp -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I/root/gcc-5.3/build/./gmp -I/root/gcc-5.3/gcc/gmp -I/root/gcc-5.3/build/./mpfr -I/root/gcc-5.3/gcc/mpfr -I/root/gcc-5.3/gcc/mpc/src -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/gcc/../libbacktrace -I/root/gcc-5.3/build/./isl/include -I/root/gcc-5.3/gcc/isl/include -o cp/except.o -MT cp/except.o -MMD -MP -MF cp/.deps/except.TPo ../../gcc/gcc/cp/except.c
In file included from ./tm.h:27:0,
from ../../gcc/gcc/cp/except.c:27:
../../gcc/gcc/config/elfos.h:102:21: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\
^
../../gcc/gcc/config/elfos.h:170:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
^
In file included from ./tm.h:48:0,
from ../../gcc/gcc/cp/except.c:27:
../../gcc/gcc/defaults.h:126:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
^
In file included from ../../gcc/gcc/cp/except.c:1023:0:
cfns.gperf: In function ‘const char* libc_name_p(const char*, unsigned int)’:
cfns.gperf:101:1: error: ‘const char* libc_name_p(const char*, unsigned int)’ redeclared inline with ‘gnu_inline’ attribute
cfns.gperf:26:14: note: ‘const char* libc_name_p(const char*, unsigned int)’ previously declared here
cfns.gperf: At global scope:
cfns.gperf:26:14: warning: inline function ‘const char* libc_name_p(const char*, unsigned int)’ used but never defined
Makefile:1065: recipe for target 'cp/except.o' failed
GCC 5.4.0
cd ~
mkdir gcc-5.4
cd gcc-5.4
mkdir build
git clone ../gcc
cd gcc
git checkout releases/gcc-5.4.0
contrib/download_prerequisites
cd ../build
../gcc/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-5.4 --enable-checking=release --enable-languages=c,c++,fortran,go,ada --disable-multilib --program-suffix=-5.4 CC=gnatgcc
make -j 8
make install
cd /root
mkdir build-8.1
cd build-8.1
mkdir build
git clone ../gcc
cd gcc
git checkout releases/gcc-8.1.0
contrib/download_prerequisites
cd ../build
../gcc/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-8.1 --enable-checking=release --enable-languages=c,c++,fortran,go,ada --disable-multilib --program-suffix=-8.1 CC=gnatgcc
make -j 8
make install
It works in Ubuntu 18.04
Fails in Ubuntu 20.04
GCC 8.2.0
#instalasi gcc 8.2
cd /root
mkdir build-8.2
cd build-8.2
mkdir build
git clone ../gcc
cd gcc
git checkout releases/gcc-8.2.0
contrib/download_prerequisites
cd ../build
../gcc/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-8.2 --enable-checking=release --enable-languages=c,c++,fortran,go,ada --disable-multilib --program-suffix=-8.2 CC=gnatgcc
make -j 8
make install
It works in Ubuntu 18.04
Fails in Ubuntu 20.04
GCC 8.3.0
cd /root
mkdir build-8.3
cd build-8.3
mkdir build
git clone ../gcc
cd gcc
git checkout releases/gcc-8.3.0
contrib/download_prerequisites
cd ../build
../gcc/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-8.3 --enable-checking=release --enable-languages=c,c++,fortran,go,ada --disable-multilib --program-suffix=-8.3 CC=gnatgcc
make -j 8
make install
It works in Ubuntu 18.04
Fails in Ubuntu 20.04
GCC 8.4.0
available on apt
cd /root
mkdir build-8.4
cd build-8.4
mkdir build
git clone ../gcc
cd gcc
git checkout releases/gcc-8.4.0
contrib/download_prerequisites
cd ../build
../gcc/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-8.4 --enable-checking=release --enable-languages=c,c++,fortran,go,ada --disable-multilib --program-suffix=-8.4 CC=gnatgcc
make
make install
GCC-8.5.0
cd /root
mkdir gcc-8.5
cd gcc-8.5
mkdir build
git clone ../gcc
cd gcc
git checkout releases/gcc-8.5.0
contrib/download_prerequisites
cd ../build
../gcc/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-8.5 --enable-checking=release --enable-languages=c,c++,fortran,go,ada --disable-multilib --program-suffix=-8.5 CC=gnatgcc
make
make install
GCC 9.1.0
Ubuntu 20.04: error
glibc make[4]: *** No rule to make target '../libbacktrace/libbacktrace.la', needed by
GCC 9.2.0
cd ~
mkdir gcc-9.2
cd gcc-9.2
mkdir build
git clone ../gcc
cd gcc
git checkout releases/gcc-9.2.0
contrib/download_prerequisites
cd ../build
../gcc/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-9.2 --enable-checking=release --enable-languages=c,c++,fortran,go,ada --disable-multilib --program-suffix=-9.2 CC=gnatgcc
make -j 8
make install
GCC 9.3.0
Successfull build in Ubuntu 20.04
Procedure:
cd
mkdir gcc-9.3
cd gcc-9.3
git clone ../gcc
cd gcc
git checkout releases/gcc-9.3.0
contrib/download_prerequisites
cd ..
mkdir build
cd build
../gcc/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-9.3 --enable-checking=release --enable-languages=c,c++,fortran,go,ada --disable-multilib --program-suffix=-9.3 CC=gnatgcc
make
make install
GCC 9.4.0
GCC 9.5.0
GCC 10.1.0
GCC 10.2.0
GCC 10.3.0
GCC 10.4.0
GCC 11.1.0
GCC 11.2.0
GCC 11.3.0
GCC 12.1.0
cd
mkdir gcc-12.1
cd gcc-12.1
mkdir build
git clone ../gcc
cd gcc
git checkout releases/gcc-12.1.0
contrib/download_prerequisites
cd ../build
../gcc/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-12.1 --enable-checking=release --enable-languages=c,c++,fortran,go,ada --disable-multilib --program-suffix=-12.1 CC=gnatgcc
make -j 8
make install
GCC 12.2.0
cd
mkdir build-12.2
cd build-12.2
mkdir build
git clone ../gcc
cd gcc
git checkout releases/gcc-12.2.0
contrib/download_prerequisites
cd ../build
../gcc/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-12.2 --enable-checking=release --enable-languages=c,c++,fortran,go,ada --disable-multilib --program-suffix=-12.2 CC=gnatgcc
make -j 8
make install
The Merge
Eventually the current Ethereum Mainnet will "merge" with the beacon chain proof-of-stake system.
This will mark the end of proof-of-work for Ethereum, and the full transition to proof-of-stake.
This is planned to precede the roll out of shard chains.
We formerly referred to this as "the docking."
This upgrade represents the official switch to proof-of-stake consensus. This eliminates the need for energy-intensive mining, and instead secures the network using staked ether. A truly exciting step in realizing the Ethereum vision – more scalability, security, and sustainability.
There are several incorrect labels in Global Wheat Head Dataset 2021. Some images are annotated in their original size. After that, the images are resized to final size (1024×1024 pixels). As the result, the bounding boxes are a little bit off.
To correct the annotation, the coordinates must be multiplied by a correction factor and shifted a little bit downward. Here is the comparison between original annotation (green) and corrected annotation (red).