Nice programing

GCC를 빌드하려면 GMP 4.2+, MPFR 2.3.1+ 및 MPC 0.8.0+가 필요합니다.

nicepro 2020. 12. 13. 11:05
반응형

GCC를 빌드하려면 GMP 4.2+, MPFR 2.3.1+ 및 MPC 0.8.0+가 필요합니다.


http://www.netgull.com/gcc/releases/gcc-4.5.0/ 에서 GCC 4.5를 다운로드 했지만 설정 / 빌드하려고하면 아래 오류가 발생합니다.

Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1040> /x/home/prakash_satya/shared_scripts/bin/gcc/gcc-4.5.0/configure CC="gcc -m64" --prefix=/x/home/prakash_satya/shared_scripts/bin/gcc/gcc-4.5.0 --with-gmp-lib=/usr/lib64 --with-mpfr-lib=/usr/lib64 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-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 gcc... gcc -m64
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 -m64 accepts -g... yes
checking for gcc -m64 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 for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
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.3.1+ 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.
Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1041>

다음 libs는 각 디렉토리에 있습니다.

/usr/lib/libgmp.a
/usr/lib64/libgmp.a

/usr/lib/libmpfr.a
/usr/lib64/libmpfr.a

상자에 libmpc.a 라이브러리가 설치되어 있지 않습니다.

오류를 기반으로 어떻게 알 수 있습니까?

a) libgmp.a 및 libmpfr.a의 현재 버전이 설치되어 있습니다.

b) 잘못된 버전 인 경우 현재 버전을 방해하지 않고 내 버전을 배포하려면 어떻게해야합니까?


해당 라이브러리가 설치된 디렉토리 ( /usr/gnu64/lib) 에는 읽을 수있는 텍스트가 포함 libgmp.la파일 (및 libmpc.lalibmpfr.la파일)도 있습니다. SO 버전 정보는 거기에 있지만 '제품 버전'과는 완전히 다릅니다. 대신 링크 호환성에 대해 알려줍니다.

내가 가지고있는 버전을 조사하려고했는데 내가 생각 해낸 이상한 해결책은 -v옵션으로 구축 한 GCC (4.6.1)를 실행하는 것이 었습니다 . 부분적으로 다음과 같이 말했습니다.

GNU C (GCC) version 4.6.1 (x86_64-apple-darwin11.1.0)
    compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.0, MPC version 0.8.2
warning: GMP header version 5.0.1 differs from library version 5.0.2.
warning: MPFR header version 3.0.0 differs from library version 3.1.0.
warning: MPC header version 0.8.2 differs from library version 0.9.

따라서 GMP 5.0.2가 설치되어있는 것 같습니다 (하지만 5.0.1로 GCC를 빌드했습니다), MPFR 3.1.0 (하지만 3.0.0으로 GCC를 빌드했습니다) 및 MPC 0.9 (0.8.2로 GCC를 빌드했습니다) ). GCC 4.6.2를 컴파일하고 설치하려고했고 아마도 최신 버전이 필요했기 때문에 불일치가 발생했습니다. (성공하지 못했지만 다른 이야기입니다.)

I install my custom-built libraries in /usr/gnu64/lib, and then tell GCC that's where to find them with the configure options --with-mpfr=/usr/gnu64/lib, --with-gmp=/usr/gnu64/lib, --with-mpc=/usr/gnu/64/lib. These paths are hard-wired into GCC and it works from there.


Inside the gcc directory, do this command:

./contrib/download_prerequisites

After that script, GMP, MPFR, and MPC will be ready to use. Continue with ./configure.


I had the same problem trying to install/compile GCC 4.8.1. Here is how I solved:

In Debian, just run this two commands:

apt-get install libmpc-dev
./configure

I had the same problem compiling GCC 4.9 branch.

For Red Hat and Fedora based systems, run the following command:

sudo yum install gmp gmp-devel mpfr mpfr-devel libmpc libmpc-devel

This will install the GNU multiple-precision (MP) libraries for integer, floating point, and complex numbers.

참고URL : https://stackoverflow.com/questions/9253695/building-gcc-requires-gmp-4-2-mpfr-2-3-1-and-mpc-0-8-0

반응형