If you want to just download latest GF executable for Windows -- quick start, no source code, you can skip to section 2a.
If you want to get the latest versions from the GF repository, read on. While GF itself doesn't change that often (and every major release is also updated in the Windows binary package), the resource grammar libraries do, constantly -- bug fixing, new constructions implemented for smaller languages, dictionary entries, etc. So it does make sense to be able to get the latest developer code from the darcs or git repository; everyone has a read access. Also with the GF sources you get some examples and exercises used in the GF tutorial.
First thing you need for your Windows machine is a Unix-like compatibility layer, so that you can compile and build open source applications with GNU style building tools. Install MinGW and MSYS. (I have no experience on Cygwin, try it if you like.)
After installing MinGW and MSYS, you need to add the binaries to your path.
To see how to set the path in Windows, see section 3 in this guide, or another guide, e.g. http://www.nextofwindows.com/how-to-addedit-environment-variables-in-windows-7/.
For instance, if you've installed MSYS in
C:\msys , you need to add the following line to your
Go to haskell.org/platform/windows.html and download the installer. Follow the wizard.
It might ask if you want GLUT (a graphics library). With GF it doesn't matter, you can choose yes or no.
Go to the page grammaticalframework.org/download and choose the Windows package, a zip file named
The Windows package is installed by just unpacking it anywhere. Everything works already, you can import files in the same directory, or in another directory if you specify the path. To make life easier, you'll still need to add the libraries to your path, in order to write just
import LangEng.gfo instead of a full path like
import C:\Users\myName\mySrcFolder\GF\lib\alltenses\LangEng.gfo every time. See section 3 for that.
After installing Haskell Platform, you have command-line tools that access Hackage, a collection of Haskell programs, and
cabal, a program that installs them. The installation of Haskell Platform adds the programs automatically in your path.
cabal install gf on your command prompt. It puts the GF binary in the directory
C:\Users\YOUR NAME\AppData\Roaming\cabal\binand the libraries in the directory
C:\Users\YOUR NAME\AppData\Roaming\cabal\gf-<VERSION>\lib\alltensesAdd those locations to your
GF_LIB_PATHenvironment variables, explained in section 3.
First you need to install the version control program
darcs. This is easy with the tools you have gotten with Haskell Platform. Type the following commands:
cabal update cabal install darcsAfter installing darcs, go to the directory where you want to put the source code and do the following commands:
darcs get --lazy http://www.grammaticalframework.org/ GF cd GF cabal install
(GF source code is also mirrored in Github, see https://github.com/GrammaticalFramework/GF. If you prefer git, just get the git repository instead of the darcs one, then go to the main directory and type
If you get an error message of type
<built-in>:0:4: lexical error (UTF-8 decoding error)
you need to write first
set lang=C in your command line. Then run
cabal install again.
Then just wait for the code to compile.
1. 2. 3.
Advanced system settingslink in the left column, choose middle tab
Environment Variableswindow, choose the
Pathvariable and click the
Add the following line to your
Path, separated by
; from other locations.
Create a new environment variable from the
New... button. Name will be
GF_LIB_PATH, and value will be the following line.
Now you can to use GF from command line.
<built-in>:0:4: lexical error (UTF-8 decoding error)write
set lang=Cin the command prompt and try
Fonttab, and choose Lucida or Consolas.
chcpin your command prompt to see your active code page. You can change it to Latin 1 by typing
chcp 1252, Latin 2 by typing
chcp 852, etc. -- see list of code pages. In principle you can change it to UTF-8 by typing
chcp 65001, but there are problems with GF, it might not work.
!before the command.
! chcpshows you the code page and
! chcp XXXXchanges it.
Control Panel, choose
Clock, Language and Region, then
Region and Language, and the
Administrativetab. As shown in the image below, choose the language of your choice from the dropdown menu. This changes the default locale for non-unicode applications. If you choose Russian, you're still getting
invalid charactererror with Japanese. For more info, see e.g. 7tutorials.com/changing-display-language-used-non-unicode-programs.
.gfofiles. You can start GF giving it a little more memory. For 100 MB, start GF by typing
gf +RTS -K100M -RTSin the command prompt.
None of these files exists: LangIta.gfo C:\Users\inari\AppData\Roaming\cabal\gf-3.5\lib\alltenses\LangIta.gfoLook at the second line prior to the filename (
C:\...\alltenses\). Is it really the path where you have your libraries? If not, go change (or create) your
GF_LIB_PATHenvironment variable, see instructions at section 3.
GF_LIB_PATHis a system variable (lower box) instead of a user variable (upper box).
#gfin freenode. If you don't want to join a channel, you can ask me. My nick is
inariksitat freenode and