Difference between revisions of "WxHaskell/Install"

From HaskellWiki
Jump to: navigation, search
m
Line 33: Line 33:
 
* Cygwin installation. See [http://wxhaskell.sourceforge.net/building-cygwin.html | wxHaskell cygwin page] for detail, but broadly, you need Cygwin bash and install binaries.
 
* Cygwin installation. See [http://wxhaskell.sourceforge.net/building-cygwin.html | wxHaskell cygwin page] for detail, but broadly, you need Cygwin bash and install binaries.
   
* wxWidgets built/installed in a path with no spaces in it. Actually you can use a path with spaces but there are a few rules. For example, I had ghc installed to this location:<br/><tt>C:\Program Files\Visual Haskell</tt><br/>So this required me to use the following configure command:<br/><tt>./configure --libdir=C:/Progra~1/Visual~1</tt>
+
* wxWidgets built/installed in a path with no spaces in it. Actually you can use a path with spaces but there are a few rules. For example, I had ghc installed to this location:<br/><tt>C:\Program Files\Visual Haskell</tt><br/>So this required me to use the following configure command:<br/><tt>./configure --libdir=C:/Progra~1/Visual~1</tt><br/>
  +
The two important things here are: 1) You must use the forward slash
  +
and 2) you cannot use spaces.
  +
  +
After wxHaskell installed I started getting panics from 'ghc -package wx':<br/>
  +
http://www.haskell.org/pipermail/glasgow-haskell-bugs/2005-October/005632.html<br/>
  +
And I found a solution here:<br/>
  +
http://www.haskell.org/pipermail/glasgow-haskell-bugs/2005-October/005639.html
  +
  +
Next I found that I needed to add <tt>C:\Program Files\Visual Haskell</tt> to
  +
my path so that the wxHaskell dlls could be located by windows.
   
 
* Environment variables:
 
* Environment variables:

Revision as of 16:54, 26 July 2006

Overview

This page describes how to get a working wxHaskell installation on various platforms. This is not as easy as it might be, as the wxHaskell project has not received much attention since around May 2005 (at time of writing). This means that the available binary packages are unlikely to meet your needs, and you will probably have to build from source.

Getting wxWidgets

wxHaskell would not build cleanly for me with the most recent variants of wxWidgets. Under Windows, I was successful in compiling against wxWidgets 2.4.2. Mac OSX (Tiger) has a pre-installed version of wxWidgets 2.5, and it is possible to compile against this provided that a patch is applied - see the section on Mac OSX for details.

  • For PC running Windows: I recommend wxWidgets 2.4.2. Newer versions are alleged to build, but I (and others) have had problems. If you want to use ghci, you definitely want 2.4.2. Download from Sourceforge. Unless you particularly wish to build from source, the wxMSW-2.4.2-setup.zip download is fine (it provides a Windows installer for most of what you need. Documentation is a separate (and useful) download. You will make your life easier if you install to a path which does not contain spaces - my recollection is that this is not the default provided by the installer.
  • For Mac running OSX (Tiger): I recommend the provided pre-installed wxWidgets.
  • For Linux: Recommendations welcome...

Getting wxHaskell

Obtain wxHaskell sources from Sourceforge.

OSX caveats:

  • The installation of wxWidgets provided with OSX is a Unicode build. The wxHaskell sources you obtained above are not Unicode clean, and will fail to compile on OSX. Eric Kow at Loria has done a lot of work to sort this out. You can download the fruits of this as a single patch to be applied to the wxHaskell distribution at [Eric Kow wxHaskell Unicode Patch (08)].
  • wxHaskell does not build cleanly using gcc 4.0 (the OSX default). You will need to switch to gcc 3.3 (sudo gcc_select 3.3) before compiling.

Building and Installing

Windows

Assumptions (a.k.a. what I have tested)

  • GHC 6.4.2 (Jason Dagit reports success with GHC 6.5 as well).
  • Cygwin installation. See | wxHaskell cygwin page for detail, but broadly, you need Cygwin bash and install binaries.
  • wxWidgets built/installed in a path with no spaces in it. Actually you can use a path with spaces but there are a few rules. For example, I had ghc installed to this location:
    C:\Program Files\Visual Haskell
    So this required me to use the following configure command:
    ./configure --libdir=C:/Progra~1/Visual~1

The two important things here are: 1) You must use the forward slash and 2) you cannot use spaces.

After wxHaskell installed I started getting panics from 'ghc -package wx':
http://www.haskell.org/pipermail/glasgow-haskell-bugs/2005-October/005632.html
And I found a solution here:
http://www.haskell.org/pipermail/glasgow-haskell-bugs/2005-October/005639.html

Next I found that I needed to add C:\Program Files\Visual Haskell to my path so that the wxHaskell dlls could be located by windows.

  • Environment variables:
    • PATH should include MinGW and Cygwin binary directories. MinGW must come before Cygwin in PATH.
    • WXHASKELL environment var points to wxHaskell install directory.
    • WXWIN environment directory points to wxWidgets install directory.

Mac OSX

Linux