{"id":15,"date":"2015-11-17T22:52:56","date_gmt":"2015-11-17T13:52:56","guid":{"rendered":"http:\/\/mitsuji.org\/?p=15"},"modified":"2015-11-22T15:20:53","modified_gmt":"2015-11-22T06:20:53","slug":"haskell-%e7%92%b0%e5%a2%83%e6%a7%8b%e7%af%89","status":"publish","type":"post","link":"https:\/\/mitsuji.org\/?p=15","title":{"rendered":"Haskell Platform \u3084 \u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u4f7f\u308f\u305a\u306b GHC \u3068 Cabal \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b &#8211; Debian 8 (Jessie) \u7de8"},"content":{"rendered":"<h2>[\u30e2\u30c1\u30d9\u30fc\u30b7\u30e7\u30f3]<\/h2>\n<p>Haskell \u306e\u30b3\u30f3\u30d1\u30a4\u30e9\u306e\u30c7\u30d5\u30a1\u30af\u30c8\u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u3067\u3042\u308b GHC \u306f\u3001\u308f\u308a\u3068\u983b\u7e41\u306b\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>\u958b\u767a\u304c\u6d3b\u767a\u306a\u306e\u306f\u5229\u7528\u8005\u3068\u3057\u3066\u306f\u3046\u308c\u3057\u3044\u3053\u3068\u3060\u304c\u3001Haskell Platform \u3084 \u5404\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u4f7f\u3063\u3066\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u3066\u3044\u308b\u3068\u3001\u5404\u30d0\u30fc\u30b8\u30e7\u30f3\u306eGHC\u3092\u5207\u308a\u66ff\u3048\u3066\u4f7f\u3046\u3053\u3068\u304c\u96e3\u3057\u304f\u3001\u305d\u308c\u304c\u4f5c\u696d\u306e\u59a8\u3052\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308b\u3002<\/p>\n<p>GHC\u306e\u30d0\u30a4\u30ca\u30ea\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u81ea\u5206\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066PATH\u306e\u8a2d\u5b9a\u3082\u81ea\u5206\u3067\u884c\u3063\u3066\u304a\u304f\u3068\u5404\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u5207\u308a\u66ff\u3048\u304c\u53ef\u80fd\u3068\u306a\u308b\u3002<\/p>\n<p>\u81ea\u524d\u69cb\u7bc9\u306f\u9762\u5012\u306a\u30a4\u30e1\u30fc\u30b8\u304c\u3042\u308b\u304c\u3001\u30dd\u30a4\u30f3\u30c8\u3092\u62bc\u3055\u3048\u308c\u3070\u610f\u5916\u3068\u7c21\u5358\u306a\u306e\u3067\u3053\u3053\u3067\u5171\u6709\u3059\u308b\u3002<\/p>\n<p>\u4eca\u56de\u306f &#8220;Debian 8 (Jessie) \u7de8&#8221;\u3060\u3002amd64\u7248\u304c\u6700\u5c0f\u69cb\u6210\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u3068\u4eee\u5b9a\u3059\u308b\uff61<\/p>\n<p><a href=\"http:\/\/mitsuji.org\/?p=45\">Haskell Platform \u3084 \u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u4f7f\u308f\u305a\u306b GHC \u3068 Cabal \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b \u2013 CentOS 7 \u7de8<\/a><\/p>\n<h2>[\u6982\u8981]<\/h2>\n<p>\u4e0b\u8a18\u3092\u884c\u3046\u305f\u3081\u306e\u624b\u9806\u3092\u793a\u3059\u3002<\/p>\n<h3>1. GHC\u306e\u30d0\u30a4\u30ca\u30ea\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>GHC\u306e\u30d0\u30a4\u30ca\u30ea\u30d1\u30c3\u30b1\u30fc\u30b8\u3092 \/usr\/local\/apps\/ \u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<br \/>\n\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8907\u6570\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4fdd\u6301\u3059\u308b\u524d\u63d0\u3002<\/p>\n<p>\/usr\/local\/apps\/ghc-7.6.3<br \/>\n\/usr\/local\/apps\/ghc-7.8.4<br \/>\n\/usr\/local\/apps\/ghc-7.10.1<br \/>\n\/usr\/local\/apps\/ghc-7.10.2<\/p>\n<h3>2. cabal\u30b3\u30de\u30f3\u30c9\u306e\u30d3\u30eb\u30c9<\/h3>\n<p>\u516c\u5f0f\u30b5\u30a4\u30c8\u304b\u3089\u843d\u3068\u3057\u3066\u304d\u305f cabal \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u81ea\u524d\u306ecabal\u30b3\u30de\u30f3\u30c9\u3092\u30d3\u30eb\u30c9\u3059\u308b\u3002<\/p>\n<h2>[1. GHC\u306e\u30d0\u30a4\u30ca\u30ea\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb]<\/h2>\n<p>GHC\u306e\u30d0\u30a4\u30ca\u30ea\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u4e0b\u8a18\u306e\u30b5\u30a4\u30c8\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\uff61<br \/>\n<a href=\"https:\/\/www.haskell.org\/ghc\/\">https:\/\/www.haskell.org\/ghc\/<\/a><\/p>\n<p>Debian 7 (wheezy) \u3067\u30d3\u30eb\u30c9\u3055\u308c\u305f\u3082\u306e\u304c jessie \u3067\u3082\u4f7f\u3048\u308b\uff61<br \/>\n<a href=\"https:\/\/www.haskell.org\/ghc\/download_ghc_7_10_2#x86_64linux\">https:\/\/www.haskell.org\/ghc\/download_ghc_7_10_2#x86_64linux<\/a><\/p>\n<p>gcc \u3068 make \u304c\u5fc5\u8981\u306a\u306e\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304f\u3002<br \/>\nlibgmp-dev \u306f ghci \u306e\u5b9f\u884c\u6642\u306b\u5fc5\u8981\u3068\u306a\u308b\u306e\u3067\u4e00\u7dd2\u306b\u5165\u308c\u3066\u304a\u304f\u3002<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ sudo apt-get install gcc make libgmp-dev\n<\/div>\n<p><\/code><\/p>\n<p>\u30d0\u30a4\u30ca\u30ea\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\uff61<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ wget http:\/\/downloads.haskell.org\/~ghc\/7.10.2\/ghc-7.10.2-x86_64-unknown-linux-deb7.tar.bz2\n<\/div>\n<p><\/code><\/p>\n<p>tar \u30dc\u30fc\u30eb\u3092\u89e3\u51cd\u3057\u3066\uff64\u89e3\u51cd\u5148\u306b cd \u3059\u308b\u3002<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ tar jxf ghc-7.10.2-x86_64-unknown-linux-deb7.tar.bz2<br \/>\n$ cd ghc-7.10.2\/\n<\/div>\n<p><\/code><\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u3092\u6307\u5b9a\u3057\u3066 configure \u3059\u308b\u3002<br \/>\ngcc \u3084 make \u304c\u306a\u3044\u3068\u3001\u3053\u306e\u3068\u304d\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3002<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ .\/configure --prefix=\/usr\/local\/apps\/ghc-7.10.2\n<\/div>\n<p><\/code><\/p>\n<p>\u7ba1\u7406\u8005\u6a29\u9650\u3067 make install<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ sudo make install\n<\/div>\n<p><\/code><\/p>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3001PATH\u3092\u8ffd\u52a0\u3059\u308b\u3002<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ cat ~\/.bash_profile<br \/>\nPATH=$PATH:\/usr\/local\/apps\/ghc-7.10.2\/bin<\/p>\n<p>export PATH\n<\/p><\/div>\n<p><\/code><\/p>\n<p>PATH\u306e\u8ffd\u52a0\u3092\u53cd\u6620\u3002\uff08\u30ed\u30b0\u30a4\u30f3\u3057\u306a\u304a\u3057\u3066\u3082\u3088\u3044\uff09<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ source ~\/.bash_profile\n<\/div>\n<p><\/code><\/p>\n<p>ghci \u3092\u8d77\u52d5\u3057\u3066\u4e0b\u8a18\u306e\u3088\u3046\u306b\u52d5\u4f5c\u3059\u308c\u3070\u6210\u529f\u3002<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ ghci<br \/>\nGHCi, version 7.10.2: http:\/\/www.haskell.org\/ghc\/  :? for help<br \/>\nPrelude> 1 + 2 + 3<br \/>\n6<br \/>\nPrelude> :q<br \/>\nLeaving GHCi.\n<\/div>\n<p><\/code><\/p>\n<h2>[2. cabal\u30b3\u30de\u30f3\u30c9\u306e\u30d3\u30eb\u30c9]<\/h2>\n<p>\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u3068\u3057\u3066\u306fCabal\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304ccabal\u3001cabal\u30b3\u30de\u30f3\u30c9\u304ccabal-install\u3068\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>cabal-install\u306e\u30d0\u30a4\u30ca\u30ea\u30d3\u30eb\u30c9\u306f\u4e0b\u8a18\u306e\u30b5\u30a4\u30c8\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u304c\u3001Linux\u7248\u306f32bit\u7248\u306e\u307f\u306e\u70ba\u300164bit\u74b0\u5883\u3067\u52d5\u4f5c\u3055\u305b\u308b\u306b\u306f\u3001\u5c11\u3057\u5de5\u592b\u304c\u5fc5\u8981\u306b\u306a\u308b\u3002<br \/>\n<a href=\"https:\/\/www.haskell.org\/cabal\/download.html\">https:\/\/www.haskell.org\/cabal\/download.html<\/a><\/p>\n<p>32bit\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3092 dpkg \u306e\u5bfe\u8c61\u306b\u8ffd\u52a0\u3057\u3066\u304b\u3089apt\u3092\u66f4\u65b0\u3059\u308b\u3002<br \/>\nlibc6:i386\u3001zlib1g:i386\u3001libgmp10:i386 \u306f32bit\u7248\u306ecabal\u306e\u52d5\u4f5c\u306b\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3002<br \/>\nzlib1g-dev \u306f\u81ea\u524d\u306e64bit\u7248\u306ecabal\u3092\u30d3\u30eb\u30c9\u3059\u308b\u3068\u304d\u306b\u5fc5\u8981\u306a\u306e\u3067\u3053\u3053\u3067\u5165\u308c\u3066\u304a\u304f\u3002<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ sudo dpkg --add-architecture i386<br \/>\n$ sudo apt-get update<br \/>\n$ sudo apt-get install libc6:i386 zlib1g:i386 libgmp10:i386 zlib1g-dev\n<\/div>\n<p><\/code><\/p>\n<p>32bit\u30d0\u30a4\u30ca\u30ea\u306e\u52d5\u4f5c\u306b\u3064\u3044\u3066\u306e\u8a73\u7d30\u306f\u3053\u3061\u3089\u3092\u53c2\u7167\u3002<br \/>\n<a href=\"http:\/\/askubuntu.com\/questions\/454253\/how-to-run-32-bit-app-in-ubuntu-64-bit\">http:\/\/askubuntu.com\/questions\/454253\/how-to-run-32-bit-app-in-ubuntu-64-bit<\/a><\/p>\n<p>\u30d0\u30a4\u30ca\u30ea\u30d3\u30eb\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\uff61<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ wget https:\/\/www.haskell.org\/cabal\/release\/cabal-install-1.22.0.0\/cabal-1.22.0.0-i386-unknown-linux.tar.gz\n<\/div>\n<p><\/code><\/p>\n<p>tar \u30dc\u30fc\u30eb\u3092\u89e3\u51cd\u3059\u308b\u3068 cabal \u3068\u3044\u3046\u540d\u524d\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u751f\u6210\u3055\u308c\u308b\u3002\u3053\u308c\u304c32bit\u7248 cabal\u30b3\u30de\u30f3\u30c9\u3002<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ tar zxf cabal-1.22.0.0-i386-unknown-linux.tar.gz\n<\/div>\n<p><\/code><\/p>\n<p>cabal \u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u60c5\u5831\u3092\u66f4\u65b0(\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9)\u3059\u308b\u3002<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ .\/cabal update\n<\/div>\n<p><\/code><\/p>\n<p>\u81ea\u5206\u306e cabal \u30b3\u30de\u30f3\u30c9\u3092\u30d3\u30eb\u30c9\u3059\u308b\u3002~\/.cabal\/bin \u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u3002<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ .\/cabal install cabal-install\n<\/div>\n<p><\/code><\/p>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3001PATH\u3092\u8ffd\u52a0\u3059\u308b\u3002<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ cat ~\/.bash_profile<\/p>\n<p>PATH=$PATH:\/usr\/local\/apps\/ghc-7.10.2\/bin<br \/>\nPATH=$PATH:~\/.cabal\/bin<\/p>\n<p>export PATH\n<\/p><\/div>\n<p><\/code><\/p>\n<p>PATH\u306e\u8ffd\u52a0\u3092\u53cd\u6620\u3002\uff08\u30ed\u30b0\u30a4\u30f3\u3057\u306a\u304a\u3057\u3066\u3082\u3088\u3044\uff09<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ source ~\/.bash_profile\n<\/div>\n<p><\/code><\/p>\n<p>\u81ea\u5206\u306e cabal \u304c\u53c2\u7167\u3055\u308c\u308c\u3070\u6210\u529f\u3002<br \/>\n<code><\/p>\n<div style=\"margin-left:20pt;background-color:black;color:grey;\">\n$ which cabal<br \/>\n\/home\/administrator\/.cabal\/bin\/cabal\n<\/div>\n<p><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[\u30e2\u30c1\u30d9\u30fc\u30b7\u30e7\u30f3] Haskell \u306e\u30b3\u30f3\u30d1\u30a4\u30e9\u306e\u30c7\u30d5\u30a1\u30af\u30c8\u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u3067\u3042\u308b GHC \u306f\u3001\u308f\u308a\u3068\u983b\u7e41\u306b\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u3066\u3044\u308b\u3002 \u958b\u767a\u304c\u6d3b\u767a\u306a\u306e\u306f\u5229\u7528\u8005\u3068\u3057\u3066\u306f\u3046\u308c\u3057\u3044\u3053\u3068\u3060\u304c\u3001Haskell Platfo &hellip; <a href=\"https:\/\/mitsuji.org\/?p=15\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">Haskell Platform \u3084 \u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u4f7f\u308f\u305a\u306b GHC \u3068 Cabal \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b &#8211; Debian 8 (Jessie) \u7de8<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[4,3],"_links":{"self":[{"href":"https:\/\/mitsuji.org\/index.php?rest_route=\/wp\/v2\/posts\/15"}],"collection":[{"href":"https:\/\/mitsuji.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mitsuji.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mitsuji.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mitsuji.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15"}],"version-history":[{"count":10,"href":"https:\/\/mitsuji.org\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":52,"href":"https:\/\/mitsuji.org\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions\/52"}],"wp:attachment":[{"href":"https:\/\/mitsuji.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mitsuji.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mitsuji.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}