- 主题:【已解决】安装GCC
已经安装了mpc mpfr 和gmp怎么configure gcc还是显示,再次配置时已经with了这三个
checking for the correct version of gmp.h... yes
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.
GCC是11.2.0
mpc1.0.3
mpfr4.1.0
gmp6.1.2
=============
网上找到一个类似问题
https://stackoverflow.com/questions/3508495/gcc-cant-find-gmp-mpfr-and-mpc-libraries
【已解决】
要在mpfr.h里面补上
#define mpfr_add_one_ulp(x,r) \
(mpfr_sgn (x) > 0 ? mpfr_nextabove (x) : mpfr_nextbelow (x))
#define mpfr_sub_one_ulp(x,r) \
(mpfr_sgn (x) > 0 ? mpfr_nextbelow (x) : mpfr_nextabove (x))
--
修改:shrine08 FROM 180.119.160.*
FROM 180.119.160.*
--with-gmp=/usr/local/gmp-4.3.2 带上具体路径试试
【 在 shrine08 (shrine) 的大作中提到: 】
: 已经安装了mpc mpfr 和gmp怎么configure gcc还是显示,再次配置时已经with了这三个
: checking for the correct version of gmp.h... yes
: checking for the correct version of mpfr.h... yes
: ...................
--
FROM 220.191.249.*
./configure --prefix=/usr/local/gcc-9.3.0 -enable-threads=posix -disable-checking -disable-multilib -enable-languages=c,c++ --with-gmp=/usr/local/gmp --with-mpfr=/usr/local/mpfr-4.1.0 --with-mpc=/usr/local/mpc-1.0.3
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-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... /usr/bin/sed
checking for gawk... gawk
checking for libatomic support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... yes
checking for libhsail-rt support... yes
checking for libphobos support... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
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... 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... yes
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.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.
【 在 leelou 的大作中提到: 】
--
修改:shrine08 FROM 180.119.160.*
FROM 180.119.160.*
--with要给编译好的带lib的,看意思你给的是源码路径
【 在 shrine08 (shrine) 的大作中提到: 】
: ./configure --prefix=/usr/local/gcc-9.3.0 -enable-threads=posix -disable-checking -disable-multilib -enable-languages=c,c++ --with-gmp=/usr/local/gmp --with-mpfr=/usr/local/mpfr-4.1.0 --with-mpc=/usr/local/mpc-1.0.3
: checking build system type... x86_64-pc-linux-gnu
: checking host system type... x86_64-pc-linux-gnu
: ...................
--
FROM 123.118.98.*
逐个编译的,下载的源文件在home目录下
./configure --prefix=/usr/local/gmp
make && make install
【 在 zkr 的大作中提到: 】
--
FROM 180.119.160.*
看到这个prefix突然都沉默了?
【 在 shrine08 (shrine) 的大作中提到: 】
: 逐个编译的,下载的源文件在home目录下
: ./configure --prefix=/usr/local/gmp
: make && make install
: ...................
--
FROM 61.149.143.*
建议你遇到 configure 错误的时候先找到 config.log 看看具体是哪里错了。
【 在 shrine08 (shrine) 的大作中提到: 】
: 已经安装了mpc mpfr 和gmp怎么configure gcc还是显示,再次配置时已经with了这三个
: checking for the correct version of gmp.h... yes
: checking for the correct version of mpfr.h... yes
: ...................
--
FROM 103.90.178.*
configure:7878: checking for the correct version of the gmp/mpfr/mpc libraries
configure:7909: gcc -o conftest -g -O2 -I/usr/local/gmp/include -I/usr/local/mpfr-4.1.0/include -I/usr/local/mpc-1.0.3/include conftest.c -L/usr/local/gmp/lib -L/usr/local/mpfr-4.1.0/lib -L/usr/local/mpc-1.0.3/lib -lmpc -lmpfr -lgmp >&5
/usr/local/mpc-1.0.3/lib/libmpc.so: undefined reference to `mpfr_add_one_ulp'
/usr/local/mpc-1.0.3/lib/libmpc.so: undefined reference to `mpfr_sub_one_ulp'
collect2: error: ld returned 1 exit status
configure:7909: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h. */
| #include <mpc.h>
| int
| main ()
| {
|
| mpfr_t n;
| mpfr_t x;
| mpc_t c;
| int t;
| mpfr_init (n);
| mpfr_init (x);
| mpfr_atan2 (n, n, x, MPFR_RNDN);
| mpfr_erfc (n, x, MPFR_RNDN);
| mpfr_subnormalize (x, t, MPFR_RNDN);
| mpfr_clear(n);
| mpfr_clear(x);
| mpc_init2 (c, 53);
| mpc_set_ui_ui (c, 1, 1, MPC_RNDNN);
| mpc_cosh (c, c, MPC_RNDNN);
| mpc_pow (c, c, c, MPC_RNDNN);
| mpc_acosh (c, c, MPC_RNDNN);
| mpc_clear (c);
|
| ;
| return 0;
| }
configure:7913: result: no
configure:7926: error: Building GCC requires GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+.
【 在 ArchLinux 的大作中提到: 】
: 建议你遇到 configure 错误的时候先找到 config.log 看看具体是哪里错了。
:
--
FROM 144.168.63.*
/usr/local/mpc-1.0.3/lib/libmpc.so: undefined reference to `mpfr_add_one_ulp'
/usr/local/mpc-1.0.3/lib/libmpc.so: undefined reference to `mpfr_sub_one_ulp'
这俩导致问题发生的,版本对不上?
【 在 shrine08 (shrine) 的大作中提到: 】
: configure:7878: checking for the correct version of the gmp/mpfr/mpc libraries
: configure:7909: gcc -o conftest -g -O2 -I/usr/local/gmp/include -I/usr/local/mpfr-4.1.0/include -I/usr/local/mpc-1.0.3/include conftest.c -L/usr/local/gmp/lib -L/usr/local/mpfr-4.1.0/lib -L/usr/local/mpc-1.0.3/lib -lmpc -lmpfr -lgmp >&5
: /usr/local/mpc-1.0.3/lib/libmpc.so: undefined reference to `mpfr_add_one_ulp'
: ...................
--
FROM 103.107.216.*
为什么不用系统已安装的GMP库呢?
如果非要自己编译GMP这些库,GCC的简单做法是利用它自带的脚本
进入 GCC 源代码目录,执行
$ ./contrib/download_prerequisites
$ ./configure
基本就行了
【 在 shrine08 (shrine) 的大作中提到: 】
: 已经安装了mpc mpfr 和gmp怎么configure gcc还是显示,再次配置时已经with了这三个
: checking for the correct version of gmp.h... yes
: checking for the correct version of mpfr.h... yes
: ...................
--
FROM 183.131.109.*