在 OSX El Capitan 上安装 Agda?

Install Agda on OSX El Capitan?

我试图按照说明 http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.MacOSX

在我的 mac 上安装 Agda

但我遇到了一些问题:

  1. 当我在终端 window 中输入 cabal update 时,它显示 Skipping download: Local and remote files match. 我不确定它是否有效。

  2. 我找不到我的 .bash_profile 文件,所以我不知道如何更新我的 PATH variable.

  3. 如果我尝试跳过上面的前两个步骤,直接输入 cabal install happy alex,它会显示以下内容:

    Resolving dependencies...
    Configuring alex-3.1.7...
    Configuring happy-1.19.5...
    Building happy-1.19.5...
    Building alex-3.1.7...
    Failed to install happy-1.19.5
    Build log ( /Users/ChiuYenChao/.cabal/logs/happy-1.19.5.log ):
    [1 of 1] Compiling Main             ( /var/folders/bh/q7b8bhkj3bq8s6ml5zxvwfd40000gn/T/cabal-tmp-28407/happy-1.19.5/dist/setup/setup.hs, /var/folders/bh/q7b8bhkj3bq8s6ml5zxvwfd40000gn/T/cabal-tmp-28407/happy-1.19.5/dist/setup/Main.o )
    Linking /var/folders/bh/q7b8bhkj3bq8s6ml5zxvwfd40000gn/T/cabal-tmp-28407/happy-1.19.5/dist/setup/setup ...
    Configuring happy-1.19.5...
    Building happy-1.19.5...
    Preprocessing executable 'happy' for happy-1.19.5...
    <command line>: cannot satisfy -package-id mtl-2.2.1-7fee06b00eebbe3fa92f6d82f0fb6c19
        (use -v for more information)
    Failed to install alex-3.1.7
    Build log ( /Users/ChiuYenChao/.cabal/logs/alex-3.1.7.log ):
    [1 of 1] Compiling Main             ( /var/folders/bh/q7b8bhkj3bq8s6ml5zxvwfd40000gn/T/cabal-tmp-28406/alex-3.1.7/dist/setup/setup.hs, /var/folders/bh/q7b8bhkj3bq8s6ml5zxvwfd40000gn/T/cabal-tmp-28406/alex-3.1.7/dist/setup/Main.o )
    Linking /var/folders/bh/q7b8bhkj3bq8s6ml5zxvwfd40000gn/T/cabal-tmp-28406/alex-3.1.7/dist/setup/setup ...
    Configuring alex-3.1.7...
    Building alex-3.1.7...
    Preprocessing executable 'alex' for alex-3.1.7...
    <command line>: cannot satisfy -package-id QuickCheck-2.8.1-720f6faecb50e002ef05e66ef82b9675
        (use -v for more information)
    cabal: Error: some packages failed to install:
    alex-3.1.7 failed during the building phase. The exception was:
    ExitFailure 1
    happy-1.19.5 failed during the building phase. The exception was:
    ExitFailure 1
    

    我认为这意味着某些事情失败了,但我不知道该怎么办。请帮忙

编辑:

  1. 如果我直接输入 cabal install agda,会出现以下错误:

    Resolving dependencies...
    Downloading EdisonAPI-1.3...
    Downloading QuickCheck-2.8.2...
    Configuring QuickCheck-2.8.2...
    Downloading STMonadTrans-0.3.3...
    Configuring EdisonAPI-1.3...
    Downloading boxes-0.1.4...
    Configuring boxes-0.1.4...
    Downloading data-hash-0.2.0.1...
    Downloading edit-distance-0.2.2.1...
    Configuring STMonadTrans-0.3.3...
    Downloading geniplate-mirror-0.7.4...
    Downloading hashtables-1.2.1.0...
    Downloading monadplus-1.4.2...
    Downloading polyparse-1.12...
    Downloading strict-0.3.2...
    Downloading unix-compat-0.4.2.0...
    Building boxes-0.1.4...
    Building QuickCheck-2.8.2...
    Building STMonadTrans-0.3.3...
    Failed to install QuickCheck-2.8.2
    Build log ( /Users/ChiuYenChao/.cabal/logs/QuickCheck-2.8.2.log ):
    [1 of 1] Compiling Main             ( /var/folders/bh/q7b8bhkj3bq8s6ml5zxvwfd40000gn/T/cabal-tmp-29102/QuickCheck-2.8.2/dist/setup/setup.hs, /var/folders/bh/q7b8bhkj3bq8s6ml5zxvwfd40000gn/T/cabal-tmp-29102/QuickCheck-2.8.2/dist/setup/Main.o )
    Linking /var/folders/bh/q7b8bhkj3bq8s6ml5zxvwfd40000gn/T/cabal-tmp-29102/QuickCheck-2.8.2/dist/setup/setup ...
    Configuring QuickCheck-2.8.2...
    Building QuickCheck-2.8.2...
    Preprocessing library QuickCheck-2.8.2...
    <command line>: cannot satisfy -package-id random-1.1-1229fa9ea3f9951a38fad637630a5acf
        (use -v for more information)
    Building EdisonAPI-1.3...
    Failed to install STMonadTrans-0.3.3
    Build log ( /Users/ChiuYenChao/.cabal/logs/STMonadTrans-0.3.3.log ):
    Configuring STMonadTrans-0.3.3...
    Building STMonadTrans-0.3.3...
    Preprocessing library STMonadTrans-0.3.3...
    <command line>: cannot satisfy -package-id mtl-2.2.1-7fee06b00eebbe3fa92f6d82f0fb6c19
        (use -v for more information)
    Failed to install boxes-0.1.4
    Build log ( /Users/ChiuYenChao/.cabal/logs/boxes-0.1.4.log ):
    Configuring boxes-0.1.4...
    Building boxes-0.1.4...
    Preprocessing library boxes-0.1.4...
    <command line>: cannot satisfy -package-id split-0.2.2-bdc181dc0cb027cda71092df3fe3fb02
        (use -v for more information)
    Configuring data-hash-0.2.0.1...
    Configuring edit-distance-0.2.2.1...
    Configuring geniplate-mirror-0.7.4...
    Configuring monadplus-1.4.2...
    Failed to install EdisonAPI-1.3
    Build log ( /Users/ChiuYenChao/.cabal/logs/EdisonAPI-1.3.log ):
    Configuring EdisonAPI-1.3...
    Building EdisonAPI-1.3...
    Preprocessing library EdisonAPI-1.3...
    <command line>: cannot satisfy -package-id mtl-2.2.1-7fee06b00eebbe3fa92f6d82f0fb6c19
        (use -v for more information)
    Building data-hash-0.2.0.1...
    Building edit-distance-0.2.2.1...
    Building geniplate-mirror-0.7.4...
    Building monadplus-1.4.2...
    Configuring hashtables-1.2.1.0...
    Failed to install edit-distance-0.2.2.1
    Build log ( /Users/ChiuYenChao/.cabal/logs/edit-distance-0.2.2.1.log ):
    Configuring edit-distance-0.2.2.1...
    Building edit-distance-0.2.2.1...
    Preprocessing library edit-distance-0.2.2.1...
    <command line>: cannot satisfy -package-id random-1.1-1229fa9ea3f9951a38fad637630a5acf
        (use -v for more information)
    Configuring unix-compat-0.4.2.0...
    Failed to install geniplate-mirror-0.7.4
    Build log ( /Users/ChiuYenChao/.cabal/logs/geniplate-mirror-0.7.4.log ):
    Configuring geniplate-mirror-0.7.4...
    Building geniplate-mirror-0.7.4...
    Preprocessing library geniplate-mirror-0.7.4...
    <command line>: cannot satisfy -package-id mtl-2.2.1-7fee06b00eebbe3fa92f6d82f0fb6c19
        (use -v for more information)
    Building unix-compat-0.4.2.0...
    Building hashtables-1.2.1.0...
    Configuring polyparse-1.12...
    Failed to install hashtables-1.2.1.0
    Build log ( /Users/ChiuYenChao/.cabal/logs/hashtables-1.2.1.0.log ):
    Configuring hashtables-1.2.1.0...
    Building hashtables-1.2.1.0...
    Preprocessing library hashtables-1.2.1.0...
    <command line>: cannot satisfy -package-id hashable-1.2.3.3-09c4177c49dd46a63f7036317bb17114
        (use -v for more information)
    Building polyparse-1.12...
    Configuring strict-0.3.2...
    Failed to install polyparse-1.12
    Build log ( /Users/ChiuYenChao/.cabal/logs/polyparse-1.12.log ):
    Configuring polyparse-1.12...
    Building polyparse-1.12...
    Preprocessing library polyparse-1.12...
    <command line>: cannot satisfy -package-id text-1.2.1.3-3718968f98d5614ccdc45c27d4e8b0a1
        (use -v for more information)
    Building strict-0.3.2...
    Installed monadplus-1.4.2
    Installed unix-compat-0.4.2.0
    Downloading filemanip-0.3.6.3...
    Configuring filemanip-0.3.6.3...
    Building filemanip-0.3.6.3...
    Failed to install filemanip-0.3.6.3
    Build log ( /Users/ChiuYenChao/.cabal/logs/filemanip-0.3.6.3.log ):
    Configuring filemanip-0.3.6.3...
    Building filemanip-0.3.6.3...
    Preprocessing library filemanip-0.3.6.3...
    <command line>: cannot satisfy -package-id mtl-2.2.1-7fee06b00eebbe3fa92f6d82f0fb6c19
        (use -v for more information)
    Installed data-hash-0.2.0.1
    Installed strict-0.3.2
    Updating documentation index
    /Users/ChiuYenChao/Library/Haskell/share/doc/x86_64-osx-ghc-7.10.2/index.html
    cabal: Error: some packages failed to install:
    Agda-2.5.1.1 depends on filemanip-0.3.6.3 which failed to install.
    EdisonAPI-1.3 failed during the building phase. The exception was:
    ExitFailure 1
    EdisonCore-1.3.1.1 depends on EdisonAPI-1.3 which failed to install.
    QuickCheck-2.8.2 failed during the building phase. The exception was:
    ExitFailure 1
    STMonadTrans-0.3.3 failed during the building phase. The exception was:
    ExitFailure 1
    boxes-0.1.4 failed during the building phase. The exception was:
    ExitFailure 1
    cpphs-1.20.1 depends on polyparse-1.12 which failed to install.
    edit-distance-0.2.2.1 failed during the building phase. The exception was:
    ExitFailure 1
    equivalence-0.3.1 depends on STMonadTrans-0.3.3 which failed to install.
    filemanip-0.3.6.3 failed during the building phase. The exception was:
    ExitFailure 1
    geniplate-mirror-0.7.4 failed during the building phase. The exception was:
    ExitFailure 1
    hashtables-1.2.1.0 failed during the building phase. The exception was:
    ExitFailure 1
    haskell-src-exts-1.17.1 depends on polyparse-1.12 which failed to install.
    polyparse-1.12 failed during the building phase. The exception was:
    ExitFailure 1
    

我会尝试用堆栈构建 Agda。

  1. 使用 these instructions
  2. 下载 stack OSX
  3. 运行:

    stack setup
    stack install Agda
    

这两个步骤可能需要一段时间。查看输出以查看堆栈将 Agda 程序放置在何处 - 它可能类似于 ~/.local/bin

更新

$PATH 环境变量及其设置方法的一些解释:

失败无数次后,我只好卸载旧版本Haskell重新安装,然后http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.MacOSX的方法很好用...