簡體   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