【发布时间】:2017-09-29 22:00:53
【问题描述】:
我已经安装了 haskell 堆栈,并且正在尝试设置 ghc。堆栈版本是
stack --version
Version 1.5.1, Git revision 600c1f01435a10d127938709556c1682ecfd694e (4861 commits) x86_64 hpack-0.17.1
我已经更新了 ~/.stack/global-project/stack.yaml 如下
# 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 命令并得到以下错误 -
> 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)
我该如何解决这个问题?
【问题讨论】:
-
堆栈是如何安装的?如果通过 docs.haskellstack.org/en/stable/README 安装,它应该安装 libgmp。不知道如何在 opensuse 上安装东西,但安装 libgmp 它应该可以工作。注意我只是通过搜索堆栈问题跟踪器来解决这个问题。github.com/commercialhaskell/stack/issues/3069 通过github.com/commercialhaskell/stack/…
-
mgsloan - 我已经使用命令
curl -sSL https://get.haskellstack.org/ | sh安装了。我关注了这个文档docs.haskellstack.org/en/stable/README/#how-to-install