Difference between revisions of "GHC under Wine"

From HaskellWiki
Jump to navigation Jump to search
(added open bugs)
(cleanup native dlls section)
Line 36: Line 36:
   
 
* GHC 6.8.2 appears to suffer from some sort of heap corruption when run under wine, at the time of writing it is not yet known if wine is at fault or there really is heap corruption in GHC, see [http://bugs.winehq.org/show_bug.cgi?id=11547 http://bugs.winehq.org/show_bug.cgi?id=11547]
 
* GHC 6.8.2 appears to suffer from some sort of heap corruption when run under wine, at the time of writing it is not yet known if wine is at fault or there really is heap corruption in GHC, see [http://bugs.winehq.org/show_bug.cgi?id=11547 http://bugs.winehq.org/show_bug.cgi?id=11547]
===Windows DLL's===
+
===Native DLLs===
  +
Wine isn't perfect (yet) but does offer a solution for using native dlls, as an alternative to builtin dlls if certain functions are not implemented or are buggy and not yet fixed. To configure this use winecfg where you can specify settings for the ordering of preferences for loading dlls, Builtin only, Native only, Builtin then Native and Native then Builtin.
wine's builtin msvcrt.dll may not work nicely with compilation of more complicated programs. To get around this a native version of the DLL can be found at places such as http://www.dll-files.com/dllindex/index.shtml . Disclaimer: I am unsure of what the legal implications of using this DLL without a licensed copy of windows might be.
 

Revision as of 01:22, 13 February 2008

GHC runs fairly well under Wine. Here's a guide on how to get it working.

Installation

First, get the latest version of Wine from http://www.winehq.com/site/download and install it.

Next, grab the latest windows version of GHC from http://haskell.org/ghc/download.html

installing ghc is as simple as typing: wine ghc-6.8.2-i386-unknown-mingw32.exe

Once this is all done, you should be good to start using GHC.

Testing

Create a simple haskell program to compile. Hello World examples are good. Try compiling it:

$ wine ghc -o hello --make HelloWorld.hs
Chasing modules from: HelloWorld.hs
Compiling Main             ( HelloWorld.hs, HelloWorld.o )
fixme:msvcrt:MSVCRT__sopen : pmode 0x01b6 ignored
fixme:msvcrt:MSVCRT__sopen : pmode 0x01b6 ignored
Linking ...
Wine exited with a successful status

And try running it:

$ wine hello
Hello, world!
Wine exited with a successful status

If it all works well then you should be able to compile your haskell programs for windows with wine.


Known problems

If you encounter specific, reproducible issues that are present in the latest release of wine you should file a bug report with the Wine project http://bugs.winehq.org (so long as one doesn't already exist for the issue)

Open bugs:

  • GHC 6.8.2 appears to suffer from some sort of heap corruption when run under wine, at the time of writing it is not yet known if wine is at fault or there really is heap corruption in GHC, see http://bugs.winehq.org/show_bug.cgi?id=11547

Native DLLs

Wine isn't perfect (yet) but does offer a solution for using native dlls, as an alternative to builtin dlls if certain functions are not implemented or are buggy and not yet fixed. To configure this use winecfg where you can specify settings for the ordering of preferences for loading dlls, Builtin only, Native only, Builtin then Native and Native then Builtin.