2011-03-07 4 views
2

어제 하스켈에서 모듈 설치에 대해 알아보기 위해 음모를 통해 하스켈 모듈을 설치하려고했습니다. 나는 먼저 카발을 설치해야했다.Windows 7에 Haskell 모듈 설치

내 체제 : Windows 7

하스켈 컴파일러 버전 : GHC 7.0.2 (링크 http://www.haskell.org/ghc/download)

음모 : http://haskell.org/cabal/download.html

내가 기대하고, 단계별로 프로세스 단계를 설명합니다 당신은 할 수있다 Cabal과 Cabal을 포함한 패키지 설치 중에 잘못된 행동을 지정하십시오.

절차 : 윈도우 7 시작 메뉴에서 GHCi를 시작

  1. 설치된 하스켈 컴파일러 GHC 7.0.2

    , 도스 창에서 출력 다음 제공합니다

    GHCi, version 7.0.2: Website :? for help . 
    Loading package ghc-prim ... linking ... done. 
    Loading package integer-gmp ... linking ... done. 
    Loading package base ... linking ... done. 
    Loading package ffi-1.0 ... linking ... done. 
    Prelude>             
    

    지금까지는 그렇게 좋았습니다. 기본 패키지 안에있는 모든 기능은 액세스 가능하며 기능상의 기능을합니다.

    결론 : GHCi 설치에는 잘못된 단계가 없습니다. 소스 (소개 참조)에서 cabal.exe 다운로드

  2. 는 C로 복사 : \ GHC \ GHC-7.0.2

  3. 이 사이트가 조언으로 cabal-install-0.8.2.tar.gz을 다운로드 (% 경로 % -variables에 추가) 빈 \ 사용자가 패키지를 새로 설치하는 데 필요합니다.
  4. 개설 새 도스 프롬프트 창
  5. 입력 된 cabal update (사이트에서 조언으로),이 목록을 업데이트 한 사용자 프롬프트 모드로 돌아
  6. 입력 된 cd C:\pathwhere\cabal-install-0.8.2.tar.gz
  7. 은 (도당 설치 파일이있는 디렉토리로 전환)

    Resolving dependencies... 
    Downloading containers-0.3.0.0... 
    Configuring containers-0.3.0.0... 
    Preprocessing library containers-0.3.0.0... 
    Building containers-0.3.0.0... 
    [1 of 7] Compiling Data.Sequence (Data\Sequence.hs, dist\build\Data\Sequence.o) 
    [2 of 7] Compiling Data.Set   (Data\Set.hs, dist\build\Data\Set.o) 
    [3 of 7] Compiling Data.Map   (Data\Map.hs, dist\build\Data\Map.o) 
    [4 of 7] Compiling Data.IntSet  (Data\IntSet.hs, dist\build\Data\IntSet.o) 
    [5 of 7] Compiling Data.IntMap  (Data\IntMap.hs, dist\build\Data\IntMap.o) 
    [6 of 7] Compiling Data.Tree  (Data\Tree.hs, dist\build\Data\Tree.o) 
    [7 of 7] Compiling Data.Graph  (Data\Graph.hs, dist\build\Data\Graph.o) 
    cabal: ar is required but it could not be found. 
    Downloading filepath-1.1.0.4... 
    Configuring filepath-1.1.0.4... 
    Preprocessing library filepath-1.1.0.4... 
    Building filepath-1.1.0.4... 
    [1 of 3] Compiling System.FilePath.Posix (System\FilePath\Posix.hs, dist\build\System\FilePath\Posix.o) 
    [2 of 3] Compiling System.FilePath.Windows (System\FilePath\Windows.hs, dist\build\System\FilePath\Windows.o) 
    [3 of 3] Compiling System.FilePath (System\FilePath.hs, dist\build\System\FilePath.o) 
    cabal: ar is required but it could not be found. 
    Downloading parsec-2.1.0.1... 
    Configuring parsec-2.1.0.1... 
    Preprocessing library parsec-2.1.0.1... 
    Building parsec-2.1.0.1... 
    [ 1 of 10] Compiling Text.ParserCombinators.Parsec.Pos (Text\ParserCombinators\Parsec\Pos.hs, dist\build\Text\ParserCombinators\Parsec\Pos.o) 
    [ 2 of 10] Compiling Text.ParserCombinators.Parsec.Error (Text\ParserCombinators\Parsec\Error.hs, dist\build\Text\ParserCombinators\Parsec\Error.o) 
    [ 3 of 10] Compiling Text.ParserCombinators.Parsec.Prim (Text\ParserCombinators\Parsec\Prim.hs, dist\build\Text\ParserCombinators\Parsec\Prim.o) 
    [ 4 of 10] Compiling Text.ParserCombinators.Parsec.Char (Text\ParserCombinators\Parsec\Char.hs, dist\build\Text\ParserCombinators\Parsec\Char.o) 
    [ 5 of 10] Compiling Text.ParserCombinators.Parsec.Combinator (Text\ParserCombinators\Parsec\Combinator.hs, dist\build\Text\ParserCombinators\Parsec\Combinator.o) 
    [ 6 of 10] Compiling Text.ParserCombinators.Parsec.Expr (Text\ParserCombinators\Parsec\Expr.hs, dist\build\Text\ParserCombinators\Parsec\Expr.o) 
    [ 7 of 10] Compiling Text.ParserCombinators.Parsec (Text\ParserCombinators\Parsec.hs, dist\build\Text\ParserCombinators\Parsec.o) 
    [ 8 of 10] Compiling Text.ParserCombinators.Parsec.Token (Text\ParserCombinators\Parsec\Token.hs, dist\build\Text\ParserCombinators\Parsec\Token.o) 
    [ 9 of 10] Compiling Text.ParserCombinators.Parsec.Perm (Text\ParserCombinators\Parsec\Perm.hs, dist\build\Text\ParserCombinators\Parsec\Perm.o) 
    [10 of 10] Compiling Text.ParserCombinators.Parsec.Language (Text\ParserCombinators\Parsec\Language.hs, dist\build\Text\ParserCombinators\Parsec\Language.o) 
    cabal: ar is required but it could not be found. 
    Downloading time-1.1.4... 
    [1 of 1] Compiling Main    (C:\Users\altug\AppData\Local\Temp\time-1.1.43528time-1.1.4\Setup.hs, C:\Users\altug\AppData\Local\Temp\time-1.1.43528\time-1.1.4\dist\setup\Main.o) 
    C:\Users\altug\AppData\Local\Temp\time-1.1.43528\time-1.1.4\Setup.hs:5:1: 
        Warning: In the use of `runTests' 
          (imported from Distribution.Simple, but defined in Distribution.Simple.UserHooks): 
          Deprecated: "Please use the new testing interface instead!" 
    Linking C:\Users\altug\AppData\Local\Temp\time-1.1.43528\time-1.1.4\dist\setup\setup.exe ... 
    Configuring time-1.1.4... 
    Preprocessing library time-1.1.4... 
    Building time-1.1.4... 
    [ 1 of 24] Compiling Data.Time.Clock.CTimeval (Data\Time\Clock\CTimeval.hs, dist\build\Data\Time\Clock\CTimeval.o) 
    [ 2 of 24] Compiling Data.Time.Clock.Scale (Data\Time\Clock\Scale.hs, dist\build\Data\Time\Clock\Scale.o) 
    [ 3 of 24] Compiling Data.Time.Calendar.Private (Data\Time\Calendar\Private.hs, dist\build\Data\Time\Calendar\Private.o) 
    [ 4 of 24] Compiling Data.Time.Calendar.MonthDay (Data\Time\Calendar\MonthDay.hs, dist\build\Data\Time\Calendar\MonthDay.o) 
    [ 5 of 24] Compiling Data.Time.Calendar.Days (Data\Time\Calendar\Days.hs, dist\build\Data\Time\Calendar\Days.o) 
    [ 6 of 24] Compiling Data.Time.Calendar.OrdinalDate (Data\Time\Calendar\OrdinalDate.hs, dist\build\Data\Time\Calendar\OrdinalDate.o) 
    [ 7 of 24] Compiling Data.Time.Calendar.Gregorian (Data\Time\Calendar\Gregorian.hs, dist\build\Data\Time\Calendar\Gregorian.o) 
    [ 8 of 24] Compiling Data.Time.Calendar.WeekDate (Data\Time\Calendar\WeekDate.hs, dist\build\Data\Time\Calendar\WeekDate.o) 
    [ 9 of 24] Compiling Data.Time.Calendar.JulianYearDay (Data\Time\Calendar\JulianYearDay.hs, dist\build\Data\Time\Calendar\JulianYearDay.o) 
    [10 of 24] Compiling Data.Time.Calendar.Julian (Data\Time\Calendar\Julian.hs, dist\build\Data\Time\Calendar\Julian.o) 
    [11 of 24] Compiling Data.Time.Clock.UTC (Data\Time\Clock\UTC.hs, dist\build\Data\Time\Clock\UTC.o) 
    [12 of 24] Compiling Data.Time.Clock.POSIX (Data\Time\Clock\POSIX.hs, dist\build\Data\Time\Clock\POSIX.o) 
    [13 of 24] Compiling Data.Time.Clock.UTCDiff (Data\Time\Clock\UTCDiff.hs, dist\build\Data\Time\Clock\UTCDiff.o) 
    [14 of 24] Compiling Data.Time.Clock (Data\Time\Clock.hs, dist\build\Data\Time\Clock.o) 
    [15 of 24] Compiling Data.Time.LocalTime.TimeZone (Data\Time\LocalTime\TimeZone.hs, dist\build\Data\Time\LocalTime\TimeZone.o) 
    [16 of 24] Compiling Data.Time.LocalTime.TimeOfDay (Data\Time\LocalTime\TimeOfDay.hs, dist\build\Data\Time\LocalTime\TimeOfDay.o) 
    [17 of 24] Compiling Data.Time.Calendar (Data\Time\Calendar.hs, dist\build\Data\Time\Calendar.o) 
    [18 of 24] Compiling Data.Time.Calendar.Easter (Data\Time\Calendar\Easter.hs, dist\build\Data\Time\Calendar\Easter.o) 
    [19 of 24] Compiling Data.Time.LocalTime.LocalTime (Data\Time\LocalTime\LocalTime.hs, dist\build\Data\Time\LocalTime\LocalTime.o) 
    [20 of 24] Compiling Data.Time.LocalTime (Data\Time\LocalTime.hs, dist\build\Data\Time\LocalTime.o) 
    [21 of 24] Compiling Data.Time.Clock.TAI (Data\Time\Clock\TAI.hs, dist\build\Data\Time\Clock\TAI.o) 
    [22 of 24] Compiling Data.Time.Format.Parse (Data\Time\Format\Parse.hs, dist\build\Data\Time\Format\Parse.o) 
    [23 of 24] Compiling Data.Time.Format (Data\Time\Format.hs, dist\build\Data\Time\Format.o) 
    [24 of 24] Compiling Data.Time  (Data\Time.hs, dist\build\Data\Time.o) 
    Registering time-1.1.4... 
    Installing library in 
    C:\Users\altug\AppData\Roaming\cabal\time-1.1.4\ghc-7.0.2 
    Registering time-1.1.4... 
    Downloading random-1.0.0.3... 
    Configuring random-1.0.0.3... 
    Preprocessing library random-1.0.0.3... 
    Building random-1.0.0.3... 
    [1 of 1] Compiling System.Random (System\Random.hs, dist\build\System\Random.o) 
    cabal: ar is required but it could not be found. 
    Downloading transformers-0.2.2.0... 
    Configuring transformers-0.2.2.0... 
    Preprocessing library transformers-0.2.2.0... 
    Building transformers-0.2.2.0... 
    [ 1 of 21] Compiling Data.Functor.Product (Data\Functor\Product.hs, dist\buildData\Functor\Product.o) 
    [ 2 of 21] Compiling Data.Functor.Constant (Data\Functor\Constant.hs, dist\build\Data\Functor\Constant.o) 
    [ 3 of 21] Compiling Data.Functor.Compose (Data\Functor\Compose.hs, dist\build\Data\Functor\Compose.o) 
    [ 4 of 21] Compiling Data.Functor.Identity (Data\Functor\Identity.hs, dist\build\Data\Functor\Identity.o) 
    [ 5 of 21] Compiling Control.Monad.Trans.Class (Control\Monad\Trans\Class.hs, dist\build\Control\Monad\Trans\Class.o) 
    [ 6 of 21] Compiling Control.Monad.IO.Class (Control\Monad\IO\Class.hs, dist\build\Control\Monad\IO\Class.o) 
    [ 7 of 21] Compiling Control.Monad.Trans.Cont (Control\Monad\Trans\Cont.hs, dist\build\Control\Monad\Trans\Cont.o) 
    [ 8 of 21] Compiling Control.Monad.Trans.Error (Control\Monad\Trans\Error.hs, dist\build\Control\Monad\Trans\Error.o) 
    [ 9 of 21] Compiling Control.Monad.Trans.Identity (Control\Monad\Trans\Identity.hs, dist\build\Control\Monad\Trans\Identity.o) 
    [10 of 21] Compiling Control.Monad.Trans.List (Control\Monad\Trans\List.hs, dist\build\Control\Monad\Trans\List.o) 
    [11 of 21] Compiling Control.Monad.Trans.Maybe (Control\Monad\Trans\Maybe.hs, dist\build\Control\Monad\Trans\Maybe.o) 
    [12 of 21] Compiling Control.Monad.Trans.Reader (Control\Monad\Trans\Reader.hs, dist\build\Control\Monad\Trans\Reader.o) 
    [13 of 21] Compiling Control.Monad.Trans.RWS.Lazy (Control\Monad\Trans\RWS\Lazy.hs, dist\build\Control\Monad\Trans\RWS\Lazy.o) 
    [14 of 21] Compiling Control.Monad.Trans.RWS (Control\Monad\Trans\RWS.hs, dist\build\Control\Monad\Trans\RWS.o) 
    [15 of 21] Compiling Control.Monad.Trans.RWS.Strict (Control\Monad\Trans\RWS\Strict.hs, dist\build\Control\Monad\Trans\RWS\Strict.o) 
    [16 of 21] Compiling Control.Monad.Trans.State.Lazy (Control\Monad\Trans\State\Lazy.hs, dist\build\Control\Monad\Trans\State\Lazy.o) 
    [17 of 21] Compiling Control.Monad.Trans.State (Control\Monad\Trans\State.hs, dist\build\Control\Monad\Trans\State.o) 
    [18 of 21] Compiling Control.Monad.Trans.State.Strict (Control\Monad\Trans\State\Strict.hs, dist\build\Control\Monad\Trans\State\Strict.o) 
    [19 of 21] Compiling Control.Monad.Trans.Writer.Lazy (Control\Monad\Trans\Writer\Lazy.hs, dist\build\Control\Monad\Trans\Writer\Lazy.o) 
    [20 of 21] Compiling Control.Monad.Trans.Writer (Control\Monad\Trans\Writer.hs, dist\build\Control\Monad\Trans\Writer.o) 
    [21 of 21] Compiling Control.Monad.Trans.Writer.Strict (Control\Monad\Trans\Writer\Strict.hs, dist\build\Control\Monad\Trans\Writer\Strict.o) 
    cabal: ar is required but it could not be found. 
    Downloading zlib-0.5.3.1... 
    Configuring zlib-0.5.3.1... 
    Preprocessing library zlib-0.5.3.1... 
    Building zlib-0.5.3.1... 
    [1 of 5] Compiling Codec.Compression.Zlib.Stream (dist\build\Codec\Compression\Zlib\Stream.hs, dist\build\Codec\Compression\Zlib\Stream.o) 
    [2 of 5] Compiling Codec.Compression.Zlib.Internal (Codec\Compression\Zlib\Internal.hs, dist\build\Codec\Compression\Zlib\Internal.o) 
    [3 of 5] Compiling Codec.Compression.Zlib.Raw (Codec\Compression\Zlib\Raw.hs, dist\build\Codec\Compression\Zlib\Raw.o) 
    [4 of 5] Compiling Codec.Compression.Zlib (Codec\Compression\Zlib.hs, dist\build\Codec\Compression\Zlib.o) 
    [5 of 5] Compiling Codec.Compression.GZip (Codec\Compression\GZip.hs, dist\build\Codec\Compression\GZip.o) 
    cabal: ar is required but it could not be found. 
    cabal: Error: some packages failed to install: 
    Cabal-1.8.0.6 depends on filepath-1.1.0.4 which failed to install. 
    HTTP-4000.1.1 depends on transformers-0.2.2.0 which failed to install. 
    cabal-install-0.8.2 depends on zlib-0.5.3.1 which failed to install. 
    containers-0.3.0.0 failed during the building phase. The exception was: 
    ExitFailure 1 
    directory-1.0.1.2 depends on filepath-1.1.0.4 which failed to install. 
    filepath-1.1.0.4 failed during the building phase. The exception was: 
    ExitFailure 1 
    mtl-2.0.1.0 depends on transformers-0.2.2.0 which failed to install. 
    network-2.3.0.2 depends on parsec-2.1.0.1 which failed to install. 
    parsec-2.1.0.1 failed during the building phase. The exception was: 
    ExitFailure 1 
    process-1.0.1.5 depends on filepath-1.1.0.4 which failed to install. 
    random-1.0.0.3 failed during the building phase. The exception was: 
    ExitFailure 1 
    transformers-0.2.2.0 failed during the building phase. The exception was: 
    ExitFailure 1 
    zlib-0.5.3.1 failed during the building phase. The exception was: 
    ExitFailure 1 
    

    내 결론 :

  8. 그 후 설치가 도스 박스에 다음과 같은 출력을 생성하기 시작, cabal install cabal-install-0.8.2을 형식화

    쉽게 볼 수 있듯이 출력에 오류가 있음을 나타내지 만 의미가 무엇인지 알 수 없습니다.

    Resolving dependencies... 
    cabal: cannot configure algebra-0.0.0.1. It requires base >=3.0 && <4.1 
    For the dependency on base >=3.0 && <4.1 there are these packages: 
    base-3.0.3.1, base-3.0.3.2 and base-4.0.0.0. However none of them are available. 
    base-3.0.3.1 was excluded because of the top level dependency base -any 
    base-3.0.3.2 was excluded because of the top level dependency base -any 
    base-4.0.0.0 was excluded because of the top level dependency base -any 
    
    : 나는 도스 박스 입력 프롬프트에서 1

  9. 다시 단계에서 도스 - Interpeter에이 availible 만들기에 초점을 내 대수 패키지를 설치하려고 계속,이 출력을 생성하는, cabal install constructive-algebra를 입력

패키지가 설치되어 있지 않은 것으로 가정합니다. 모듈을 작동 시키려면 어떻게해야하는지 정확히 설명 할 수있는 사람이 필요합니다.

이 게시물을 읽고 답변 해 주셔서 감사합니다. 인터프리터와 컴파일러가 작동합니다.

답변

2

Download Haskell 에서 전체 패키지를 설치했습니다.이 패키지에는 음모가 포함되어 있습니다. Win7에서 실행 중이며 지금까지 문제가 없었습니다.

그리고 FWIW, 게시물에서 다운로드 링크를 클릭 한 다음 최신 버전을 다운로드하려고하면 내가 준 링크에서 haskell 플랫폼을 다운로드하라는 큰 메시지가 나타납니다.

+0

시도해 보겠습니다. 하지만 도스 명령 프롬프트를 통해 캐럴을 사용하고 있습니까? 아니면 하스켈 Verison에 어떻게 든 포함되어 있습니까? – kiltek

+0

Haskell-Plattform으로 잘 작동합니다. 하지만 모듈의 이름은 무엇입니까? 언제 해석기에로드하려고합니까? ": 대수로드"가 작동하지 않습니다! – kiltek

+0

ghci에서 'Import Algebra'라고 말하면 패키지의 루트를 얻을 수 있습니다. 모든 패키지에 대한 자세한 내용은 http://hackage.haskell.org/package/constructive-algebra – Ezra

1

패키지 이름은 constructive-algebra이지만 모듈 이름은 무엇입니까? 그 모듈 이름은 ghci에서 사용해야합니다.

3

가장 쉬운 방법은 DasBoot 권장처럼 하스켈 플랫폼을 얻을 수 있습니다, 그러나 나는 시도하고 어쨌든 귀하의 질문에 답변 해 드리겠습니다 :

1) 질문의 첫 번째의 경우, 뭔가 잘못 때문에 설치 수 실패 너의 길. 도구 "ar"을 (를) 찾을 수 없습니다. ar은 라이브러리를 만들 때 사용됩니다. 명령 창에서 그냥 "AR"을 입력하면이

사용처럼 뭔가를 반환해야합니다 : AR [에뮬레이션 옵션] [-] {dmpqrstx} [abcfilNoPsSuvV] [멤버 이름] 아카이브 파일 [ 카운트] 파일 ... 아칸소 -M [

그 다음 해당 폴더 포함하는 AR (아마도 C : \ GHC \ GHC-7.0.2 \와 Mingw \ 빈)를 추가 할 필요가없는 경우 경로 ENV에 창에서 변수.

2) 귀하의 대수 라이브러리는 적어도 7.0.2에서 설치되지 않습니다. 대수학자는 종속 관계가 "종속성 : 기본> = 3.0 & & < 4.1"

이지만 ghc 7.0은 기본 4.3이 제공됩니다. 그래서 수신 한 이유는 다음과 같습니다.

cabal : 대수 0.0.0.1을 구성 할 수 없습니다. 그것은 필요베이스> = 3.0 & & < 4.1 기반에 대한 종속성에 대한

> = 3.0 & & < 4.1이 패키지가 있습니다 :

베이스 3.0.3.1,베이스 3.0.3.2 및베이스 4.0 .0.0. 그러나 그들 중 누구도 사용할 수 없습니다

운 좋게도, 이것은 특정 particuair 패키지에 대해 쉽게 해결할 수 있습니다. 단지

음모 압축을 풀고 대수가

CD 대수-0.0.0.1

메모장 변화

algebra.cabal는 4.4

음모에 4.1 설치 할

그게해야합니까

관련 문제