Skip to content

Instantly share code, notes, and snippets.

@Jonke
Last active August 29, 2015 14:01
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jonke/cccd567ed78d7a612810 to your computer and use it in GitHub Desktop.
Save Jonke/cccd567ed78d7a612810 to your computer and use it in GitHub Desktop.

Setup your own win64 version of the Haskell Platform

Things you need to have

  • MSYS
  • GHC 7.8.2 win64 build
  • Cabal 1.20 win build
  • FreeGlut

Things you need to do

  • Install MSYS1

    • Download version 1.0.11 of MSYS. You'll need the following files:

    • MSYS-1.0.11.exe

    • msysDTK-1.0.1.exe

    • msysCORE-1.0.11-bin.tar.gz

    • The files are all hosted on haskell.org as they're quite hard to find in the official MinGW/MSYS repo

    • Run MSYS-1.0.11.exe followed by msysDTK-1.0.1.exe. The former asks you if you want to run a normalization step. You can skip that.

    • Unpack msysCORE-1.0.11-bin.tar.gz into D:\msys\1.0. Note that you can't do that using an MSYS shell, because you can't overwrite the files in use, so make a copy of D:\msys\1.0, unpack it there, and then rename the copy back to D:\msys\1.0.

  • Install GHC2

  • Install Cabal3

  • Install FreeGlut4

    • [Download freeglut 2.8.1-1 for MinGW] http://files.transmissionzero.co.uk/software/development/GLUT/freeglut-MinGW.zip)

    • Extract

    • Get the 64 binaries from freeglut-MinGW-2.8.1-1.mp\freeglut\bin\x64 and freeglut-MinGW-2.8.1-1.mp\freeglut\lib\x64

    • Put the libfreeglut.a in D:\ghc-7.8.2\mingw\lib

    • Rename it to libglut32.a

    • Put the freeglut.dll in D:\ghc-7.8.2\bin

    • Rename it to glut32.dll

    • Caution, this trick is to isolate this actually 64 version of the freeglut so that the dynamic linking when running a haskell code that uses glut can find the correct library(dll)

Build

Now start msys

In the terminal window now write (or put everything in a script)

export PATH=.:/usr/local/bin:/mingw/bin:/bin:/d/ghc-7.8.2/bin:/d/ghc-7.8.2/mingw/bin
cabal install -p async 
cabal install -p attoparsec 
cabal install -p case-insensitive
cabal install -p cgi 
cabal install -p fgl 
cabal install -p GLUT 
cabal install -p GLURaw 
cabal install -p hashable 
cabal install -p haskell-src 
cabal install -p html 
cabal install -p HTTP
cabal install -p HUnit 
cabal install -p mtl 
cabal install -p network 
cabal install -p OpenGL 
cabal install -p OpenGLRaw 
cabal install -p parallel 
cabal install -p parsec 
cabal install -p QuickCheck 
cabal install -p random 
cabal install -p regex-base 
cabal install -p regex-compat 
cabal install -p regex-posix 
cabal install -p split 
cabal install -p stm 
cabal install -p syb
cabal install -p text
cabal install -p transformers 
cabal install -p unordered-containers
cabal install -p vector 
cabal install -p xhtml 
cabal install -p zlib

Use

Since the msys starts a shell that is 32 you should not build your binaries within here. Instead start a plain old cmd prompt and make a simple hs program

like

module Main where
import Network.HTTP

main = do
       putStrLn "Hello World"
       r <- simpleHTTP (getRequest "http://www.haskell.org/")
       b <- getResponseBody r
       putStrLn b
       inpStr <- getLine
       putStrLn inpStr

ghc --make test64ghc.hs && test64ghc.exe

Take a look at the task manager and see that your program don't have any (32 bit) on it.

References

Footnotes

  1. Setting up a Haskell development environment on Windows

  2. GHC Windows 64bit (x86_64)

  3. Getting The Haskell Cabal

  4. freeglut Windows Development Libraries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment