2011-04-21 3 views
2

을 설치 한 다음 ghc6을 설치 한 다음 generic-haskell을 설치하면 다음 메시지가 나타납니다. 수행 방법? 우분투에서hugs를 설치 한 후 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 

은 내가 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 

어느 하나 우분투 10 GHC의 이전 버전 및 일반 하스켈 설치되어있어?

많은 버전의 버전이 있는데, ghc-6.2.2가 오류를 해결하려고했는데 우분투 10을 제거해야 이전 버전 우분투를 설치해야 작동 할 수 있습니까? 어느 버전의 우분투 버전이 ghc 작동합니까? http://www.cs.uu.nl/research/projects/generic-haskell/compiler.html

답변

1

소스에서 직접 generic-haskell을 설치하려고 시도했습니다. 어떻게 관리했는지 설명 할 수있었습니다. 제 설치 플랫폼은 Haskell Platform 2011.2.0.1-x86_64입니다. 그러나 다음 명령어는 좀 더 일반적입니다.

설명하는 첫 번째 문제 (아래 3 번)를 포함하여 세 가지 문제를 만났습니다. 다른 사용자의 경우 처음 두 개를 설명하기도합니다.

1) 다른 사용자 containers> = 0.2.0.0 대해 변경 한 Data.Map.lookup 종류에 따라 오류를 수정하는 제 : 원함)에 containers-1.0.0.0 (Monad m => m b를 반환하는 데, 지금 막 반환 Maybe b. 목록 유형을 사용해야하는 몇 가지 전화 사이트를 수정하기 위해 Data.Maybe.maybeToList에 대한 전화를 추가했습니다. 나는 당신이 어떤 식 으로든 동일한 오류를 고쳤다. 이 픽스는 http://hpaste.org/47624에서 찾을 수 있습니다.

2) GHC 7에서 내가 가지고있는 또 다른 오류는 configure 스크립트가 GHC 6.8보다 새로운 것을 인식하지 못하므로 컨테이너에 의존해야한다는 것입니다. 더는

이 문제를 해결하려면, 당신이

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

를 교체해야 ...

기본 패키지가 분리되어 있는지 여부를 확인 (GHC 6.8 이상) : 출력이 줄을 포함 구성하지

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

3) 문제를 해결하려면 build/generic-haskell.cabal.pkg (가정 장소에서의 설치로 현재 위치에서 설치하지 않는 경우). id : 행을 추가하고 패키지 이름 대신 시스템에있는 패키지의 패키지 ID를 사용하려면 depends 행을 수정해야합니다.

$ 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 라인을 추가 할 필요가 있습니다 (내 시스템에서 출력 포함) 다음 명령을 사용하여 ID를 찾을 수 있습니다 동일한 파일 - 라이브러리를 다시 설치할 때/변경하면 모든 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

+0

사실 ghc의 이전 버전을 시도했지만 이전 오류가 발생했습니다. 이전 오류가 발생했습니다. – Jo0o0

+0

GHC 6.2.2 (2004 년 10 월 15 일에 릴리스 됨)는 * 많이 사용되지 않습니다 *. Haskell 플랫폼을 설치하십시오. http://haskell.org/platform –

관련 문제