Difference between revisions of "WxHaskell/Install"

From HaskellWiki
Jump to navigation Jump to search
m (Headings)
m
 
(97 intermediate revisions by 7 users not shown)
Line 1: Line 1:
  +
#REDIRECT [[WxHaskell/Building]]
== Overview ==
 
   
  +
[[Category: Pages to be removed]]
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 [http://sourceforge.net/project/showfiles.php?group_id=9863&package_id=14078 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...
 
 
* '''wxWidgets 2.6.3''': Jinwoo Lee, in a mail to wxhaskell-users and haskell-cafe mailing list, claims success in compiling wxHaskell against wxWidgets 2.6.3.
 
** Jinwoo writes: "I had problems when compiling wxhaskell 0.9.4 using wxWidgets 2.6.3. And I found out that in wxWidgets 2.6.3, some DB-related field names have changed:
 
*** columnSize --> columnLength
 
*** bufferLength --> bufferSize
 
** So I modified the file "db.cpp" (wxc/src/db.cpp), and succeeded to compile.
 
I'm attaching the modified file." (Editor's note: see http://www.haskell.org//pipermail/haskell-cafe/2006-July/thread.html#17042 to obtain the modified db.cpp)
 
 
== Getting wxHaskell ==
 
 
Obtain wxHaskell sources from [http://wxhaskell.sourceforge.net/download.html 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 [[http://www.loria.fr/~kow/download/patch-wxhaskell-unicode-08 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 [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><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:
 
** 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 ===
 
 
Getting wxHaskell 0.9.4 to work with wxWidgets 2.6 on Panther (10.3).
 
 
* install wxWidgets for mac, wxmac http://www.wxwidgets.com
 
** use the --disable-shared option for configure (this isn't needed in all cases?)<br><code>./configure --disable-shared</code>
 
* Make sure you have readline installed. The simplest way is to use fink or darwinports. http://wxhaskell.sourceforge.net/building-macosx.html
 
* grab and install [[wxHaskell]]
 
* (unique to macosx!)<br><code>sudo ln -s /usr/local/wxhaskell/bin/macosx-app /usr/local/bin/</code>
 
* See below if you have any trouble
 
 
Getting wxHaskell 0.9.4 to work with Wolfgang Thaller's installer for GHC 6.4.1 and wxWidgets 2.6.3 on Tiger (10.4.7 in my case):
 
* Download and compile wxWidgets for mac (wxMac 2.6.3) from http://www.wxwidgets.com/
 
** I used: <code>./configure --disable-shared --enable-unicode --with-opengl --with-mac --without-odbc</code>
 
* Download and unzip the sources to wxhaskell 0.9.4
 
* Download and apply the unicode patch to wxhaskell 0.9.4 from http://www.loria.fr/~kow/download/patch-wxhaskell-unicode-08
 
** I used: <code> cd wxhaskell-0.9.4; patch -p1 < ../wxhaskell-unicode.patch; cd ..</code>
 
* Change makefile so that line 718 reads: <code> $(CXX) -r -keep_private_externs -nostdlib -o $(WXC-OUTDIR)/master.o $^ $(WXC-LIBS) -lSystemStubs -shared-libgcc -lstdc++-static</code> (don't forget the tab starting the line!)
 
* Check to see if you have XCode 2.3 or newer installed; with the above line, compilation will fail with lower versions, due to a lacking libstdc++-static.a
 
* Configure wxhaskell and build it
 
** I used: <code>./configure --wx-config=/usr/local/src/wxMac-2.6.3/osx-build/wx-config --with-opengl; make; make install</code>
 
* Enjoy, but beware: not everything works cleanly. I'm looking into what causes the BouncingBalls and TimeFlows examples to fail. (20060908)
 
 
Unknown:
 
 
* Does the darwinports version of wxWidgets work with wxHaskell? Would be nice if somebody made a portfile for it.
 
 
=== Linux ===
 
 
==== Debian ====
 
 
For Debian Linux systems (as long as there's no .deb package):
 
 
* Fetch the rpm package from http://wxhaskell.sourceforge.net/download.html
 
* make sure you have wxWidgets installed (libraries and developer files)
 
* if you haven't done this already, install the debian package "alien": apt-get install alien
 
* use alien to install the rpm package: alien -i wxhaskell....rpm
 
* use ghc-pkg to add the packages wxcore and wx to ghc's package configuration file: <br /><code>cd /usr/lib/ghc-6.2.1/wxhaskell-0.7<br />ghc-pkg -D wxhlibdir=/usr/lib/ghc-6.2.1/wxhaskell-0.7 -ai wxcore.pkg<br />ghc-pkg -D wxhlibdir=/usr/lib/ghc-6.2.1/wxhaskell-0.7 -ai wx.pkg<br /></code>
 
 
Another way for Debian systems:<br /> use the repository "deb http://haskell-unsafe.alioth.debian.org/archive/i386 unstable ."
 
 
A way that surely works:
 
* Fetch the two deb packages on http://haskell-unsafe.alioth.debian.org/archive/i386/unstable/w/wxhaskell/
 
* apt-get install libwxgtk2.5-dev
 
* dpkg -i [name], where name is the name of the two packages, you should first install the normal package and then the dev-package
 
** <code>wxhlibdir=/usr/lib ghc-pkg -ai /usr/lib/wxcore.pkg</code>
 
** <code>wxhlibdir=/usr/lib ghc-pkg -ai /usr/lib/wx.pkg</code>
 
 
==== [[Gentoo]] ====
 
 
wxHaskell is available in portage for x86, amd64, sparc and ppc
 
 
<code>ACCEPT_KEYWORDS="~x86" emerge wxhaskell</code>
 
 
(users of other arches should use their arch keywrods as appropriate)
 
 
=== Old wxHaskell installation page ===
 
 
* There is an older [[WxHaskell/Installation tips | wxHaskell installation tips]] page which may contain information useful for people trying to get wxHaskell installed on older systems (e.g. OSX Panther).
 

Latest revision as of 12:49, 8 June 2023

Redirect to: