构建 GCC 4.6 - libmpfr.so.4 - 无法打开共享对象文件

发布于 2024-11-05 20:15:55 字数 988 浏览 0 评论 0原文

我正在尝试在 CentOS 版本 5.5(最终版)下构建 GCC 4.6。我新构建了 GMP-5.0.1、MPC-0.9 和 MPFR-3.0.1,并使用了以下配置命令:

../configure --prefix=/users/xxxx/apps/mygcc4。 6 --disable-checking --enable-threads=posix --enable-languages=c,c++,fortran --with-mpfr=/users/xxxx/code/gcc/mpfr-3.0.1-install-cyprus -- with-gmp=/users/xxxx/code/gcc/gmp-5.0.1-install-cyprus --with-mpc=/users/xxxx/code/gcc/mpc-0.9-install-cyprus

在此之后,我运行 make ,大约 5 分钟后收到以下错误消息:

检查对象文件的后缀...配置:错误:在 /users/xxxx/code/gcc/gcc-4.6.0/ 中obj/x86_64-unknown-linux-gnu/libgcc': 配置:错误:无法计算目标文件的后缀:无法编译 有关更多详细信息,请参阅config.log'。

config.log 表明涉及最近生成的程序(cc1):

/users/xxxx/code/gcc/gcc-4.6.0 /obj/./gcc/cc1

事实上,如果我在没有参数的情况下运行此程序,我会收到在 config.log 中找到的相同错误消息:

加载共享库时出错:libmpfr.so.4:无法打开共享对象文件:没有这样的文件或目录

但是,libmpfr.so.4 位于使用 --with-mpfr 标志进行配置的 lib 子目录中,如上所示。我的 LD_LIBRARY_PATH 和 LIBRARY_PATH 为空。知道我怎样才能克服这个错误吗?

I'm trying to build GCC 4.6 under CentOS release 5.5 (Final). I've freshly built GMP-5.0.1, MPC-0.9, and MPFR-3.0.1, and have used the following configure command:

../configure --prefix=/users/xxxx/apps/mygcc4.6 --disable-checking --enable-threads=posix --enable-languages=c,c++,fortran --with-mpfr=/users/xxxx/code/gcc/mpfr-3.0.1-install-cyprus --with-gmp=/users/xxxx/code/gcc/gmp-5.0.1-install-cyprus --with-mpc=/users/xxxx/code/gcc/mpc-0.9-install-cyprus

After this, I run make and after about 5 minutes get the following error message:

checking for suffix of object files... configure: error: in /users/xxxx/code/gcc/gcc-4.6.0/obj/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See
config.log' for more details.

The config.log indicates that a recently generated program (cc1) is involved:

/users/xxxx/code/gcc/gcc-4.6.0/obj/./gcc/cc1

Indeed if I run this program with no arguments I get the same error message found in config.log:

error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory

However, libmpfr.so.4 is in the lib subdirectory of that provided to configure using the --with-mpfr flag, as seen above. I have LD_LIBRARY_PATH and LIBRARY_PATH empty. Any idea how I can get past this error?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

风透绣罗衣 2024-11-12 20:15:55

确保您的库实际上位于给定的目录中,而不是某些 lib 子目录中。按照您的建议使用 export LD_LIBRARY_PATH=/users/xxxx/code/gcc/mpfr-3.0.1-install-cyprus ;-)

Make sure your library is acutally in the directory given and not in some lib subdirectory. Use export LD_LIBRARY_PATH=/users/xxxx/code/gcc/mpfr-3.0.1-install-cyprus as you have already suggested ;-)

三生池水覆流年 2024-11-12 20:15:55

我知道这个线程已经过时了。但是,我不得不评论说,在一个非常相似的问题上用头撞墙 5 个多小时后(检查目标文件的后缀...配置:错误:无法计算目标文件的后缀:无法编译)并且在阅读了安装手册、大量论坛并在相关系统上尝试了各种操作后,我发现这篇简短但非常有用的帖子。该问题与 LD_LIBRARY_PATH 恰好相关。
长话短说,当从源代码构建时,如果您碰到了这堵墙,请导出 LD_LIBRARY_PATH 变量以指向库的源构建目录。
无论如何为我工作。

祝大家好运。

I know this thread is pretty outdated. But, I had to comment and say that after 5+ hours of banging my head against the wall on a very similar issue (checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile) and having read the install manual, a multitude of forums, and trying various things on the system in question I found this brief but very useful post. The issue was precisely related to LD_LIBRARY_PATH.
Long story short, when building from source if you hit this wall export the LD_LIBRARY_PATH variable to point into the source build directory for the libs.
Worked for me anyway.

Good luck folks.

枉心 2024-11-12 20:15:55

我知道这个线程已经过时了。我在 WSL 上安装 mpfr 时遇到了类似的问题。构建很好并且 mpfr 安装正确,但是当我编写一个小 C 文件以查看是否可以访问头文件并打印安装版本时 - 我可以编译 C 文件,但是当我尝试运行编译对象时 - 它会给我一个错误。 C 文件是,

#include <stdio.h>
#include <mpfr.h>

int main (void) {
    printf ("MPFR library: %-12s\nMPFR header: %s (based on %d.%d.%d)\n",
    mpfr_get_version (), MPFR_VERSION_STRING, MPFR_VERSION_MAJOR,
    MPFR_VERSION_MINOR, MPFR_VERSION_PATCHLEVEL);
    return 0;
}

我正在编译它,

gcc -o version mpfr_presence.c -lmpfr -lgmp

但是当我尝试使用 ./version 运行它时,我会收到以下错误,

./version: error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory

我使用解决了这个错误,

sudo apt-get update
sudo apt-get install libmpfr4

然后当它说 < code>libmpfr4 已经是最新版本了,可以肯定的是,

sudo apt-get install --reinstall libmpfr4

现在 ./version 给了我,

MPFR library: 4.0.1
MPFR header: 4.0.1 (based on 4.0.1)

I know that this thread is pretty outdated. I faced similar issues while installing mpfr on WSL. The build was fine and mpfr installed correctly but when I wrote a small C file to see if I could access the header file and print the version fo the installation - I could compile the C file but When I tried to run the compiled object - it would give me an error. The C file was,

#include <stdio.h>
#include <mpfr.h>

int main (void) {
    printf ("MPFR library: %-12s\nMPFR header: %s (based on %d.%d.%d)\n",
    mpfr_get_version (), MPFR_VERSION_STRING, MPFR_VERSION_MAJOR,
    MPFR_VERSION_MINOR, MPFR_VERSION_PATCHLEVEL);
    return 0;
}

I was compiling this with,

gcc -o version mpfr_presence.c -lmpfr -lgmp

But when I tried to run this with ./version, I would get the following error,

./version: error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory

I solved this error using,

sudo apt-get update
sudo apt-get install libmpfr4

And then when it said that libmpfr4 was already at its latest version, just to be sure,

sudo apt-get install --reinstall libmpfr4

Now ./version gives me,

MPFR library: 4.0.1
MPFR header: 4.0.1 (based on 4.0.1)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文