Build gcc-7.1.0 gcc-7.1.0ビルド

I'll keep gcc to the latest version. gccを最新版にしておこう。
By the way, the current gcc version of debian jessie is 4.9.2.
ちなみに、debian jessie の現在のgccのバージョンは4.9.2 である。

gmp-6.1.2 mpfr-3.1.5 mpc-1.0.3 は更新されていない

gmp-6.1.2, mpfr-3.1.5, and mpc-1.0.3 are not updated, use the last build as it is.
ので前回Buildしたのをそのまま使う。

Build gcc-7.1.0 gcc-7.1.0ビルド

root@jesse:~# apt-get update
root@jesse:~# apt-get upgrade
root@jesse:~# uname -a
Linux jesse 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u2 (2017-06-26) x86_64 GNU/Linux
root@jesse:~# gcc --version
gcc (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@jesse:~# wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-7.1.0/gcc-7.1.0.tar.bz2
root@jesse:~# tar xf gcc-7.1.0.tar.bz2
root@jesse:~# cd gcc-7.1.0
root@jesse:~/gcc-7.1.0# mkdir build
root@jesse:~/gcc-7.1.0# cd build
root@jesse:~/gcc-7.1.0/build# ../configure --prefix=/usr/local/gcc-7.1.0 --with-gmp=/usr/local/gmp-6.1.2 --with-mpfr=/usr/local/mpfr-3.1.5 --with-mpc=/usr/local/mpc-1.0.3 --disable-multilib --enable-languages=c,c++
root@jesse:~/gcc-7.1.0/build# make -j 8
root@jesse:~/gcc-7.1.0/build# make check
root@jesse:~/gcc-7.1.0/build# make install
root@jesse:~/gcc-7.1.0/build# make clean
root@jesse:~/gcc-7.1.0/build# cd ../..

Version check and symbolic link create

バージョン確認とシンボリックリンク作成

root@jesse:~# /usr/local/gCC-7.1.0/bin/gCC --version
gcc (GCC) 7.1.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@jesse:~# ln -s /usr/local/gcc-7.1.0/bin/gcc /usr/local/bin/gcc-7.1.0
root@jesse:~# gcc-7.1.0 --version
gcc-7.1.0 (GCC) 7.1.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

*Annotation: /bin/gc c --> /bin/gcc(Half size).
Somehow, an error occurs in PHP.
*注: /bin/gc c --> /bin/gcc(半角).
何故か、PHPでエラーが起こる。

Operation check 動作確認

root@jesse:~# cat hello.c
#include    <stdio.h>

int main (int argc,  char *argv[]) {

printf("Hello gcc-%d.%d.%d\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);

}

root@jesse:~# gcc-7.1.0 -ohello hello.c
root@jesse:~# ./hello
Hello gcc-7.1.0

Gargle with one million digits of pi.

百万桁の円周率でうがい

hiroaki@jesse:~/suzuki$ cat makefile
CC=gcc-7.1.0
OPT= -static -O3 -m64 -mtune=amdfam10 -fopenmp -g
GMP505=gmp-5.0.5
GMP505_INC=-I/usr/local/$(GMP505)/include
GMP505_LIB=/usr/local/$(GMP505)/lib/libgmp.a
GMP510=gmp-5.1.0
GMP510_INC=-I/usr/local/$(GMP510)/include
GMP510_LIB=/usr/local/$(GMP510)/lib/libgmp.a
GMP512=gmp-5.1.2
GMP512_INC=-I/usr/local/$(GMP512)/include
GMP512_LIB=/usr/local/$(GMP512)/lib/libgmp.a
GMP513=gmp-5.1.3
GMP513_INC=-I/usr/local/$(GMP513)/include
GMP513_LIB=/usr/local/$(GMP513)/lib/libgmp.a
GMP600=gmp-6.0.0
GMP600_INC=-I/usr/local/$(GMP600)/include
GMP600_LIB=/usr/local/$(GMP600)/lib/libgmp.a
GMP610=gmp-6.1.0
GMP610_INC=-I/usr/local/$(GMP610)/include
GMP610_LIB=/usr/local/$(GMP610)/lib/libgmp.a
GMP611=gmp-6.1.1
GMP611_INC=-I/usr/local/$(GMP611)/include
GMP611_LIB=/usr/local/$(GMP611)/lib/libgmp.a
GMP612=gmp-6.1.2
GMP612_INC=-I/usr/local/$(GMP612)/include
GMP612_LIB=/usr/local/$(GMP612)/lib/libgmp.a
SRC= pi.c 
EXE= pi

.PHONY: clean

all: $(EXE)

pi: $(SRC)
        $(CC) $(OPT) $(GMP611_INC) $(SRC) -o $(EXE) $(GMP611_LIB)

pi505: $(SRC)
        $(CC) $(OPT) $(GMP505_INC) $(SRC) -o $(EXE)505 $(GMP505_LIB)

pi510: $(SRC)
        $(CC) $(OPT) $(GMP510_INC) $(SRC) -o $(EXE)510 $(GMP510_LIB)

pi512: $(SRC)
        $(CC) $(OPT) $(GMP512_INC) $(SRC) -o $(EXE)512 $(GMP512_LIB)

pi513: $(SRC)
        $(CC) $(OPT) $(GMP513_INC) $(SRC) -o $(EXE)513 $(GMP513_LIB)

pi600: $(SRC)
        $(CC) $(OPT) $(GMP600_INC) $(SRC) -o $(EXE)600 $(GMP600_LIB)

pi610: $(SRC)
        $(CC) $(OPT) $(GMP610_INC) $(SRC) -o $(EXE)610 $(GMP610_LIB)

pi611: $(SRC)
        $(CC) $(OPT) $(GMP611_INC) $(SRC) -o $(EXE)611 $(GMP611_LIB)

pi612: $(SRC)
        $(CC) $(OPT) $(GMP612_INC) $(SRC) -o $(EXE)612 $(GMP612_LIB)

clean:
        rm -f pi
        rm -f pi505
        rm -f pi510
        rm -f pi512
        rm -f pi513
        rm -f pi600
        rm -f pi610
        rm -f pi611
        rm -f pi612

hiroaki@jesse:~/suzuki$ make pi505
gcc-7.1.0 -static -O3 -m64 -mtune=amdfam10 -fopenmp -g -I/usr/local/gmp-5.0.5/include pi.c  -o pi505 /usr/local/gmp-5.0.5/lib/libgmp.a
hiroaki@jesse:~/suzuki$ make pi510
gcc-7.1.0 -static -O3 -m64 -mtune=amdfam10 -fopenmp -g -I/usr/local/gmp-5.1.0/include pi.c  -o pi510 /usr/local/gmp-5.1.0/lib/libgmp.a
hiroaki@jesse:~/suzuki$ make pi512
gcc-7.1.0 -static -O3 -m64 -mtune=amdfam10 -fopenmp -g -I/usr/local/gmp-5.1.2/include pi.c  -o pi512 /usr/local/gmp-5.1.2/lib/libgmp.a
hiroaki@jesse:~/suzuki$ make pi513
gcc-7.1.0 -static -O3 -m64 -mtune=amdfam10 -fopenmp -g -I/usr/local/gmp-5.1.3/include pi.c  -o pi513 /usr/local/gmp-5.1.3/lib/libgmp.a
hiroaki@jesse:~/suzuki$ make pi600
gcc-7.1.0 -static -O3 -m64 -mtune=amdfam10 -fopenmp -g -I/usr/local/gmp-6.0.0/include pi.c  -o pi600 /usr/local/gmp-6.0.0/lib/libgmp.a
hiroaki@jesse:~/suzuki$ make pi610
gcc-7.1.0 -static -O3 -m64 -mtune=amdfam10 -fopenmp -g -I/usr/local/gmp-6.1.0/include pi.c  -o pi610 /usr/local/gmp-6.1.0/lib/libgmp.a
hiroaki@jesse:~/suzuki$ make pi611
gcc-7.1.0 -static -O3 -m64 -mtune=amdfam10 -fopenmp -g -I/usr/local/gmp-6.1.1/include pi.c  -o pi611 /usr/local/gmp-6.1.1/lib/libgmp.a
hiroaki@jesse:~/suzuki$ make pi612
gcc-7.1.0 -static -O3 -m64 -mtune=amdfam10 -fopenmp -g -I/usr/local/gmp-6.1.2/include pi.c  -o pi612 /usr/local/gmp-6.1.2/lib/libgmp.a
hiroaki@jesse:~/suzuki$ time ./pi505 >/dev/null
with gcc-7.1.0, gmp-5.0.5

real0m1.701s
user0m1.608s
sys0m0.092s
hiroaki@jesse:~/suzuki$ time ./pi510 >/dev/null
with gcc-7.1.0, gmp-5.1.0

real0m1.631s
user0m1.540s
sys0m0.088s
hiroaki@jesse:~/suzuki$ time ./pi512 >/dev/null
with gcc-7.1.0, gmp-5.1.2

real0m1.628s
user0m1.552s
sys0m0.072s
hiroaki@jesse:~/suzuki$ time ./pi513 >/dev/null
with gcc-7.1.0, gmp-5.1.3

real0m1.589s
user0m1.520s
sys0m0.068s
hiroaki@jesse:~/suzuki$ time ./pi600 >/dev/null
with gcc-7.1.0, gmp-6.0.0

real0m1.510s
user0m1.448s
sys0m0.060s
hiroaki@jesse:~/suzuki$ time ./pi610 >/dev/null
with gcc-7.1.0, gmp-6.1.0

real0m1.314s
user0m1.264s
sys0m0.048s
hiroaki@jesse:~/suzuki$ time ./pi611 >/dev/null
with gcc-7.1.0, gmp-6.1.1

real0m1.345s
user0m1.264s
sys0m0.076s
hiroaki@jesse:~/suzuki$ time ./pi612 >/dev/null
with gcc-7.1.0, gmp-6.1.2

real0m1.308s
user0m1.244s
sys0m0.060s
hiroaki@jesse:~/suzuki$ 
Wow! It became a little faster? That's within the range of error.
おっ! ちょびっと速くなった? 誤差の範囲内だな。

T: Y: ALL: Online:
ThemeSwitch
  • Basic
Created in 0.0794 sec.
prev
2024.12
next
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
 
strawberry-linux geigercounter Ver.2
Sibasaki, Cyofu City, Tokyo, JAPAN
blogBar