构建 GCC 4.6 - libmpfr.so.4 - 无法打开共享对象文件
我正在尝试在 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':
config.log' for more details.
configure: error: cannot compute suffix of object files: cannot compile
See
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
确保您的库实际上位于给定的目录中,而不是某些
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. Useexport LD_LIBRARY_PATH=/users/xxxx/code/gcc/mpfr-3.0.1-install-cyprus
as you have already suggested ;-)我知道这个线程已经过时了。但是,我不得不评论说,在一个非常相似的问题上用头撞墙 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.
我知道这个线程已经过时了。我在 WSL 上安装 mpfr 时遇到了类似的问题。构建很好并且 mpfr 安装正确,但是当我编写一个小 C 文件以查看是否可以访问头文件并打印安装版本时 - 我可以编译 C 文件,但是当我尝试运行编译对象时 - 它会给我一个错误。 C 文件是,
我正在编译它,
但是当我尝试使用
./version
运行它时,我会收到以下错误,我使用解决了这个错误,
然后当它说 < code>libmpfr4 已经是最新版本了,可以肯定的是,
现在
./version
给了我,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,
I was compiling this with,
But when I tried to run this with
./version
, I would get the following error,I solved this error using,
And then when it said that
libmpfr4
was already at its latest version, just to be sure,Now
./version
gives me,