2010-08-18 10 views
7

Ich versuche GCC unter Mac OS 10.5.7 zu kompilieren. Ich habe diesen Befehl GCC zu konfigurieren, nach GMP Installation MPFR und MPC:GCC kann GMP-, MPFR- und MPC-Bibliotheken nicht finden

../gcc-4.5.0/configure --target=$i586-elf --prefix=/usr/local/cross \ 
    --disable-nls \ 
    --enable-languages=c,c++,fortran,java,objc,obj-c++,treelang,ada \ 
    --without-headers --with-libiconv-prefix=/opt/local --with-gmp=/usr/local \ 
    --with-mpfr=/usr/local --with-mpc=/usr/local 

ich diesen Fehler hätte:

checking for the correct version of gmp.h... buggy but acceptable 
checking for the correct version of mpfr.h... yes 
checking for the correct version of mpc.h... yes 
checking for the correct version of the gmp/mpfr/mpc libraries... 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. 

Warum GCC die Header für GMP, MPFR und MPC finden kann, aber nicht die Bibliotheken?

+0

Ich hatte das gleiche Problem beim Versuch, Linux From Scratch zu bauen D: – Chiggins

Antwort

6

Ich vermute, dass das Problem möglicherweise die Bibliotheken für 32-Bit sind, wenn Sie versuchen, einen 64-Bit-Compiler zu erstellen, oder umgekehrt.

Ich konnte vor kurzem GCC 4.5.1 auf MacOS X 10.6.4 bauen, aber ich baute und installierte die GMP, MPFR und MPC-Bibliotheken selbst - in /usr/gnu64 (ein nicht-Standard-Speicherort, den ich für Sachen, die ich benutze installieren zu meinem eigenen Vorteil). Ich verwendete auch die Konfigurationsoption:

CC='gcc -m64' 

, um eine 64-Bit-Build zu erzwingen. Ich hatte ähnliche Probleme unter Linux (plus ein Problem mit einem Regex in opt-functions.awk - leicht zu beheben mit zwei Back-Slashes vor einer offenen Klammer) und festgestellt, dass es Updates zu den MPFR-und MPC-Bibliotheken seit ich baute auf MacOS X:

  • GMP 5.0.1 (statt 4.2.4)
  • MPC 0.8.2 (statt 0.8.1)
  • MPFR 3.0.0 (statt 2.4.2)

Seit ich dies geschrieben habe, habe ich meine Methodik etwas geändert t. Was ich jetzt mache ist in Install GNU GCC on Mac dokumentiert. Grundsätzlich bekomme ich die aktuellen Versionen von GMP, MPC, MPFR und stelle ihren Quellcode in das GCC-Quellverzeichnis und lasse GCC die Bibliotheken für sich selbst kompilieren. Dies macht GCC mit der Lokalisierung der Bibliotheken befassen.

+0

I benutzt 'CC = gcc -m64'' und es hat funktioniert – None

+2

wo hast du CC = gcc -m64 'gesetzt? Ich bin neu auf Linux ... –

+0

Einer der beiden Orte: 'CC =" gcc-m64 " '../gcc-4.5.1/configure CC =" gcc -m64 "...'. Beide arbeiten; Ich verwende es normalerweise als Umgebungsvariable (vor dem Befehl). Wenn Sie eine Meeresmuschel (tcsh, usw.) verwenden, verwenden Sie das Argument form. –

2

Ich hatte das gleiche Problem beim Versuch, gcc-4.6.0 auf OX 10.6.6 zu kompilieren. Ich benutzte gmp-4.3.2; Mit gmp-5.0.1 scheint das Konfigurationsskript "CC = gcc -std = gnu99 CFLAGS = -O2 -pedantic -m64-mtune = core2-march = core2" korrekt zu erraten und gibt es an mpfr (3.0. 1) und mpc (0.9), also sollte jeder, der diese oder neuere Versionen benutzt, diesen Fehler nicht bekommen.

5

Sie verwenden sollten

with-gmp=/usr/local/include \ 
    --with-mpfr=/usr/local/include --with-mpc=/usr/local/include 

statt

with-gmp=/usr/local \ 
    --with-mpfr=/usr/local --with-mpc=/usr/local 
+1

Das ist nicht korrekt. GCC's './Configure' Skript besagt, dass' --with-mpc = PATH' 'äquivalent zu --with-mpc-include = PATH/include plus --with-mpc-lib = PATH/lib' ist und dasselbe ist genaue Formulierung für "--with-gmp" und "--with-mpfr" – uxp

0

Mit MAC-Ports mpfr, libmpc und gmp installiert ist, konnte ich dies auf dem Configure-Skript heften:

--with-mpc=/opt/local/var/macports/software/libmpc/0.8.2_0/opt/local 
--with-gmp=/opt/local/var/macports/software/gmp/5.0.1_0/opt/local 
--with-mpfr=/opt/local/var/macports/software/mpfr/3.0.0-p8_0/opt/local 

Dies war eine Toolbox für ti msp430 zu kompilieren.

0

Ich habe gerade ein ähnliches Problem gelöst. Da meine CPU x86_64 ist, aber mein Betriebssystem 32bit ist, versuche ich, wenn ich GMP (5.0.2) installiere, in 64bit zu konfigurieren. Also habe ich mein GMP mit Konfiguration wie ABI = 32 ./configure neu kompiliert ... dann verschwand dieses GCC-Problem.

1

Ich würde vorschlagen, gmp, mpfr und mpc zu installieren, indem Sie sie von ihren Websites herunterladen und dann laufen./ Congifure (in dem Ordner, in dem die Dateien heruntergeladen) und dann machen sudo

GCC installieren dann auf OS X (Lion) mac

Beachten Sie, dass mpc hängt von mpfr und gmp

I verwendet kompilieren sollte dies zu kompilieren Ritzel Kernel auf Mac OS X

0

Hatte ähnliches Problem in Ubuntu 16.04 64 Bit. Gelöst durch mpc-1.0.1.tar.gz, mpfr-3.1.6.tar.xz und gmp-6.1.2.tar.xz

Verwandte Themen