繁体   English   中英

在 linux 上从源代码构建 haskell ghc

[英]build haskell ghc from source on linux

构建ghc时似乎存在循环依赖

$ wget https://downloads.haskell.org/~ghc/9.2.2/ghc-9.2.2-src.tar.xz
$ tar -xf ghc-9.2.2-src.tar.xz
$ cd ghc-9.2.2/
$ sed -n "11,12p" INSTALL.md 
N.B. in particular you need GHC installed in order to build GHC,
because the compiler is itself written in Haskell.  For instructions
$ sudo apt install ghc # <----- somehow get an older version to build from source the new one
$ ./configure 
checking for gfind... no
checking for find... /usr/bin/find
checking for sort... /usr/bin/sort
checking for GHC Git commit id... given fbaee70d380973f71fa6e9e15be746532e5a4fc5
checking for ghc... /usr/bin/ghc
checking version of ghc... 8.6.5
configure: error: GHC version 8.10 or later is required to compile GHC. # ???!!!

所以要构建一个新的 ghc,需要一些旧版本的 ghc,但不要太旧 apt-get版本旧。 有任何想法吗?

根据@Daniel Wagner 的评论发布自我完整性:

$ wget https://downloads.haskell.org/~ghc/9.2.2/ghc-9.2.2-x86_64-ubuntu20.04-linux.tar.xz
$ tar -xf ghc-9.2.2-x86_64-ubuntu20.04-linux.tar.xz
$ cd ghc-9.2.2/
$ ./configure # <----- you still have to do configre + make
$ make
$ sudo make install
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.2.2

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM