Skip to content

Commit 57dc5e9

Browse files
committed
update developers' guide
1 parent b42b0ca commit 57dc5e9

File tree

1 file changed

+39
-22
lines changed

1 file changed

+39
-22
lines changed

doc/gf-developers.t2t

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,23 @@ Open a terminal, go to the top directory (``gf-core``), and type the following c
150150
$ stack install
151151
```
152152

153-
It will install GF and all necessary tools and libraries to do that.
154-
155-
156153
=== Alternative: use Cabal ===
157-
You can also install GF using Cabal, if you prefer Cabal to Stack. In that case, you may need to install some prerequisites yourself.
154+
155+
If you prefer Cabal, then you just need to manually choose a suitable GHC to build GF. We recommend GHC 9.6.7, see other supported options in [gf.cabal https://github.com/GrammaticalFramework/gf-core/blob/master/gf.cabal#L14].
158156

159157
The actual installation process is similar to Stack: open a terminal, go to the top directory (``gf-core``), and type the following command.
160158

161159
```
162160
$ cabal install
163161
```
164162

165-
//The old (potentially outdated) instructions for Cabal are moved to a [separate page ../doc/gf-developers-old-cabal.html]. If you run into trouble with ``cabal install``, you may want to take a look.//
163+
=== Nix ===
164+
165+
As of 3.12, GF can also be installed via Nix. You can install GF from github with the following command:
166+
167+
```
168+
nix profile install github:GrammaticalFramework/gf-core#gf
169+
```
166170

167171
== Compiling GF with C runtime system support ==
168172

@@ -197,7 +201,7 @@ Depending on what you want to do with the C runtime, you can follow one or more
197201

198202
=== Use the C runtime from another programming language ===[bindings]
199203

200-
% **If you just want to use the C runtime from Python, Java, or Haskell, you don't need to change your GF installation.**
204+
% **If you just want to use the C runtime from Python or Haskell, you don't need to change your GF installation.**
201205

202206
- **What —**
203207
This is the most common use case for the C runtime: compile
@@ -230,20 +234,13 @@ modes (use the ``help`` command in the shell for details).
230234

231235
(Re)compiling your GF with these flags will also give you
232236
Haskell bindings to the C runtime, as a library called ``PGF2``,
233-
but if you want Python or Java bindings, you need to do [the previous step #bindings].
237+
but if you want Python bindings, you need to do [the previous step #bindings].
234238

235239
% ``PGF2``: a module to import in Haskell programs, providing a binding to the C run-time system.
236240

237241
- **How —**
238-
If you use cabal, run the following command:
239-
240-
```
241-
cabal install -fc-runtime
242-
```
243-
244-
from the top directory (``gf-core``).
245242

246-
If you use stack, uncomment the following lines in the ``stack.yaml`` file:
243+
Add (or uncomment) the following lines in the ``stack.yaml`` file:
247244

248245
```
249246
flags:
@@ -254,6 +251,32 @@ extra-lib-dirs:
254251
```
255252
and then run ``stack install`` from the top directory (``gf-core``).
256253

254+
Run the newly built executable with the flag ``-cshell``, and you should see the following welcome message:
255+
256+
```
257+
$ gf -cshell
258+
259+
* * *
260+
* *
261+
* *
262+
*
263+
*
264+
* * * * * * *
265+
* * *
266+
* * * * * *
267+
* * *
268+
* * *
269+
270+
This is GF version 3.12.0.
271+
Built on ...
272+
Git info: ...
273+
274+
Flags: interrupt server c-runtime
275+
License: see help -license.
276+
277+
This shell uses the C run-time system. See help for available commands.
278+
>
279+
```
257280

258281
//If you get an "``error while loading shared libraries``" when trying to run GF with C runtime, remember to declare your ``LD_LIBRARY_PATH``.//
259282
//Add ``export LD_LIBRARY_PATH="/usr/local/lib"`` to either your ``.bashrc`` or ``.profile``. You should now be able to start GF with C runtime.//
@@ -266,14 +289,8 @@ With this feature, ``gf -server`` mode is extended with new requests to call the
266289
system, e.g. ``c-parse``, ``c-linearize`` and ``c-translate``.
267290

268291
- **How —**
269-
If you use cabal, run the following command:
270-
271-
```
272-
cabal install -fc-runtime -fserver
273-
```
274-
from the top directory.
275292

276-
If you use stack, add the following lines in the ``stack.yaml`` file:
293+
Add the following lines in the ``stack.yaml`` file:
277294

278295
```
279296
flags:

0 commit comments

Comments
 (0)