2011-04-21 45 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