2011-04-21 41 views
2

安装后拥抱然后安装ghc6然后安装generic-haskell有以下消息,怎么办?如何安装generic haskell

# make package 
Creating generic-haskell package ... 
ghc-pkg: cannot find package generic-haskell 
Reading package info from "generic-haskell.cabal.pkg" ... done. 
generic-haskell-1.80: missing id field 
generic-haskell-1.80: dependency "base-4.2.0.0" doesn't exist (use --force to override) 
generic-haskell-1.80: dependency "haskell98-1.0.1.1" doesn't exist (use --force to override) 
generic-haskell-1.80: dependency "containers-0.3.0.0" doesn't exist (use --force to override) 
make: *** [package] Error 1 

在Ubuntu我编译GHC-6.2.2得到了以下错误

/usr/bin/ghc -M -optdep-f -optdep.depend -osuf o -H16m -O HaskTags.hs 

on the commandline: 

    Warning: -optdep-f is deprecated: Use -dep-makefile instead 
------------------------------------------------------------------------ 
==fptools== make boot - --no-print-directory -r; 
in /home/martin/ghc-6.2.2/ghc/utils/ghc-pkg 
------------------------------------------------------------------------ 
/usr/bin/ghc -M -optdep-f -optdep.depend -osuf o -H16m -O -cpp -DPKG_TOOL -DWANT_PRETTY Main.hs Package.hs ParsePkgConfLite.hs Version.hs 

on the commandline: 
    Warning: -optdep-f is deprecated: Use -dep-makefile instead 
make all 
/usr/bin/ghc -H16m -O -cpp -DPKG_TOOL -DWANT_PRETTY -c Main.hs -o Main.o -ohi Main.hi 

Main.hs:496:11: 
    Ambiguous type variable `e' in the constraint: 
     `Exception.Exception e' 
     arising from a use of `Exception.throw' at Main.hs:496:11-25 
    Possible cause: the monomorphism restriction applied to the following: 
     my_catch :: forall a. IO a -> (e -> IO a) -> IO a 
     (bound at Main.hs:499:0) 
     my_throw :: forall a. e -> a (bound at Main.hs:496:0) 
    Probable fix: give these definition(s) an explicit type signature 
        or use -XNoMonomorphismRestriction 

Main.hs:498:13: 
    Ambiguous type variable `e1' in the constraint: 
     `Exception.Exception e1' 
     arising from a use of `Exception.catch' at Main.hs:498:13-27 
    Possible cause: the monomorphism restriction applied to the following: 
     eval_catch :: forall a. a -> (e1 -> IO a) -> IO a 
     (bound at Main.hs:498:0) 
    Probable fix: give these definition(s) an explicit type signature 
        or use -XNoMonomorphismRestriction 
make[4]: *** [Main.o] Error 1 
make[3]: *** [boot] Error 2 
make[2]: *** [boot] Error 1 
make[1]: *** [boot] Error 1 

任何一个在Ubuntu 10已经安装了旧版本的GHC的和通用的Haskell?

有很多对版本,我试过ghc-6.2.2得到了上面的错误,我需要卸载ubuntu 10来安装旧版本的ubuntu才能使它工作吗?哪个版本的ghc工作的ubuntu版本? http://www.cs.uu.nl/research/projects/generic-haskell/compiler.html

回答

1

我尝试从源代码安装generic-haskell,我管理并能够描述我如何修复它。我的安装平台是Haskell平台2011.2.0.1-x86_64,但下面的指令比较一般。

我遇到了三个问题,包括你描述的第一个问题(下面的第3个问题)。对于其他用户,我也描述了前两个,你可能也解决了这个问题。

1)其他用户具有第一固定取决于Data.Map.lookup类型的错误已经改变,对于containers> = 0.2.0.0:它用于返回Monad m => m b(在containers-1.0.0.0),现在它返回刚刚Maybe b。 我将电话添加到Data.Maybe.maybeToList来修复一些需要使用列表类型的呼叫站点;我敢打赌,你以某种方式解决了同样的错误。您可以在以下网址找到此修复程序: http://hpaste.org/47624

2)我有GHC 7的另一个错误是配置脚本没有意识到它比GHC 6.8更新,所以它也需要依赖容器。配置输出包括这行:

检查基础包是否被分裂(GHC 6.8或更新版本)...没有

要解决这个问题,就需要更换

if test $ghc_ma -ge 6 -a $ghc_mi -ge 8; then 

if test $ghc_ma -eq 6 -a $ghc_mi -ge 8 -o $ghc_ma -ge 7; then 

3)解决您的问题,您需要编辑build/generic-haskell.cabal.pkg(assumi如果您没有在原地进行就地安装)。您需要添加一个id:行并修复depends行以使用您的系统上存在的软件包的package-id而不是软件包名称。

$ ghc-pkg field base id 
id: base-4.3.1.0-f5c465200a37a65ca26c5c6c600f6c76 
$ ghc-pkg field haskell98 id 
id: haskell98-1.1.0.1-150131ea75216886448a7146c9e0526b 
$ ghc-pkg field containers id 
id: containers-0.4.0.0-b4885363abca642443ccd842502a3b7e 

build/generic-haskell.cabal.pkg的变化将被:

-depends:  base-4.3.1.0 
-    haskell98-1.1.0.1 
-    containers-0.4.0.0 
+depends:  base-4.3.1.0-f5c465200a37a65ca26c5c6c600f6c76 
+    haskell98-1.1.0.1-150131ea75216886448a7146c9e0526b 
+    containers-0.4.0.0-b4885363abca642443ccd842502a3b7e 

此外,你需要一个id行添加到您可以使用下面的命令(我的系统上的输出包括)找出IDS相同的文件 - 任何id都会执行,只要您在重新安装库时更改它即可。在这里,我用过:

id:    generic-haskell-1.80-lib-md5sum-2a7ae9d60440627618ad0b0139ef090b 

我也用空格对齐所有字段,如在现有的文件。该文件的语法参考可以在: http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/packages.html#installed-pkg-info

1

显然,generic-haskell程序包依赖于旧版本的base

Haskell Platform指定了base-4.3.1.0,而generic-haskell需要一个较旧的版本。请联系维护者,或者可能安装GHC的旧版本。

+0

谢谢。我今晚尝试 – Jo0o0 2011-04-21 07:03:34

+0

事实上,我已经尝试旧版本的GHC,但老错误,我发布了一个旧的错误 – Jo0o0 2011-04-21 07:07:31

+0

GHC 6.2.2(2004年10月15日发布)是*严重过期*。安装Haskell平台,http://haskell.org/platform – 2011-04-21 07:13:50