0

Red Hat Enterprise Linux は初めてです。Red Hat Enterprise Linux 6.5 で gcc 4.8.2 をコンパイル中に問題が発生しました。GNU Web サイトからソース コードをダウンロードしました。このリンクの手順に従いました http://gcc.gnu.org/wiki/InstallingGCC 起動されるコマンドは次のとおりです。

tar xzf gcc-4.6.2.tar.gz
cd gcc-4.6.2
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.8.2/configure 

checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for libatomic support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ accepts -static-libstdc++ -static-libgcc... no
checking for gnatbind... gnatbind
checking for gnatmake... gnatmake
checking whether compiler driver understands Ada... yes
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
checking for the correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations.  Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/.  See also
http://gcc.gnu.org/install/prerequisites.html for additional info.  If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files.  They may be located in separate packages.

Googleで調査したところ、このhttp://gcc.gnu.org/ml/gcc-help/2012-02/msg00142.htmlに関連する次の質問 が見つかりましたが、以前に見つけてたどった上記のリンクに再びリダイレクトされました。

この問題の進め方についてガイダンスが必要です。提案は大歓迎です。

4

2 に答える 2

9

RHEL 6 で gcc 4.8.2 を使用する公式の方法は、Red Hat Developer Toolset (yum install devtoolset-2) をインストールすることです。これを使用するには、以下のいずれかのサブスクリプションが必要です。

  • Red Hat Enterprise Linux 開発者サポート、プロフェッショナル
  • Red Hat Enterprise Linux 開発者サポート、エンタープライズ
  • Red Hat Enterprise Linux 開発者スイート
  • Red Hat Enterprise Linux 開発者ワークステーション、プロフェッショナル
  • Red Hat Enterprise Linux 開発者ワークステーション、エンタープライズ
  • 30 日間セルフサポートの Red Hat Enterprise Linux Developer Workstation 評価
  • 60 日間サポートされる Red Hat Enterprise Linux Developer Workstation の評価
  • 90 日間サポートされる Red Hat Enterprise Linux Developer Workstation の評価
  • 1 年間のサポート対象外のパートナー評価 Red Hat Enterprise Linux
  • 1 年間のサポート対象外 Red Hat Advanced Partner サブスクリプション

次のコマンドを実行して、これらのサブスクリプションがあるかどうかを確認できます。

subscription-manager list --available

subscription-manager list --consumed.

これらのサブスクリプションのいずれも持っていない場合、「yum install devtoolset-2」は成功しません。ただし、幸いなことに、cern は、RHEL 6 でも使用できる SLC6 用の「バックドア」を提供しています。ルート経由で 3 行以下を実行すると、それを取得できるはずです。

wget -O /etc/yum.repos.d/slc6-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc6-devtoolset.repo

wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-cern http://ftp.scientificlinux.org/linux/scientific/5x/x86_64/RPM-GPG-KEYs/RPM-GPG-KEY-cern

yum install devtoolset-2

完全に完了すると、新しい開発パッケージが /opt/rh/devtoolset-2/root/ にあるはずです。

于 2016-01-29T21:53:49.100 に答える