2015-05-12 93 views
5

根據this post最後有一個支持模板haskell和ghci的GHC版本的debian軟件包。爲什麼我不能在Raspberry Pi上安裝GHC 7.8.4的軟件包?

這是真的,我從Raspbian的全新副本開始,我改變了我的/etc/apt/sources.list文件:

deb http://http.debian.net/debian sid main contrib non-free 
# Uncomment line below then 'apt-get update' to enable 'apt-get source' 
#deb-src http://archive.raspbian.org/raspbian/ wheezy main contrib non-free rpi 

我做sudo apt-get update && sudo apt-get upgrade,然後我做了sudo apt-get install ghcsudo apt-get install cabal-install

ghc --version報告7.8.4。 GHCi工作得很好,TH也是如此。

但由於某種原因,我無法安裝cabal的任何軟件包。無論我選擇哪一個,我得到一些版本的錯誤:

login as: pi 
[email protected]'s password: 
Linux raspberrypi 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l 

The programs included with the Debian GNU/Linux system are free software; 
the exact distribution terms for each program are described in the 
individual files in /usr/share/doc/*/copyright. 

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent 
permitted by applicable law. 
Last login: Mon May 11 17:17:22 2015 

$ ghc --version 
The Glorious Glasgow Haskell Compilation System, version 7.8.4 
$ mkdir test 
$ cd test 
$ cabal sandbox init 
Writing a default package environment file to 
/home/pi/test/cabal.sandbox.config 
Creating a new sandbox at /home/pi/test/.cabal-sandbox 
$ cabal install array 
Resolving dependencies... 
Notice: installing into a sandbox located at /home/pi/test/.cabal-sandbox 
Downloading array-0.5.1.0... 
Configuring array-0.5.1.0... 
Failed to install array-0.5.1.0 
Build log (/home/pi/test/.cabal-sandbox/logs/array-0.5.1.0.log): 
cabal: Error: some packages failed to install: 
array-0.5.1.0 failed during the configure step. The exception was: 
user error ('/usr/bin/ghc' exited with an error: 
/tmp/ghc2287_0/ghc2287_6.s: Assembler messages: 

/tmp/ghc2287_0/ghc2287_6.s:76:0: 
Error: selected processor does not support ARM mode `movw 
r7,:lower16:stg_bh_upd_frame_info' 

/tmp/ghc2287_0/ghc2287_6.s:77:0: 
Error: selected processor does not support ARM mode `movt 
r7,:upper16:stg_bh_upd_frame_info' 

/tmp/ghc2287_0/ghc2287_6.s:80:0: 
Error: selected processor does not support ARM mode `movw 
r7,:lower16:base_GHCziTopHandler_runMainIO_closure' 

/tmp/ghc2287_0/ghc2287_6.s:81:0: 
Error: selected processor does not support ARM mode `movt 
r7,:upper16:base_GHCziTopHandler_runMainIO_closure' 

/tmp/ghc2287_0/ghc2287_6.s:82:0: 
Error: selected processor does not support ARM mode `movw 
r8,:lower16:Cabalzm1zi22zi1zi1_DistributionziSimple_defaultMain_closure' 

/tmp/ghc2287_0/ghc2287_6.s:83:0: 
Error: selected processor does not support ARM mode `movt 
r8,:upper16:Cabalzm1zi22zi1zi1_DistributionziSimple_defaultMain_closure' 
) 

有誰知道我出軌?

更新

​​
+1

運行'cabal install base-io-access',看看是否有效。我對此負責(很小,未完成,不要在真實代碼中使用),但它僅依賴於'base',並且不會執行任何FFI或類似操作。它就像你可以要求的一樣簡單。如果它沒有編譯,那麼它會告訴你,如果它編譯了,那麼它就是軟件包,然後它依賴於軟件包。 – bheklilr

+0

Thanks @bheklilr,這是一個測試,我用我自己的類似包'exact-pi'運行,只依賴於基礎。我剛剛嘗試過你,得到了同樣的結果。 (基本上,不同的臨時文件名,但甚至相同的行號和字符位置。) –

+0

在這種情況下,我不知道。我最初的猜測是試圖鏈接到一些C代碼或其他東西。也許你需要一些額外的標誌GHC讓它編譯正確嗎?我從來沒有嘗試在我的RPi上安裝GHC,所以我在這裏沒有經驗 – bheklilr

回答

5

它要建立與GHC或cabal install什麼東西每次都需要--ghc-options=-opta-march=armv7a作爲一個選項。有了這個,它的工作原理!

更新

相反,如果你--ghc-options="-opta-mcpu=cortex-a7 -opta-mfpu=neon -opta-mtune=native -opta-mfloat-abi=hard,浮點也可以工作。我通過猜測和檢查以及閱讀舊論壇帖子來達到此目的,所以它可能也不是最好的設置。

Cabal還有一個用戶配置文件,您可以在其中存儲此設置,並在調用GHC時應用它。

+1

我在Raspberry Pi 3上遇到了與ghc 7.10相同的問題。我不得不使用'--ghc-options = -opta-march = armv7-a'與cabal – zigazou

相關問題