WxHaskell/Installation tips: Difference between revisions
DuncanCoutts (talk | contribs) (note how easy it is on gentoo) |
No edit summary |
||
Line 45: | Line 45: | ||
** I used: <code>./configure --wx-config=/usr/local/src/wxMac-2.6.3/osx-build/wx-config --with-opengl; make; make install</code> | ** I used: <code>./configure --wx-config=/usr/local/src/wxMac-2.6.3/osx-build/wx-config --with-opengl; make; make install</code> | ||
* Enjoy | * Enjoy | ||
Alternatively: download [http://www.cs.uu.nl/~arthurvl/wxhaskell-0.9.4-ghc-6.4.1.dmg the wxhaskell 0.9.4 installer] for GHC 6.4.1 for PPC. | |||
Unknown: | Unknown: |
Revision as of 14:37, 11 September 2006
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:
cd /usr/lib/ghc-6.2.1/wxhaskell-0.7
ghc-pkg -D wxhlibdir=/usr/lib/ghc-6.2.1/wxhaskell-0.7 -ai wxcore.pkg
ghc-pkg -D wxhlibdir=/usr/lib/ghc-6.2.1/wxhaskell-0.7 -ai wx.pkg
- Another way for Debian systems:
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
wxhlibdir=/usr/lib ghc-pkg -ai /usr/lib/wxcore.pkg
wxhlibdir=/usr/lib ghc-pkg -ai /usr/lib/wx.pkg
Gentoo
wxHaskell is available in portage for x86, amd64, sparc and ppc
ACCEPT_KEYWORDS="~x86" emerge wxhaskell
(users of other arches should use their arch keywrods as appropriate)
MacOS X
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?)
./configure --disable-shared
- use the --disable-shared option for configure (this isn't needed in all cases?)
- 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!)
sudo ln -s /usr/local/wxhaskell/bin/macosx-app /usr/local/bin/
- 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:
./configure --disable-shared --enable-unicode --with-opengl --with-mac --without-odbc
- I used:
- 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:
cd wxhaskell-0.9.4; patch -p1 < ../wxhaskel-unicode.patch; cd ..
- I used:
- Change makefile so that line 718 reads:
$(CXX) -r -keep_private_externs -nostdlib -o $(WXC-OUTDIR)/master.o $^ $(WXC-LIBS) -lSystemStubs -shared-libgcc -lstdc++-static
(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:
./configure --wx-config=/usr/local/src/wxMac-2.6.3/osx-build/wx-config --with-opengl; make; make install
- I used:
- Enjoy
Alternatively: download the wxhaskell 0.9.4 installer for GHC 6.4.1 for PPC.
Unknown:
- Does the darwinports version of wxWidgets work with wxHaskell? Would be nice if somebody made a portfile for it.
Errors
- Problems compiling wxHaskell (something like the below)
/tmp/ghc29861.s:4379: Unknown pseudo-op:
.subsections_via_symbol
Make sure you have at least Xcode 1.5 (gcc 3.3 build 1671). Xcode 1.1 (gcc build 1495) is not enough - More linker trouble:
ld: out/wxc/master.o undefined symbol 36311 (__ZdaPv) can't be a weak definition
/usr/bin/libtool: internal link edit command failed
make: *** [out/wxc/libwxc-mac2.6.2-0.9.4.dylib] Error 1
- Fix seems to be to add the gcc 3.3 version of libstdc++ to your dylib: http://page.freett.com/shelarcy/log/2006/diary_02.html
- If you use gcc 4, try to add the following linker flags "-lSystemStubs -shared-libgcc -lstdc++-static". (libstdc++-static.a is part of XCode 2.3)
- If you get linker errors like it not being able to find _TextziParserCombinatorsziParsecziChar_alphaNum_closure, try editing config/config.mk and setting HC=ghc -lHSparsec. This is likely not a mac-specific problem but related to the use of GHC 6.2 over 6.0.1. (not sure if this is still valid)
- When compiling your Haskell program:
ld: /usr/lib/crt1.o illegal reference to symbol: __objcInit defined in indirectly referenced dynamic library /usr/lib/libobjc.A.dylib
- Adding -framework AppKit to the compiler switches for your Haskell program seems to help
- Certain buttons and widgets are not active
The last point is possibly a wxWidgets or a wxHaskell bug - basically, widgets in "boxed" environments do not react to user. Take out the box, and you're ok.
Windows
Installing wxHaskell is easy once you realize that the batch file (wxhaskell-register.bat) only works from folders with no spaces anywhere in the address, e.g. double clicking C:\Cygwin\wxhaskell-0.9.4\bin\wxhaskell-register.bat works but if you put the files under C:\Documents and Settings\wxhaskell-0.9.4\... or C:\Program Files\wxhaskell-0.9.4\... it might not work. Just move the installer folder wxhaskell-0.9.4 to somewhere with no spaces in the address and double-click wxhaskell-register.bat. I hope this helps someone.
FreeBSD
Anyone able to get wxHaskell working with FreeBSD? It's not in the ports unfortunately. I tried installing wxWidgets 2.4 and trying to install wxHaskell locally; it builds fine, but I try to build HelloWorld.hs I get some errors about pthreads. When I tried with wxWidgets 2.6, wxHaskell itself refuses to compile because it can't find GL/gl.h or something. Any tips? This is all on FreeBSD 5.5