Personal tools

Windows

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
m
(Special tips and tricks for Windows: Added a link to "Terminal Win32/Building Haskeline/8.3 file issue"; deleted the comments about using reverse dependency lookup)
(12 intermediate revisions by 4 users not shown)
Line 3: Line 3:
 
* [http://www.e-texteditor.com/ E-Text Editor (TextMate for Windows)]
 
* [http://www.e-texteditor.com/ E-Text Editor (TextMate for Windows)]
 
* [http://www.textpad.com/ TextPad]
 
* [http://www.textpad.com/ TextPad]
* Emacs, Vi(m), etc
+
* [http://ftp.gnu.org/gnu/emacs/windows/ Emacs], [http://www.vim.org/ Vi(m)], etc
* [http://www.haskell.org/visualhaskell/ Visual Haskell]
+
* [http://www.leksah.org/index.html Leksah]: Haskell IDE written in Haskell
 
* [http://eclipsefp.sourceforge.net/ Eclipse]
 
* [http://eclipsefp.sourceforge.net/ Eclipse]
* [http://notepad-plus.sourceforge.net Notepad++]
+
* [http://notepad-plus-plus.org/ Notepad++]
 
* [http://www.sublimetext.com/ Sublime Text]
 
* [http://www.sublimetext.com/ Sublime Text]
 
* [http://www.pnotepad.org/ Programmer's Notepad]
 
* [http://www.pnotepad.org/ Programmer's Notepad]
Line 12: Line 12:
 
== Compilers/interpreters ==
 
== Compilers/interpreters ==
   
* [http://hackage.haskell.org/platform/ The Haskell Platform] is a combination of GHC and a set of blessed libraries
+
* [http://www.haskell.org/platform/ The Haskell Platform] is a combination of GHC and a set of blessed libraries
 
* [[WinHugs]]
 
* [[WinHugs]]
 
* [[GHC]]: Special notes for Cygwin users - [http://www.haskell.org/ghc/docs/6.6/html/building/platforms.html] [http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-cygwin.html]
 
* [[GHC]]: Special notes for Cygwin users - [http://www.haskell.org/ghc/docs/6.6/html/building/platforms.html] [http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-cygwin.html]
* [http://code.google.com/p/winghci/ WinGhci] A GUI for GHCi
+
* [http://code.google.com/p/winghci/ WinGhci], a GUI for GHCi (included in the Haskell Platform)
   
 
== Tools for compilation ==
 
== Tools for compilation ==
Line 21: Line 21:
 
* As some of the packages contain Unix/Linux specific scripts/commands, you need [http://www.mingw.org/ MinGW] and [http://www.mingw.org/wiki/msys MSYS] to simulate a Unix environment. In some cases you need [http://www.cygwin.com/ Cygwin] instead. If you use [http://code.google.com/p/msysgit/ msysgit] on Windows already, all you need to do is add MinGW to your path.
 
* As some of the packages contain Unix/Linux specific scripts/commands, you need [http://www.mingw.org/ MinGW] and [http://www.mingw.org/wiki/msys MSYS] to simulate a Unix environment. In some cases you need [http://www.cygwin.com/ Cygwin] instead. If you use [http://code.google.com/p/msysgit/ msysgit] on Windows already, all you need to do is add MinGW to your path.
   
* If you need to link to C-software, [http://en.wikipedia.org/wiki/Environment_variable#DOS_and_Windows define an environment variable] C_INCLUDE_PATH that lists the directories where the header files can be found. For linking the libraries you need to define an environment variable LIBRARY_PATH as well, listing the directories where .a and .lib files can be found. In case C++ software must be compiled, define CPLUS_INCLUDE_PATH to list the directories with C++ header files.
+
* If you need to link to C-software, [http://en.wikipedia.org/wiki/Environment_variable#DOS.2C_OS.2F2_and_Windows_.28Command_Prompt.29 define environment variable] C_INCLUDE_PATH that lists the directories where the header files can be found, for example:
  +
Set C_INCLUDE_PATH=C:\usr\local\include;C:\usr\local\include\SDL
  +
:(It is advisable to use paths without spaces, because some scripts in the MinGW/MSYS environment have problems with spaces in paths.)<br>
  +
:For linking the libraries you need to define environment variable LIBRARY_PATH as well, listing the directories where .a and .lib files can be found. In case C++ software must be compiled, define CPLUS_INCLUDE_PATH to list the directories with C++ header files.
   
 
* Packages are often delivered as a .tar or .tar.gz file, see [[How to unpack a tar file in windows]]
 
* Packages are often delivered as a .tar or .tar.gz file, see [[How to unpack a tar file in windows]]
   
The following two items are somewhat spurious, this is not strictly necessary, it only causes issue if file IO is done in textmode rather than binary, since the whole business of line endings stems from this.
+
* To work with/produce DLL files with GHC < 7.0.1, you need dlltool.exe, from the [http://sourceforge.net/projects/mingw/files/ mingw-binutils] package and pexports.exe from the [http://sourceforge.net/projects/mingw/files/ mingw-utils] package. For more information see [http://www.cse.yorku.ca/tdb/_doc.php/userg/man/name/dlltool/section/1 the dlltool manual] and [http://www.willus.com/mingw/yongweiwu_stdcall.html Stdcall and DLL tools of MSVC and MinGW]
+
: If you have GHC >= 7.0.1, see [http://www.haskell.org/ghc/docs/latest/html/users_guide/using-shared-libs.html Using shared libraries] or [http://www.haskell.org/ghc/docs/latest/html/users_guide/win32-dlls.html Building and using Win32 DLLs]
* Source files from Unix(-like) systems have lines terminated with Line Feed only; to convert them to MS-DOS format, use the <code>unix2dos</code> command (from the [http://sourceforge.net/projects/mingw/files/ mingw-utils] package). For more information, give command: <code>unix2dos --help</code>
 
 
* To convert a set of files to MS-DOS format (note: this might damage binary files):
 
::<code>C:\MSYS\1.0\bin\find . -type f -exec unix2dos {} ;</code>
 
:Note: the <code>find</code> command included in MSYS is different from the MS-DOS <code>find</code> command, therefore, you need to specify the entire path to this command.
 
 
* To work with/produce DLL files, you need dlltool.exe, from the [http://sourceforge.net/projects/mingw/files/ mingw-binutils] package and pexports.exe from the [http://sourceforge.net/projects/mingw/files/ mingw-utils] package. For more information see [http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gnu-binutils/dlltool.html the dlltool manual] and [http://www.willus.com/mingw/yongweiwu_stdcall.html Stdcall and DLL tools of MSVC and MinGW]
 
   
 
== Libraries ==
 
== Libraries ==
Line 34: Line 34:
 
* GUI : [[Gtk2Hs]] - A binding of GTK in Haskell. Note this requires installing [http://www.gtk.org GTK] on windows.
 
* GUI : [[Gtk2Hs]] - A binding of GTK in Haskell. Note this requires installing [http://www.gtk.org GTK] on windows.
   
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Win32 Win32] - low levelish bindings to Windows API. Comes with ghc and non-minimal hugs distribution. [http://darcs.haskell.org/ Win32 darcs repo]
+
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Win32 Win32] - low levelish bindings to Windows API. Comes with GHC and non-minimal hugs distribution. [http://darcs.haskell.org/ Win32 darcs repo]
   
 
* [[HDBC-ODBC under Windows]] for database access.
 
* [[HDBC-ODBC under Windows]] for database access.
Line 42: Line 42:
   
 
== Special tips and tricks for Windows ==
 
== Special tips and tricks for Windows ==
  +
  +
* [http://www.haskell.org/pipermail/haskell-cafe/2013-February/106436.html Terminal Win32/Building Haskeline/8.3 file issue] (Haskell-cafe)
   
 
* darcs : http://wiki.darcs.net/WindowsConfiguration
 
* darcs : http://wiki.darcs.net/WindowsConfiguration
Line 49: Line 51:
 
* GHCi: Using GHCi from a Win32 console is not everyones cup of tea. Using it from within shell mode in Emacs sucks a lot less - do 'M-x shell' in emacs, then type 'ghci'.
 
* GHCi: Using GHCi from a Win32 console is not everyones cup of tea. Using it from within shell mode in Emacs sucks a lot less - do 'M-x shell' in emacs, then type 'ghci'.
   
* GHCi on Cygwin: When running GHC under a Cygwin shell on Windows, Ctrl-C sometimes doesn't work. A workaround is to use the rlwrap program to invoke ghci : In addition to proper Ctrl-C, you also get emacs (or vi) key bindings and command history across sessions, which saves you a load of typing.
+
* GHCi on Cygwin: When running GHC under a Cygwin shell on Windows, Ctrl-C sometimes doesn't work. A workaround is to use the rlwrap program to invoke GHCi : In addition to proper Ctrl-C, you also get emacs (or vi) key bindings and command history across sessions, which saves you a load of typing.
   
* If a package depends (either directly or indirectly) on the <code>unix</code> package, you cannot compile it on Windows; see the [http://bifunctor.homelinux.net/~roel/cgi-bin/hackage-scripts/revdeps/unix reversed dependencies list]. However, sometimes, the dependency changes per platform; see for example the [http://hackage.haskell.org/packages/archive/directory/1.0.1.0/directory.cabal cabal file] of the <code>directory</code> package
+
* If a package depends (either directly or indirectly) on the <code>unix</code> package, you cannot compile it on Windows.
  +
:A simple way to see, if a package X depends on <code>unix</code>, is giving the command:
  +
cabal install X --dry-run
  +
:This will list all packages that would be installed
   
* If you are missing or need to distribute libraries with an application, the correct place to put them is *NOT* in \WINDOWS\System32 as once was the practice in the early days of Windows. All sane applications/installers keep their own private dependencies in the application directory. Eg, if the user has chosen to install your application to C:\Program Files\Foo then it is best to install any DLLs in the same location.
+
* If you are missing or need to distribute libraries with an application, the correct place to put them is *NOT* in \WINDOWS\System32 as once was the practice in the early days of Windows. All sane applications/installers keep their own private dependencies in the application directory. E.g., if the user has chosen to install your application to C:\Program Files\Foo then it is best to install any DLLs in the same location.
   
== Direct downloads ==
+
* When compiling a program with GUI, use the compiler option -optl-mwindows to prevent a DOS-shell being displayed behind your GUI. (This passes the option -mwindows to the linker.)
  +
  +
* Source files from Unix(-like) systems have lines terminated with Line Feed only; if your favorite editor cannot handle this, you can convert the files to MS-DOS format with the <code>unix2dos</code> command (from the [http://sourceforge.net/projects/mingw/files/ mingw-utils] package). For more information, give command: <code>unix2dos --help</code>
  +
:Note, that GHC can handle source files in Unix format.
  +
  +
* To convert a set of files to MS-DOS format (note: this might damage binary files):
  +
::<code>C:\MSYS\1.0\bin\find . -type f -exec unix2dos {} ;</code>
  +
:Note: the <code>find</code> command included in MSYS is different from the MS-DOS <code>find</code> command, therefore, you need to specify the entire path to this command.
  +
  +
== Binary downloads ==
   
 
=== Haskell ===
 
=== Haskell ===
   
Below a list of binary packages packages for Windows. To be sure you get the last version of each, it is best to download the source from [http://hackage.haskell.org/packages/archive/pkg-list.html Hackage] and compile.
+
Below a list of binary packages for Windows. To be sure you get the last version of each, it is best to download the source from [http://hackage.haskell.org/packages/archive/pkg-list.html Hackage] and compile (except for the Haskell Platform).
   
[http://www.haskell.org/alex/dist/alex-2.0.1-win32.zip Alex 2.0.1] (obsolete) [http://www.haskell.org/haskellwiki/Alex/ (website)] ;
+
[http://www.haskell.org/platform/windows.html The Haskell Platform] [[Haskell Platform | (HaskellWiki page)]], contains GHC and a set of libraries and tools;
[http://www.cs.york.ac.uk/fp/cpphs-1.2-win32.zip Cpphs 1.2] (obsolete) [http://haskell.org/cpphs/ (website)] ;
+
[http://www.haskell.org/ghc/download_ghc_7_6_1#windows GHC 7.6.1] [[GHC | (HaskellWiki page)]];
[http://homepage.mac.com/kirby81_it/darcs/darcs-2.2.1-win1.zip Darcs 2.2.1 for Windows without Cygwin] ;
+
[http://darcs.net/Binaries Darcs] [[Darcs | (HaskellWiki page)]];
[http://testgrid.allmydata.org:3567/uri/URI:DIR2-RO:bminllzdrpadzvyt54cbhotnam:jqafknaedfksjjq3xmkfpe4g4ppklctw3xwpszufol7zddyx5agq/darcsdir-w32-2.2.0.zip Darcs 2.2.0 for Windows without Cygwin, with SSH support files] ;
 
[http://testgrid.allmydata.org:3567/uri/URI:DIR2-RO:bminllzdrpadzvyt54cbhotnam:jqafknaedfksjjq3xmkfpe4g4ppklctw3xwpszufol7zddyx5agq/darcsdir-cygwin-2.2.0.tar.bz2 Darcs 2.2.0 for Windows with Cygwin] [http://darcs.net/ (website)] ;
 
 
[http://repetae.net/computer/haskell/DrIFT/drop/ Drift] [http://repetae.net/computer/haskell/DrIFT/ (website)] ;
 
[http://repetae.net/computer/haskell/DrIFT/drop/ Drift] [http://repetae.net/computer/haskell/DrIFT/ (website)] ;
[http://haskell.org/ghc/dist/6.10.1/ghc-6.10.1-i386-windows.exe GHC 6.10.1]
+
[http://www.haskell.org/haddock/haddock-0.7-Win32.zip Haddock 0.7] (obsolete) [http://www.haskell.org/haddock/ (website)] ;
[http://haskell.org/ghc/ (website)] ;
 
[http://haskell.org/haddock/haddock-0.7-Win32.zip Haddock 0.7] (obsolete) [http://haskell.org/haddock/ (website)] ;
 
[http://www.cs.york.ac.uk/fp/temp/hat-win32-05_jul_2006.zip Hat July 2006] [http://haskell.org/hat/ (website)] ;
 
 
[http://www.haskell.org/happy/dist/1.13/happy-1-13.msi Happy 1.13] (obsolete) [http://www.haskell.org/happy/ (website)] ;
 
[http://www.haskell.org/happy/dist/1.13/happy-1-13.msi Happy 1.13] (obsolete) [http://www.haskell.org/happy/ (website)] ;
[http://www.haskell.org/hoogle/other/hoogle-win32.zip Hoogle June 2006] (obsolete) [http://www.haskell.org/hoogle/ (website)] ;
 
 
[ftp://ftp.cs.york.ac.uk/pub/haskell/contrib/hscolour-1.9.zip HsColour 1.9] [http://www.cs.york.ac.uk/fp/darcs/hscolour/ (website)] ;
 
[ftp://ftp.cs.york.ac.uk/pub/haskell/contrib/hscolour-1.9.zip HsColour 1.9] [http://www.cs.york.ac.uk/fp/darcs/hscolour/ (website)] ;
[http://haskell.org/hoogle/other/lambdashell-0.3.zip Lambda Shell 0.3] (obsolete) [http://www.cs.princeton.edu/~rdockins/lambda/home/ (website)] ;
+
[http://cvs.haskell.org/Hugs/pages/downloading.htm WinHugs September 2006] [http://www.haskell.org/hugs/ (website)] ;
[http://ndmitchell.googlecode.com/files/WinHugs-Sep2006.exe WinHugs September 2006] [http://www.haskell.org/hugs/ (website)] ;
 
 
[http://haskell.forkio.com/Home/curl-win32/curl-7.19.4-mingw32.zip?attredirects=0 cURL 7.19.4] [http://haskell.forkio.com/Home/curl-win32/ (website)] ;
 
[http://haskell.forkio.com/Home/curl-win32/curl-7.19.4-mingw32.zip?attredirects=0 cURL 7.19.4] [http://haskell.forkio.com/Home/curl-win32/ (website)] ;
 
   
 
=== Development ===
 
=== Development ===
   
[ftp://ftp.gnu.org/gnu/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip CVS 1.11.22] [http://www.nongnu.org/cvs/ (website)] ; [http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi Python 2.4.3] [http://www.python.org/ (website)] ; [http://sourceforge.net/projects/scons/files/ Scons] [http://www.scons.org/ (website)] ; [http://subversion.tigris.org/files/documents/15/32856/svn-1.3.2-setup.exe SVN 1.3.2] [http://subversion.tigris.org/ (website)] ; [ftp://download.textpad.com/pub/textpad4.7/txpeng473.exe TextPad 4.7.3] [http://www.textpad.com/ (website)]
+
[ftp://ftp.gnu.org/gnu/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip CVS 1.11.22] [http://www.nongnu.org/cvs/ (website)] ; [http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi Python 2.4.3] [http://www.python.org/ (website)] ; [http://sourceforge.net/projects/scons/files/ Scons] [http://www.scons.org/ (website)] ; [http://subversion.tigris.org/files/documents/15/32856/svn-1.3.2-setup.exe SVN 1.3.2] [http://subversion.tigris.org/ (website)] ; [http://www.textpad.com/download/ TextPad] [http://www.textpad.com/ (website)]
   
 
== Shipping Installable Applications ==
 
== Shipping Installable Applications ==
   
 
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bamse bamse] lets you build windows installers for your Haskell app (MSI).
 
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bamse bamse] lets you build windows installers for your Haskell app (MSI).
  +
* [http://www.jrsoftware.org/isinfo.php Inno Setup] is another tool to create windows installers.
  +
   
 
[[Category:OS]]
 
[[Category:OS]]

Revision as of 19:46, 17 February 2013

Contents

1 Editors

2 Compilers/interpreters

3 Tools for compilation

  • As some of the packages contain Unix/Linux specific scripts/commands, you need MinGW and MSYS to simulate a Unix environment. In some cases you need Cygwin instead. If you use msysgit on Windows already, all you need to do is add MinGW to your path.
  • If you need to link to C-software, define environment variable C_INCLUDE_PATH that lists the directories where the header files can be found, for example:
    Set C_INCLUDE_PATH=C:\usr\local\include;C:\usr\local\include\SDL
(It is advisable to use paths without spaces, because some scripts in the MinGW/MSYS environment have problems with spaces in paths.)
For linking the libraries you need to define environment variable LIBRARY_PATH as well, listing the directories where .a and .lib files can be found. In case C++ software must be compiled, define CPLUS_INCLUDE_PATH to list the directories with C++ header files.
If you have GHC >= 7.0.1, see Using shared libraries or Building and using Win32 DLLs

4 Libraries

  • GUI : Gtk2Hs - A binding of GTK in Haskell. Note this requires installing GTK on windows.
  • Win32 - low levelish bindings to Windows API. Comes with GHC and non-minimal hugs distribution. Win32 darcs repo
  • winerror: Error handling for foreign calls to the Windows API


5 Special tips and tricks for Windows

  • GHCi: Using GHCi from a Win32 console is not everyones cup of tea. Using it from within shell mode in Emacs sucks a lot less - do 'M-x shell' in emacs, then type 'ghci'.
  • GHCi on Cygwin: When running GHC under a Cygwin shell on Windows, Ctrl-C sometimes doesn't work. A workaround is to use the rlwrap program to invoke GHCi : In addition to proper Ctrl-C, you also get emacs (or vi) key bindings and command history across sessions, which saves you a load of typing.
  • If a package depends (either directly or indirectly) on the unix package, you cannot compile it on Windows.
A simple way to see, if a package X depends on unix, is giving the command:
   cabal install X --dry-run
This will list all packages that would be installed
  • If you are missing or need to distribute libraries with an application, the correct place to put them is *NOT* in \WINDOWS\System32 as once was the practice in the early days of Windows. All sane applications/installers keep their own private dependencies in the application directory. E.g., if the user has chosen to install your application to C:\Program Files\Foo then it is best to install any DLLs in the same location.
  • When compiling a program with GUI, use the compiler option -optl-mwindows to prevent a DOS-shell being displayed behind your GUI. (This passes the option -mwindows to the linker.)
  • Source files from Unix(-like) systems have lines terminated with Line Feed only; if your favorite editor cannot handle this, you can convert the files to MS-DOS format with the unix2dos command (from the mingw-utils package). For more information, give command: unix2dos --help
Note, that GHC can handle source files in Unix format.
  • To convert a set of files to MS-DOS format (note: this might damage binary files):
C:\MSYS\1.0\bin\find . -type f -exec unix2dos {} ;
Note: the find command included in MSYS is different from the MS-DOS find command, therefore, you need to specify the entire path to this command.

6 Binary downloads

6.1 Haskell

Below a list of binary packages for Windows. To be sure you get the last version of each, it is best to download the source from Hackage and compile (except for the Haskell Platform).

The Haskell Platform (HaskellWiki page), contains GHC and a set of libraries and tools; GHC 7.6.1 (HaskellWiki page); Darcs (HaskellWiki page); Drift (website) ; Haddock 0.7 (obsolete) (website) ; Happy 1.13 (obsolete) (website) ; HsColour 1.9 (website) ; WinHugs September 2006 (website) ; cURL 7.19.4 (website) ;

6.2 Development

CVS 1.11.22 (website)  ; Python 2.4.3 (website)  ; Scons (website)  ; SVN 1.3.2 (website)  ; TextPad (website)

7 Shipping Installable Applications

* bamse lets you build windows installers for your Haskell app (MSI).
* Inno Setup is another tool to create windows installers.