本文介绍了在Linux上安装ghc二进制文件(找不到libgmp.so)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图首次在Linux上安装Haskell平台(我也是一个相当新的Linux用户)。受害者系统是一个新的红帽系统。这里涉及的所有内容都应该是64位。



平台网站[1]的指示表明我需要一个ghc7.0.3来推动事情。它们提供了一个到ghc-7.0.3的通用二进制文件的链接来执行此操作。我提取并运行了

$ $ p $ $ $ $ $ $ / $ / $ $ $ $ $ make $ ...
$

按照没有事件的指示(它是一个二进制文件,所以不需要编译)
但是,当我试图运行ghci我得到了输出。

  $ ghci 
GHCi,7.0.3版:http:// www.haskell.org/ghc/:?寻求帮助
加载包ghc-prim ...链接...完成。
加载软件包integer-gmp ...<命令行>:无法加载.so / .DLL for:gmp(libgmp.so:无法打开共享目标文件:无此文件或目录)

由于某些原因,ghci无法找到libgmp.so。运行ghci最终会调用

  /usr/local/lib/ghc-7.0.3/ghc 

带有一系列选项。我通过ldd检查了依赖关系。

  $ ldd /usr/local/lib/ghc-7.0.3/ghc 
linux-vdso.so.1 => (0x00007fffe5f5c000)
libncursesw.so.5 => /lib64/libncursesw.so.5(0x0000003ee7000000)
librt.so.1 => /lib64/librt.so.1(0x0000003ee5800000)
libutil.so.1 => /lib64/libutil.so.1(0x0000003ef3000000)
libdl.so.2 => /lib64/libdl.so.2(0x0000003ee5000000)
libgmp.so.3 => /usr/lib64/libgmp.so.3(0x0000003ee4400000)
libm.so.6 => /lib64/libm.so.6(0x0000003ee4c00000)
libpthread.so.0 => /lib64/libpthread.so.0(0x0000003ee5400000)
libc.so.6 => /lib64/libc.so.6(0x0000003ee4800000)
libtinfo.so.5 => /lib64/libtinfo.so.5(0x0000003ef3400000)
/lib64/ld-linux-x86-64.so.2(0x0000003ee4000000)

,它表明它是libgmp。 libgmp位于/ usr / local / lib和/ usr / local / lib64中。
我不知道如何进一步得到这个。有什么建议?



[1]

解决方案

您可以添加 / usr / local / lib 和/或 / usr / local / lib64 $ LD_LIBRARY_PATH /etc/ld.so.conf 中,或者(因为您已经有 /usr/lib64/libgmp.so。 3 )添加一个缺少的符号链接:



$ p $ cd $ us $ lib64 $ b $ sudo ln -s libgmp.so.3 libgmp.so

(也可能与/ usr / lib相同) 。

请注意,/usr/lib64/libgmp.so.3可能与/usr/local/lib64/libgmp.so版本不同,确保ghc可以实际上与前者一起使用。

I am trying to install the Haskell Platform on Linux for the first time (I'm also a fairly new Linux user). The victim system is a fresh Red Hat system. And everything involved here should be 64 bit.

The directions at the platform website [1] indicate that I need a ghc7.0.3 to boostrap things. They provide a link to a generic binary of ghc-7.0.3 to do this. I fetched this and ran

$ ./configure ...
$ make install ...

as per the directions without incident (it is a binary, so no compilation needed)However, when I tried to run ghci I get the output.

$ ghci
GHCi, version 7.0.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... <command line>: can't load .so/.DLL for: gmp (libgmp.so: cannot open shared object file: No such file or directory)

For some reason ghci cannot find libgmp.so. Running ghci ultimately invokes

  /usr/local/lib/ghc-7.0.3/ghc

with a mess of options. I checked the dependencies via ldd

$ ldd /usr/local/lib/ghc-7.0.3/ghc
    linux-vdso.so.1 =>  (0x00007fffe5f5c000)
    libncursesw.so.5 => /lib64/libncursesw.so.5 (0x0000003ee7000000)
    librt.so.1 => /lib64/librt.so.1 (0x0000003ee5800000)
    libutil.so.1 => /lib64/libutil.so.1 (0x0000003ef3000000)
    libdl.so.2 => /lib64/libdl.so.2 (0x0000003ee5000000)
    libgmp.so.3 => /usr/lib64/libgmp.so.3 (0x0000003ee4400000)
    libm.so.6 => /lib64/libm.so.6 (0x0000003ee4c00000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003ee5400000)
    libc.so.6 => /lib64/libc.so.6 (0x0000003ee4800000)
    libtinfo.so.5 => /lib64/libtinfo.so.5 (0x0000003ef3400000)
    /lib64/ld-linux-x86-64.so.2 (0x0000003ee4000000)

and it shows that it foud libgmp. libgmp is in /usr/local/lib and /usr/local/lib64.I am not sure how to get further with this. Any suggestions?

[1] http://hackage.haskell.org/platform/linux.html

解决方案

You either add /usr/local/lib and/or /usr/local/lib64 to $LD_LIBRARY_PATH, or add them to /etc/ld.so.conf, or (since you already have /usr/lib64/libgmp.so.3) add a missing symbolic link:

cd /usr/lib64
sudo ln -s libgmp.so.3 libgmp.so

(and perhaps the same for /usr/lib).

Note that /usr/lib64/libgmp.so.3 might be a different version from /usr/local/lib64/libgmp.so, make sure ghc can actually be used with the former.

这篇关于在Linux上安装ghc二进制文件(找不到libgmp.so)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 21:27