Changes between Version 49 and Version 50 of Building/Windows


Ignore:
Timestamp:
Mar 16, 2009 10:47:32 AM (6 years ago)
Author:
simonmar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Building/Windows

    v49 v50  
    33If you're looking for instructions for building GHC on Windows, they are now incorporated in the main [wiki:Building Building Guide].
    44
    5 == A Windows build log using Cygwin ==
     5Other pages below here:
    66
    7 Here is a complete, from-scratch, log of all you need to build GHC using
    8 Cygwin, kindly provided by Claus Reinke.  It does not discuss alternative
    9 choices, but it gives a single path that works. Please help us to keep this
    10 up to date: if you are using newer versions, let us know whether you succeed
    11 or run into issues while following this log.
    12 
    13 Note: starting with the [http://cygwin.com/ml/cygwin-announce/2008-08/msg00001.html August 2008 version of 'setup.exe'], adding 'http://www.haskell.org/ghc/cygwin' will not work unless you disable verification (not recommended) - until that site has a signature, you can add the dependencies from [http://www.haskell.org/ghc/cygwin/setup.ini 'Devel->ghc-depends'] manually.
    14 {{{
    15 - Install some editor (vim, emacs, whatever)
    16 
    17 - Install cygwin (http://www.cygwin.com)
    18     ; i used 1.5.16-1, installed in c:\cygwin
    19   - run 'setup.exe'
    20     Choose a Download Source:
    21         select 'download from internet';
    22     Select Root Install Directory:
    23         root dir: c:\cygwin;
    24         install for: all users;
    25         default file type: unix
    26     Select Local Package Directory
    27         choose a spare temporary home
    28     Select Your Internet Connection
    29         Use IE5 settings
    30     Choose a Download Site
    31         Choose your preferred main mirror and
    32         Add 'http://www.haskell.org/ghc/cygwin'
    33     Select Packages
    34         In addition to 'Base' (default install),
    35         select 'Devel->ghc-depends'
    36 
    37 - Install mingw (http://www.mingw.org/)
    38     ; i used MinGW-3.1.0-1.exe
    39     ; installed in c:\mingw
    40   - you probably want to add GLUT
    41     ; (http://www.xmission.com/~nate/glut.html)
    42     ; i used glut-3.7.3-mingw32.tar
    43 
    44 - Get recent binary snapshot of ghc-6.4.1 for mingw
    45     ; (http://www.haskell.org/ghc/dist/stable/dist/)
    46   - unpack in c:/ghc
    47   - add C:\ghc\ghc-6.4.1\bin to %PATH%
    48     (Start->Control Panel->System->Advanced->Environment Variables)
    49 
    50 - Get and install binary release of darcs
    51     ; (http://zooko.com/darcs/darcsdir-cygwin-1.0.7.tar.bz2)
    52 
    53 - In the following, shell commands are entered in cygwin bash
    54 
    55 - Get darcs version of ghc
    56     ; also, subscribe to [email protected], and possibly
    57     ; to [email protected], or follow the mailing list
    58     ; archives, in case you checkout a version with problems
    59     ; http://www.haskell.org/mailman/listinfo/cvs-ghc/
    60     ; http://www.haskell.org/mailman/listinfo/cvs-libraries/
    61 
    62   - mkdir c:/ghc-build; cd c:/ghc-build
    63     ; (or whereever you want your darcs tree to be)
    64   - darcs get --partial http://darcs.haskell.org/ghc
    65   - cd ghc
    66   - chmod +x darcs-all
    67   - ./darcs-all get
    68 
    69 - Build ghc, using cygwin and mingw, targetting mingw
    70   - export PATH=/cygdrive/c/ghc/ghc-6.4.1:$PATH
    71     ; for haddock, alex, happy (*)
    72   - export PATH=/cygdrive/c/mingw/bin:$PATH
    73     ; without, we pick up some cygwin tools at best!
    74   - cd c:/ghc-build/ghc
    75     ; (if you aren't there already)
    76   - sh boot
    77   - ./configure --host=i386-unknown-mingw32 --with-gcc=C:/Mingw/bin/gcc.exe --with-ld=C:/Mingw/bin/ld.exe
    78     ; we use cygwin, but build for windows
    79   - cp mk/build.mk.sample mk/build.mk
    80   - in mk/build.mk:
    81     add line:       SplitObjs = NO
    82         (MSYS seems slow when there are zillions of object files)
    83     uncomment line: BuildFlavour = perf
    84         (or BuildFlavour = devel, if you are doing development)
    85     add line:       BIN_DIST=1
    86   - make 2>&1 | tee make.log
    87     ; always useful to have a log around
    88 
    89 - Package up binary distribution
    90   - make binary-dist 2>&1 | tee make-bin-dist.log
    91     ; always useful to have a log around
    92   - unpack ghc-<version>-i386-unknown-mingw32.tar.bz2 somewhere in your filesystem...
    93 }}}
    94 
    95 {{{
    96 Additional notes from Neil Mitchell:
    97 
    98 - cygwin installation doesn't quite work with the latest version because the ghc
    99   depends file doesn't have a .sig file with it
    100 
    101 - for mingw installation just select the minimal package (or at least i did...)
    102 
    103 - I got the following hiccup, which seemed transient:
    104 ----------
    105 nmitche6@wlon1207009001 /cygdrive/c/ghc-build/ghc
    106 $ sh boot
    107 Booting .
    108 /usr/bin/m4:configure.ac:1281: cannot create temporary file for diversion: Permi
    109 ssion denied
    110 autom4te-2.61: /usr/bin/m4 failed with exit status: 1
    111 Booting libraries/base
    112 Booting libraries/directory
    113 Booting libraries/editline
    114 Booting libraries/old-time
    115 Booting libraries/process
    116 Booting libraries/unix
    117 
    118 nmitche6@wlon1207009001 /cygdrive/c/ghc-build/ghc
    119 $ ./configure --host=i386-unknown-mingw32 --with-gcc=C:/Mingw/bin/gcc.exe --wit
    120 h-ld=C:/Mingw/bin/ld.exe
    121 configure: WARNING: If you wanted to set the --build type, don't use --host.
    122     If a cross compiler is detected then cross compile mode will be used.
    123 mk/config.h.in doesn't exist: perhaps you haven't run 'sh boot'?
    124 
    125 nmitche6@wlon1207009001 /cygdrive/c/ghc-build/ghc
    126 $ sh boot
    127 Booting .
    128 Booting libraries/base
    129 Booting libraries/directory
    130 Booting libraries/editline
    131 Booting libraries/old-time
    132 Booting libraries/process
    133 Booting libraries/unix
    134 ---------
    135 
    136 - I required happy, haddock and alex to be installed
    137 
    138 - Everything failed a few minutes in to the compile:
    139   http://www.haskell.org/pipermail/glasgow-haskell-users/2008-September/015429.html
    140   No solutions are yet known
    141 
    142 - http://www.nabble.com/cc1-not-found-td9742088.html - looks interesting, tried adding
    143   c:\mingw\libexec\gcc\mingw32\3.4.5 to the $PATH
    144 
    145 - Some hacks make the build get further:
    146   http://www.haskell.org/pipermail/glasgow-haskell-users/2008-September/015434.html
    147 
    148 - Plus some things that don't work with the latest mingw:
    149   http://www.haskell.org/pipermail/cvs-ghc/2008-September/044945.html
    150 }}}
     7 * [wiki:Building/Windows/Cygwin]: instructions for installing Cygwin for building GHC
     8 * [wiki:Building/Windows/SSH]: instructions for configuring SSH on Windows (not necessary for building or submitting patches to GHC, only necessary if you have permission and want to ''push'' patches to the main GHC repository).