Difference between revisions of "GHC under Wine"

From HaskellWiki
Jump to navigation Jump to search
m (→‎Known Problems: Heading case)
(add suggestion to file bugs with wine project and removed old ghci IO issue, update install information, fix capitilzation of Wine)
Line 1: Line 1:
 
[[Category:GHC|WINE]]
 
[[Category:GHC|WINE]]
[[GHC]] runs fairly well under WINE. Here's a guide on how to get it working.
+
[[GHC]] runs fairly well under Wine. Here's a guide on how to get it working.
 
==Installation==
 
==Installation==
First, get the latest version of WINE from http://www.winehq.com/site/download and install it.
+
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
 
Next, grab the latest [[windows]] version of GHC from http://haskell.org/ghc/download.html
   
  +
installing ghc is as simple as typing: <code>wine ghc-6.8.2-i386-unknown-mingw32.exe</code>
Using the precompiled version of ghc requires adding MSI support to WINE. Luckily, work has been done on developing a native version of MSI for wine. Get it at http://wiki.winehq.org/NativeMsi and follow the instructions to install it.
 
   
 
Once this is all done, you should be good to start using GHC.
Now go to the directory where you've put your download of ghc. install it:
 
::<code>wine msiexec.exe /i ghc-VERSION.msi</code>
 
 
This should start up the installer and walk you through the installation.
 
 
Once this is all done, you should be good to start using GHC. You might want to add GHC to your path. To do this fire up regedit:<br/>
 
::<code>wine regedit</code><br/>
 
and go to <code>HKEY_LOCAL_MACHINE->System->CurrentControlSet->Control->Session Manager->Environment->Path</code>. Add GHC's installation to the pathlist. It will probably be something like <code>C:\ghc\ghc-VERSION\bin</code>
 
   
 
==Testing==
 
==Testing==
Line 34: Line 27:
 
Wine exited with a successful status</pre></code>
 
Wine exited with a successful status</pre></code>
   
If it all works well then you should hopefully be able to compile your haskell programs for windows from wine.
+
If it all works well then you should be able to compile your haskell programs for windows with wine.
   
   
 
== Known problems ==
 
== 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)
  +
 
===Windows DLL's===
 
===Windows DLL's===
 
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.
 
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.
 
===IO issues===
 
<hask>hSetBuffering</hask> doesn't seem to work well from terminals. This creates problems with GHCi:
 
 
<code><pre>$ wine ghci
 
WARNING: GHCi invoked via 'ghci.exe' in *nix-like shells (cygwin-bash, in particular)
 
doesn't handle Ctrl-C well; use the 'ghcii.sh' shell wrapper instead
 
___ ___ _
 
/ _ \ /\ /\/ __(_)
 
/ /_\// /_/ / / | | GHC Interactive, version 6.4.2, for Haskell 98.
 
/ /_\\/ __ / /___| | http://www.haskell.org/ghc/
 
\____/\/ /_/\____/|_| Type :? for help.
 
 
Loading package base-1.0 ... linking ... done.
 
<stdin>: hSetBuffering: failed (failed to set buffering)
 
Wine exited with a successful status</pre></code>
 

Revision as of 11:57, 18 January 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)

Windows DLL's

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.