在Opensuse 42.3上为haskell堆栈设置ghc-8.2.1时ghc完整性检查错误 [英] ghc sanity check error while setup ghc-8.2.1 for haskell stack on Opensuse 42.3

查看:69
本文介绍了在Opensuse 42.3上为haskell堆栈设置ghc-8.2.1时ghc完整性检查错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了haskell堆栈,并且正在尝试为此设置ghc.堆栈版本为

I have installed haskell stack and I'm trying to setup ghc for the same. stack version is

 stack --version
 Version 1.5.1, Git revision 600c1f01435a10d127938709556c1682ecfd694e (4861 commits) x86_64 hpack-0.17.1

我已经更新了〜/.stack/global-project/stack.yaml,如下所示

I have updated the ~/.stack/global-project/stack.yaml as below

# This is the implicit global project's config file, which is only used when
# 'stack' is run outside of a real project.  Settings here do _not_ act as
# defaults for all projects.  To change stack's default settings, edit
# '/home/rajkumar/.stack/config.yaml' instead.
#
# For more information about stack's configuration, see
# http://docs.haskellstack.org/en/stable/yaml_configuration/
#
flags: {}
extra-package-dbs: []
packages: []
extra-deps: []
resolver: ghc-8.2.1

然后我运行 stack setup 命令并得到以下错误-

Then I run stack setup command and got the below error -

> stack setup
The GHC located at /home/user/.stack/programs/x86_64-linux/ghc-tinfo6-8.2.1/bin/ghc failed to compile a sanity check. Please see:

http://docs.haskellstack.org/en/stable/install_and_upgrade/

for more information. Exception was:
Running /home/user/.stack/programs/x86_64-linux/ghc-tinfo6-8.2.1/bin/ghc /tmp/stack-sanity-check6389/Main.hs -no-user-package-db in directory /tmp/stack-sanity-check6389/ exited with ExitFailure 1

[1 of 1] Compiling Main             ( /tmp/stack-sanity-check6389/Main.hs, /tmp/stack-sanity-check6389/Main.o )
Linking /tmp/stack-sanity-check6389/Main ...

/usr/bin/ld.bfd: cannot find -lgmp
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)

如何解决此问题?

推荐答案

我能够解决此错误.

使用以下命令验证openuseuse linux上已经安装了gmp.

Verify gmp is installed already on opensuse linux using the below command.

sudo ldconfig -p | grep libgmp
libgmp.so.10 (libc6,x86-64) => /usr/lib64/libgmp.so.10

如果不存在,请使用以下命令进行安装

If not present install it using below command

sudo zypper install libgmp10

在同一文件夹中为lib文件创建链接.例子

create link for the lib file in the same folder. Example

sudo ln /usr/lib64/libgmp.so.10 /usr/lib64/libgmp.so

希望这对某人有帮助.

这篇关于在Opensuse 42.3上为haskell堆栈设置ghc-8.2.1时ghc完整性检查错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆