필자는 ghc 크로스 컴파일러를 성공적으로 만들었습니다. 내 x64 Linux 시스템에서 armv6h (제 경우의 raspberry pi)에 대한 haskell 코드를 컴파일 할 수있게되었습니다. 라즈베리에서 hello world 프로그램을 성공적으로 실행했습니다.haskell 코드를 크로스 컴파일 할 때 어떻게 의존성을 설치합니까?
아니요 다른 haskell 모듈에 많은 의존성이있는 실제 앱을 만들고 싶습니다. 내가 64에 대해 컴파일 할 때 단순히
cabal install dependenciy1 depenency2 ...
을 나는 내 자신을 programm 음모 프로젝트 만들기이 단계를 자동화 할 수 있습니다 알고 있습니다. 하지만 여기서 중요한 것은 아닙니다.
나는 그것이 찾을 수 없습니다 모듈에 대해 알려줍니다 크로스 컴파일러
arm-unknown-linux-gnueabi-ghc --make myapp.hs
을 사용하려고
. 물론, 그들은 설치되지 않았습니다! 나는 https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling 를 읽고 그에 따라 나는cabal --with-ghc=arm-unknown-linux-gnueabi-ghc --with-ghc-pkg=arm-unknown-linux-gnueabi-ghc-pkg --with-ld=arm-unknown-linux-gnueabi-ld install random
임의
내가 여기 설치하는 데 노력하고있어 depenency입니다했습니다. 내가file /home/daniel/.cabal/setup-exe-cache/setup-Cabal-1.18.1.3-arm-linux-ghc-7.8.3.20140804
작업을 수행 할 때 내가
/home/daniel/.cabal/setup-exe-cache/setup-Cabal-1.18.1.3-arm-linux-ghc-7.8.3.20140804: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.10.2, not stripped
그것을 실행할 수 없습니다 의심 할 여지을 얻을
Resolving dependencies...
Configuring random-1.0.1.3...
Failed to install random-1.0.1.3
Last 10 lines of the build log (/home/daniel/.cabal/logs/random-1.0.1.3.log):
/home/daniel/.cabal/setup-exe-cache/setup-Cabal-1.18.1.3-arm-linux-ghc-7.8.3.20140804: /home/daniel/.cabal/setup-exe-cache/setup-Cabal-1.18.1.3-arm-linux-ghc-7.8.3.20140804: cannot execute binary file
cabal: Error: some packages failed to install:
random-1.0.1.3 failed during the configure step. The exception was:
ExitFailure 126
: 나는 다음과 같은 오류가 발생합니다. 그것은 팔을 위해 컴파일됩니다.
여기에 뭔가가 있습니까? 내 목표는 모든 의존성을 끌어 내 라즈베리에 배포 할 수있는 정적 링크 된 앱을 만드는 것입니다.
당신이'음모 가져 오기 random'을 시도 할 수 있습니다, 다음 CD를 이미 이것에 대해 도당 문제가
'random - ???'디렉토리에 복사 한 다음'runhaskell ./Setup.hs install --with-ghc = ... ...'? – bennofs
내가 할 때 '인식 할 수없는'설치 '옵션을 \'--with-ghc = arm-unknown-linux-gnueabi-ghc ' 알 수없는'설치 '옵션 \'--with-ghc-pkg = arm- unknown-linux-gnueabi-ghc-pkg ' 알 수없는'install '옵션 \'--with-ld = arm-unknown-linux-gnueabi-ld '\ –
오, 당신은'runhaskell ./Setup'을 할 필요가 있습니다. hs configure --with ...','runhaskell ./Setup.hs build' 그리고 마지막으로'runhaskell ./Setup.hs install'을 사용합니다. – bennofs