gcc をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
前の記事 [[gcc141202]]
GCC-4.9.2 released [2014-10-30]とある。正直ディストリビュ...
最新のGCCでコンパイルすれば多少早くなるかな?って期待もあ...
まあー素直にIntel様謹製コンパイラーを使うべきなのでしょう...
っで、GCCの最新版を久々に作ってみることにした。
「Prerequisites for GCC」
https://gcc.gnu.org/install/prerequisites.html
によれば
-GNU Multiple Precision Library (GMP) version 4.3.2 (or l...
-MPFR Library version 2.4.2 (or later)
-MPC Library version 0.8.1 (or later)
-ISL Library version 0.12.2
は必須なライブラリらしい。まずはこれを調理。一応事前に
#code(nonumber){{
[root@s ~]# yum -y groupinstall "Development tools"
[root@s ~]# yum -y install dejagnu guile-devel zlib-devel
[root@s ~]# export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/op...
}}
と開発環境は整えておく。
***1.GNU Multiple Precision Library (GMP) [#r7110f9f]
本家 [[http://gmplib.org/>+http://gmplib.org/]]
#code(nonumber){{
[root@s ~]# wget ftp://ftp.gmplib.org/pub/gmp-6.0.0/gmp-6...
[root@s ~]# xz -cd gmp-6.0.0a.tar.xz | tar xf - && cd gmp...
[root@s gmp-6.0.0]# CPPFLAGS=-fexceptions ./configure --e...
[root@s gmp-6.0.0]# make; make check; make install
[root@s gmp-6.0.0]# echo "/opt/local/lib64" > /etc/ld.so....
[root@s gmp-6.0.0]# ldconfig -v
(略)
/opt/local/lib64:
libgmpxx.so.4 -> libgmpxx.so.4.4.0
libgmp.so.10 -> libgmp.so.10.2.0
(略)
[root@s gmp-6.0.0]# cd ..
[root@s ~]#
}}
***2. MPFR Library(MPFR: the Multiple Precision Floating-...
本家 [[http://www.mpfr.org/>+http://www.mpfr.org/]]
#code(nonumber){{
[root@s ~]# wget http://www.mpfr.org/mpfr-current/mpfr-3....
[root@s ~]# xz -cd mpfr-3.1.2.tar.xz | tar xf - && cd mpf...
[root@s mpfr-3.1.2]# ./configure --with-gmp-include=/opt/...
--prefix=/opt/local --libdir=/opt/local/lib64
[root@s mpfr-3.1.2]# make; make check; make install; ldco...
[root@s mpfr-3.1.2]# cd ..
[root@s ~]#
}}
&color(red){*};&size(10){ldconfigはMPC Libraryの構築の際...
***3. MPC Library( multiple-precision complex number comp...
本家 [[http://www.multiprecision.org/>+http://www.multipr...
#code(nonumber){{
[root@s ~]# wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.2.tar.gz
[root@s ~]# gzip -cd mpc-1.0.2.tar.gz | tar xf - && cd m...
[root@s mpc-1.0.2]# CPPFLAGS=-I/opt/local/include ./confi...
--with-mpfr-lib=/opt/local/lib64 --prefix=/opt/local -...
[root@s mpc-1.0.2]# make ; make check ; make install ; ld...
[root@s mpc-1.0.2]# cd ..
[root@s ~]#
}}
***4.ISL Library [#uc522ac0]
#code(nonumber){{
[root@s ~]# wget ftp://gcc.gnu.org/pub/gcc/infrastructure...
[root@s ~]# bzip2 -cd isl-0.12.2.tar.bz2 | tar xf - && cd...
[root@s isl-0.12.2]# ./configure --with-gmp-prefix==/opt/...
--prefix=/opt/local --libdir=/opt/local/lib64 --with-g...
[root@s isl-0.12.2]# make ; make check ; make install ; l...
[root@s isl-0.12.2]# cd ..
[root@s ~]#
}}
&color(red){*};&size(10){ldconfigの際、libisl.so.10.2.2-g...
***5.CLooG [#a357b3a0]
本来、ISLまでかと思っていた。っがGCC-4.9.2のコンパイルの...
本家 [[http://www.cloog.org/>+http://www.cloog.org/]]
#code(nonumber){{
[root@s ~]# wget ftp://gcc.gnu.org/pub/gcc/infrastructure...
[root@s ~]# gzip -cd cloog-0.18.1.tar.gz | tar xf - && cd...
[root@s cloog-0.18.1]# CPPFLAGS="-I/opt/local/include" ./...
--prefix=/opt/local --libdir=/opt/local/lib64 --with-isl=...
[root@s cloog-0.18.1]# make ; make check ; make install ;...
[root@s cloog-0.18.1]# cd ..
[root@s ~]#
}}
***6.autogen [#kccb9e62]
gccのmake checkに必要になります。
#code(nonumber){{
[root@s ~]# wget http://ftp.gnu.org/gnu/autogen/rel5.18.4...
[root@s ~]# xz -cd autogen-5.18.4.tar.xz | tar xf - && cd...
[root@s autogen-5.18.4]#
[root@s autogen-5.18.4]# ./configure --prefix=/opt/local ...
[root@s autogen-5.18.4]# make ; make check ; make install
[root@s autogen-5.18.4]# cd ..
[root@s ~]#
***GCC-4.9.2
必要なライブラリが揃ったので、ここで本体をコンパイル。
#code(nonumber){{
[root@s ~]# export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/op...
[root@s ~]# export LD_LIBRARY_PATH=/opt/local/lib64
[root@s ~]# wget http://ftp.riken.jp/GNU/gnu/gcc/gcc-4.9....
[root@s ~]# bzip2 -cd gcc-4.9.2.tar.bz2 | tar xf -
[root@s ~]# mkdir build-gcc492 && cd build-gcc492/
[root@s build-gcc492]#
[root@s build-gcc492]# ../gcc-4.9.2/configure \
--enable-languages=c,c++,fortran \
--enable-bootstrap \
--enable-shared \
--enable-threads=posix \
--enable-checking=release \
--with-system-zlib \
--enable-__cxa_atexit \
--enable-gnu-unique-object \
--with-gmp=/opt/local --with-gmp-include=/opt/local/inclu...
--with-mpfr=/opt/local --with-mpfr-include=/opt/local/inc...
--with-mpc=/opt/local --with-mpc-include=/opt/local/inclu...
--with-isl=/opt/local --with-isl-include=/opt/local/inclu...
--with-cloog=/opt/local --with-cloog-include=/opt/local/i...
--prefix=/opt/local/gcc492 \
--libdir=/opt/local/gcc492/lib64 \
--with-local-prefix=/opt/local/gcc492 \
--with-pkgversion="gcc-4.9.2 20141202 by chaperone" --wit...
[root@s build-gcc492]# make |tee make-log ...
[root@s build-gcc492]# make check |tee -a make-log ...
[root@s build-gcc492]# make install
}}
***使用するには [#j2e51dff]
作ったコンパイラーを使うには
#code(nonumber){{
export PATH=/opt/local/gcc492/bin:$PATH
export LD_LIBRARY_PATH=/opt/local/lib64:/opt/local/gcc492...
}}
とする。
終了行:
前の記事 [[gcc141202]]
GCC-4.9.2 released [2014-10-30]とある。正直ディストリビュ...
最新のGCCでコンパイルすれば多少早くなるかな?って期待もあ...
まあー素直にIntel様謹製コンパイラーを使うべきなのでしょう...
っで、GCCの最新版を久々に作ってみることにした。
「Prerequisites for GCC」
https://gcc.gnu.org/install/prerequisites.html
によれば
-GNU Multiple Precision Library (GMP) version 4.3.2 (or l...
-MPFR Library version 2.4.2 (or later)
-MPC Library version 0.8.1 (or later)
-ISL Library version 0.12.2
は必須なライブラリらしい。まずはこれを調理。一応事前に
#code(nonumber){{
[root@s ~]# yum -y groupinstall "Development tools"
[root@s ~]# yum -y install dejagnu guile-devel zlib-devel
[root@s ~]# export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/op...
}}
と開発環境は整えておく。
***1.GNU Multiple Precision Library (GMP) [#r7110f9f]
本家 [[http://gmplib.org/>+http://gmplib.org/]]
#code(nonumber){{
[root@s ~]# wget ftp://ftp.gmplib.org/pub/gmp-6.0.0/gmp-6...
[root@s ~]# xz -cd gmp-6.0.0a.tar.xz | tar xf - && cd gmp...
[root@s gmp-6.0.0]# CPPFLAGS=-fexceptions ./configure --e...
[root@s gmp-6.0.0]# make; make check; make install
[root@s gmp-6.0.0]# echo "/opt/local/lib64" > /etc/ld.so....
[root@s gmp-6.0.0]# ldconfig -v
(略)
/opt/local/lib64:
libgmpxx.so.4 -> libgmpxx.so.4.4.0
libgmp.so.10 -> libgmp.so.10.2.0
(略)
[root@s gmp-6.0.0]# cd ..
[root@s ~]#
}}
***2. MPFR Library(MPFR: the Multiple Precision Floating-...
本家 [[http://www.mpfr.org/>+http://www.mpfr.org/]]
#code(nonumber){{
[root@s ~]# wget http://www.mpfr.org/mpfr-current/mpfr-3....
[root@s ~]# xz -cd mpfr-3.1.2.tar.xz | tar xf - && cd mpf...
[root@s mpfr-3.1.2]# ./configure --with-gmp-include=/opt/...
--prefix=/opt/local --libdir=/opt/local/lib64
[root@s mpfr-3.1.2]# make; make check; make install; ldco...
[root@s mpfr-3.1.2]# cd ..
[root@s ~]#
}}
&color(red){*};&size(10){ldconfigはMPC Libraryの構築の際...
***3. MPC Library( multiple-precision complex number comp...
本家 [[http://www.multiprecision.org/>+http://www.multipr...
#code(nonumber){{
[root@s ~]# wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.2.tar.gz
[root@s ~]# gzip -cd mpc-1.0.2.tar.gz | tar xf - && cd m...
[root@s mpc-1.0.2]# CPPFLAGS=-I/opt/local/include ./confi...
--with-mpfr-lib=/opt/local/lib64 --prefix=/opt/local -...
[root@s mpc-1.0.2]# make ; make check ; make install ; ld...
[root@s mpc-1.0.2]# cd ..
[root@s ~]#
}}
***4.ISL Library [#uc522ac0]
#code(nonumber){{
[root@s ~]# wget ftp://gcc.gnu.org/pub/gcc/infrastructure...
[root@s ~]# bzip2 -cd isl-0.12.2.tar.bz2 | tar xf - && cd...
[root@s isl-0.12.2]# ./configure --with-gmp-prefix==/opt/...
--prefix=/opt/local --libdir=/opt/local/lib64 --with-g...
[root@s isl-0.12.2]# make ; make check ; make install ; l...
[root@s isl-0.12.2]# cd ..
[root@s ~]#
}}
&color(red){*};&size(10){ldconfigの際、libisl.so.10.2.2-g...
***5.CLooG [#a357b3a0]
本来、ISLまでかと思っていた。っがGCC-4.9.2のコンパイルの...
本家 [[http://www.cloog.org/>+http://www.cloog.org/]]
#code(nonumber){{
[root@s ~]# wget ftp://gcc.gnu.org/pub/gcc/infrastructure...
[root@s ~]# gzip -cd cloog-0.18.1.tar.gz | tar xf - && cd...
[root@s cloog-0.18.1]# CPPFLAGS="-I/opt/local/include" ./...
--prefix=/opt/local --libdir=/opt/local/lib64 --with-isl=...
[root@s cloog-0.18.1]# make ; make check ; make install ;...
[root@s cloog-0.18.1]# cd ..
[root@s ~]#
}}
***6.autogen [#kccb9e62]
gccのmake checkに必要になります。
#code(nonumber){{
[root@s ~]# wget http://ftp.gnu.org/gnu/autogen/rel5.18.4...
[root@s ~]# xz -cd autogen-5.18.4.tar.xz | tar xf - && cd...
[root@s autogen-5.18.4]#
[root@s autogen-5.18.4]# ./configure --prefix=/opt/local ...
[root@s autogen-5.18.4]# make ; make check ; make install
[root@s autogen-5.18.4]# cd ..
[root@s ~]#
***GCC-4.9.2
必要なライブラリが揃ったので、ここで本体をコンパイル。
#code(nonumber){{
[root@s ~]# export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/op...
[root@s ~]# export LD_LIBRARY_PATH=/opt/local/lib64
[root@s ~]# wget http://ftp.riken.jp/GNU/gnu/gcc/gcc-4.9....
[root@s ~]# bzip2 -cd gcc-4.9.2.tar.bz2 | tar xf -
[root@s ~]# mkdir build-gcc492 && cd build-gcc492/
[root@s build-gcc492]#
[root@s build-gcc492]# ../gcc-4.9.2/configure \
--enable-languages=c,c++,fortran \
--enable-bootstrap \
--enable-shared \
--enable-threads=posix \
--enable-checking=release \
--with-system-zlib \
--enable-__cxa_atexit \
--enable-gnu-unique-object \
--with-gmp=/opt/local --with-gmp-include=/opt/local/inclu...
--with-mpfr=/opt/local --with-mpfr-include=/opt/local/inc...
--with-mpc=/opt/local --with-mpc-include=/opt/local/inclu...
--with-isl=/opt/local --with-isl-include=/opt/local/inclu...
--with-cloog=/opt/local --with-cloog-include=/opt/local/i...
--prefix=/opt/local/gcc492 \
--libdir=/opt/local/gcc492/lib64 \
--with-local-prefix=/opt/local/gcc492 \
--with-pkgversion="gcc-4.9.2 20141202 by chaperone" --wit...
[root@s build-gcc492]# make |tee make-log ...
[root@s build-gcc492]# make check |tee -a make-log ...
[root@s build-gcc492]# make install
}}
***使用するには [#j2e51dff]
作ったコンパイラーを使うには
#code(nonumber){{
export PATH=/opt/local/gcc492/bin:$PATH
export LD_LIBRARY_PATH=/opt/local/lib64:/opt/local/gcc492...
}}
とする。
ページ名:
1