zoukankan      html  css  js  c++  java
  • Install Haskell on Ubuntu and CentOS

    For Ubuntu:

    Step one: Install GHC

    If you don't want to install curl you can skip step 1 and just directly download ghc package.

    1. Install curl first.

    sudo apt-get install gcc libgmp3-dev curl


    2.Make a directory to get the ghc package.

    For 64 bit machine, get the following package:

    cabal update


    curl -O http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-x86_64-unknown-linux.tar.bz2


    For 32 bit machine, get the following package:
    curl -O http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-i386-unknown-linux.tar.bz2

    3. Decompress the tar package and install GHC, before doing that install some lib.

    sudo apt-get install libgmp3-dev
    
    sudo apt-get install libgmp3c2
    
    tar -xjvf ghc-7.6.3-x86_64-unknown-linux.tar.bz2 or tar -xjvf ghc-7.6.3-i386-unknown-linux.tar.bz2
    
    cd ghc-7.6.3
    ./configure
    sudo make install

    4. Check the version.

    ghc --version

    If it is ok, you will see:

    The Glorious Glasgow Haskell Compilation System, version 7.6.3

    Step two : Install Haskell Platform


    1. Download the package first.

    curl -O http://lambda.haskell.org/platform/download/2013.2.0.0/haskell-platform-2013.2.0.0.tar.gz
    tar -xf haskell-platform-2013.2.0.0.tar.gz

    2. Install the following package:

    sudo apt-get install libglc-dev
    sudo apt-get install freeglut3-dev

    3. cd to haskell-platform-2013.2.0.0

    ./configure
    
    sudo make
    
    sudo make install

    4. Last it will suggest you to Use "cabal install <foo>" to install additional packages, just update cabal

    cabal update

    That's done.


    For CentOS:

    It is almost the same as ubuntu except some places to notice.

    Step one: Install GHC

    1. Directly download the GHC tar and extract it to a folder.

    cd ghc-7.6.3
    ./configure
    sudo make install
    </pre><pre code_snippet_id="370751" snippet_file_name="blog_20140530_14_1907562" name="code" class="plain">ghc --version
    

    It is the same as before.

    Step two : Install Haskell Platform

    1. Directly downlaod haskell-platform-2013.2.0.0.tar.gz and extract it to a folder.

    When run configure, it will get error that can't find some lib files like The zlib C library is required. 
    I search a lot and even I download the zlib and installed manually can't resolve this problem.
    Finally I find a solution, just install the following:

    yum install gmp gmp-devel freeglut freeglut-devel libX11-devel mesa-libGLU-devel zlib-devel

    It will resolve the issue. That's great.

    Then run the following as before, it will install haskell platform successfully.
    ./configure
    
    sudo make
    
    sudo make install

    cabal update


    Reference:

    http://powman.org/archives/haskell_env.html


    http://tryhaskell.org/  

  • 相关阅读:
    根据前序遍历和中序遍历重建二叉树
    Java内部类
    Java浅克隆和深度克隆
    【leetcode】1354. Construct Target Array With Multiple Sums
    【leetcode】1352. Product of the Last K Numbers
    【leetcode】1351. Count Negative Numbers in a Sorted Matrix
    【leetcode】1342. Number of Steps to Reduce a Number to Zero
    【leetcode】1343. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold
    【leetcode】1344. Angle Between Hands of a Clock
    【leetcode】1346. Check If N and Its Double Exist
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/9978078.html
Copyright © 2011-2022 走看看