3

Running lsb_release -s -d on the Jetson TK1 gives me Ubuntu 14.04 LTS

So I tried sudo apt-get install haskell-platform and sudo apt-get install ghc and with both I get an error that it is unable to locate the package. So I enabled the universe repository as I saw on a stackoverflow post for installing the haskell-platform for ubuntu 14.04. I still get the same result.

I see some people mentioning the got the haskell-platform to install on raspberry pis easily and that GHC now has good support for ARM but I don't see a way to get the install running on the Jetson TK1. My next option is to build from source, I don't see source for ARM architecture on the GHC or Haskell platform website.

I know there is also cross compiling, I will start messing with that when I see there is no easier way.

Hamzeh Alsalhi
  • 403
  • 1
  • 4
  • 10
  • Is it due to armhf vs armel? – Ankur Jul 23 '14 at 04:28
  • You don't need any ARM-specific code for installing from source. I could build ghc-7.8 on my Raspberry π just fine, though it took ages. What you do need however is an already-installed GHC, normally obtained by installing Haskell-platform from binary distribution... so there's the problem. – leftaroundabout Jul 23 '14 at 11:15
  • @Hamzeh, Have you managed to install GHC? – Arnon Nov 06 '14 at 11:26

1 Answers1

1

I managed to compile GHC7.8.3 on the Jetson K1 and Adapteva Parallella. I wrote a blog post about it here which is more verbose, but here's a summarized rundown of what I did:

  1. You will need GHC7.6.3 or earlier to bootstrap the compilation. I ran sudo apt-get install ghc automake build-essential cabal-install groff
  2. You’ll also need Alex and Happy, sudo apt-get install alex happy. I also installed them in Cabal, cabal update && cabal install alex happy
  3. I decided to compile with llvm, clang and gold linker, because gcc wouldn’t compile all the way. sudo apt-get install llvm clang binutils
  4. Edit mk/build.mk. I uncommented the line about quick-llvm compilation BuildFlavour = quick-llvm. You'll also need to replace appearances of -H64m with -H32m
  5. perl boot and sudo ./configure --with-clang=/usr/bin/clang --with-ar=/usr/bin/ar
  6. Because there is a linker issue, obtain the following script that will switch between standard ld and gold: https://gist.githubusercontent.com/bgamari/9399430/raw/build-ghc-arm.sh
  7. chmod ugo+rx build-ghc-arm.sh sudo /build-ghc-arm.sh -j6

  8. sudo make install

Arnon
  • 2,237
  • 15
  • 23