mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 13:09:33 -06:00
Compare commits
9 Commits
release3.1
...
build-pyth
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa2826d29a | ||
|
|
9325c8f9fb | ||
|
|
57dc5e9098 | ||
|
|
b42b0caa34 | ||
|
|
3ecb75d7d8 | ||
|
|
2b876b1aac | ||
|
|
5935119050 | ||
|
|
489424a1c6 | ||
|
|
9c72994c2b |
@@ -150,11 +150,9 @@ Open a terminal, go to the top directory (``gf-core``), and type the following c
|
||||
$ stack install
|
||||
```
|
||||
|
||||
It will install GF and all necessary tools and libraries to do that.
|
||||
|
||||
|
||||
=== Alternative: use Cabal ===
|
||||
You can also install GF using Cabal, if you prefer Cabal to Stack. In that case, you may need to install some prerequisites yourself.
|
||||
|
||||
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].
|
||||
|
||||
The actual installation process is similar to Stack: open a terminal, go to the top directory (``gf-core``), and type the following command.
|
||||
|
||||
@@ -162,7 +160,13 @@ The actual installation process is similar to Stack: open a terminal, go to the
|
||||
$ cabal install
|
||||
```
|
||||
|
||||
//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.//
|
||||
=== Nix ===
|
||||
|
||||
As of 3.12, GF can also be installed via Nix. You can install GF from github with the following command:
|
||||
|
||||
```
|
||||
nix profile install github:GrammaticalFramework/gf-core#gf
|
||||
```
|
||||
|
||||
== Compiling GF with C runtime system support ==
|
||||
|
||||
@@ -197,7 +201,7 @@ Depending on what you want to do with the C runtime, you can follow one or more
|
||||
|
||||
=== Use the C runtime from another programming language ===[bindings]
|
||||
|
||||
% **If you just want to use the C runtime from Python, Java, or Haskell, you don't need to change your GF installation.**
|
||||
% **If you just want to use the C runtime from Python or Haskell, you don't need to change your GF installation.**
|
||||
|
||||
- **What —**
|
||||
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).
|
||||
|
||||
(Re)compiling your GF with these flags will also give you
|
||||
Haskell bindings to the C runtime, as a library called ``PGF2``,
|
||||
but if you want Python or Java bindings, you need to do [the previous step #bindings].
|
||||
but if you want Python bindings, you need to do [the previous step #bindings].
|
||||
|
||||
% ``PGF2``: a module to import in Haskell programs, providing a binding to the C run-time system.
|
||||
|
||||
- **How —**
|
||||
If you use cabal, run the following command:
|
||||
|
||||
```
|
||||
cabal install -fc-runtime
|
||||
```
|
||||
|
||||
from the top directory (``gf-core``).
|
||||
|
||||
If you use stack, uncomment the following lines in the ``stack.yaml`` file:
|
||||
Add (or uncomment) the following lines in the ``stack.yaml`` file:
|
||||
|
||||
```
|
||||
flags:
|
||||
@@ -254,6 +251,32 @@ extra-lib-dirs:
|
||||
```
|
||||
and then run ``stack install`` from the top directory (``gf-core``).
|
||||
|
||||
Run the newly built executable with the flag ``-cshell``, and you should see the following welcome message:
|
||||
|
||||
```
|
||||
$ gf -cshell
|
||||
|
||||
* * *
|
||||
* *
|
||||
* *
|
||||
*
|
||||
*
|
||||
* * * * * * *
|
||||
* * *
|
||||
* * * * * *
|
||||
* * *
|
||||
* * *
|
||||
|
||||
This is GF version 3.12.0.
|
||||
Built on ...
|
||||
Git info: ...
|
||||
|
||||
Flags: interrupt server c-runtime
|
||||
License: see help -license.
|
||||
|
||||
This shell uses the C run-time system. See help for available commands.
|
||||
>
|
||||
```
|
||||
|
||||
//If you get an "``error while loading shared libraries``" when trying to run GF with C runtime, remember to declare your ``LD_LIBRARY_PATH``.//
|
||||
//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
|
||||
system, e.g. ``c-parse``, ``c-linearize`` and ``c-translate``.
|
||||
|
||||
- **How —**
|
||||
If you use cabal, run the following command:
|
||||
|
||||
```
|
||||
cabal install -fc-runtime -fserver
|
||||
```
|
||||
from the top directory.
|
||||
|
||||
If you use stack, add the following lines in the ``stack.yaml`` file:
|
||||
Add the following lines in the ``stack.yaml`` file:
|
||||
|
||||
```
|
||||
flags:
|
||||
|
||||
@@ -36,7 +36,14 @@ sudo apt install ./gf-3.12-ubuntu-24.04.deb
|
||||
|
||||
#### macOS
|
||||
|
||||
To install the package, just double-click it and follow the installer instructions.
|
||||
If you are on an Intel Mac (2019 or older), use `gf-3.12-macos-intel.pkg`.<br>
|
||||
For newer ARM-based Macs (Apple Silicon M1, M2, M3), use `gf-3.12-macos-arm.pkg`.
|
||||
|
||||
After downloading, right click on the file and click on Open.[^1]
|
||||
You will see a dialog saying that "macOS cannot verify the developer of "gf-3.12-macos-intel.pkg". Are you sure you want to open it?".
|
||||
Press Open.
|
||||
|
||||
[^1]: If you just double click on the file, you will get an error message "gf-3.12-macos-intel.pkg" cannot be opened because it is from an unidentified developer.
|
||||
|
||||
#### Windows
|
||||
|
||||
|
||||
10
gf.cabal
10
gf.cabal
@@ -11,7 +11,7 @@ description: GF, Grammatical Framework, is a programming language for multilingu
|
||||
maintainer: John J. Camilleri <john@digitalgrammars.com>
|
||||
homepage: https://www.grammaticalframework.org/
|
||||
bug-reports: https://github.com/GrammaticalFramework/gf-core/issues
|
||||
tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.10.4, GHC==9.0.2, GHC==9.2.4
|
||||
tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.10.4, GHC==9.0.2, GHC==9.2.4, GHC==9.6.7
|
||||
|
||||
data-dir: src
|
||||
extra-source-files:
|
||||
@@ -159,7 +159,7 @@ library
|
||||
parallel >= 3.2.1.1 && < 3.3,
|
||||
process >= 1.4.3 && < 1.7,
|
||||
time >= 1.6.0 && <= 1.12.2,
|
||||
template-haskell >= 2.13.0.0
|
||||
template-haskell >= 2.13.0.0 && < 2.21
|
||||
|
||||
hs-source-dirs: src/compiler
|
||||
exposed-modules:
|
||||
@@ -350,7 +350,7 @@ library
|
||||
terminfo >=0.4.0 && < 0.5
|
||||
|
||||
if impl(ghc >= 9.6.6)
|
||||
build-depends: unix >= 2.8
|
||||
build-depends: unix >= 2.8 && < 2.9
|
||||
|
||||
else
|
||||
build-depends: unix >= 2.7.2 && < 2.8
|
||||
@@ -365,7 +365,7 @@ executable gf
|
||||
default-language: Haskell2010
|
||||
build-depends:
|
||||
gf,
|
||||
base
|
||||
base >= 4.9.1 && < 4.22
|
||||
ghc-options: -threaded
|
||||
--ghc-options: -fwarn-unused-imports
|
||||
|
||||
@@ -399,7 +399,7 @@ test-suite gf-tests
|
||||
main-is: run.hs
|
||||
hs-source-dirs: testsuite
|
||||
build-depends:
|
||||
base >= 4.9.1,
|
||||
base >= 4.9.1 && < 4.22,
|
||||
Cabal >= 1.8,
|
||||
directory >= 1.3.0 && < 1.4,
|
||||
filepath >= 1.4.1 && < 1.5,
|
||||
|
||||
@@ -51,7 +51,7 @@ grammar2haskell opts name gr = foldr (++++) [] $
|
||||
derivingClause
|
||||
| dataExt = "deriving (Show,Data)"
|
||||
| otherwise = "deriving Show"
|
||||
extraImports | gadt = ["import Control.Monad.Identity", "import Data.Monoid"]
|
||||
extraImports | gadt = ["import Control.Monad.Identity", "import Control.Monad", "import Data.Monoid"]
|
||||
| dataExt = ["import Data.Data"]
|
||||
| otherwise = []
|
||||
pgfImports | pgf2 = ["import PGF2 hiding (Tree)", "", "showCId :: CId -> String", "showCId = id"]
|
||||
|
||||
17
src/runtime/python/pgf.egg-info/PKG-INFO
Normal file
17
src/runtime/python/pgf.egg-info/PKG-INFO
Normal file
@@ -0,0 +1,17 @@
|
||||
Metadata-Version: 2.4
|
||||
Name: pgf
|
||||
Version: 1.0
|
||||
Summary: Python bindings to the Grammatical Framework's PGF runtime
|
||||
Home-page: https://www.grammaticalframework.org/
|
||||
Author: Krasimir Angelov
|
||||
Author-email: kr.angelov@gmail.com
|
||||
License: BSD
|
||||
Dynamic: author
|
||||
Dynamic: author-email
|
||||
Dynamic: description
|
||||
Dynamic: home-page
|
||||
Dynamic: license
|
||||
Dynamic: summary
|
||||
|
||||
Grammatical Framework (GF) is a programming language for multilingual grammar applications.
|
||||
This package provides Python bindings to GF runtime, which allows you to parse and generate text using GF grammars compiled into the PGF format.
|
||||
12
src/runtime/python/pgf.egg-info/SOURCES.txt
Normal file
12
src/runtime/python/pgf.egg-info/SOURCES.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
INSTALL
|
||||
README.org
|
||||
pypgf.c
|
||||
setup.py
|
||||
test.py
|
||||
examples/README
|
||||
examples/gf_utils.py
|
||||
examples/translation_pipeline.py
|
||||
pgf.egg-info/PKG-INFO
|
||||
pgf.egg-info/SOURCES.txt
|
||||
pgf.egg-info/dependency_links.txt
|
||||
pgf.egg-info/top_level.txt
|
||||
1
src/runtime/python/pgf.egg-info/dependency_links.txt
Normal file
1
src/runtime/python/pgf.egg-info/dependency_links.txt
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
src/runtime/python/pgf.egg-info/top_level.txt
Normal file
1
src/runtime/python/pgf.egg-info/top_level.txt
Normal file
@@ -0,0 +1 @@
|
||||
pgf
|
||||
@@ -1,5 +1,16 @@
|
||||
resolver: ghc-9.6.7
|
||||
|
||||
## To install GF with C-runtime support, comment out the following lines:
|
||||
|
||||
# flags:
|
||||
# gf:
|
||||
# c-runtime: true
|
||||
# extra-lib-dirs:
|
||||
# - /usr/local/lib
|
||||
|
||||
|
||||
## Need exact versions of libraries, to ensure predictable build
|
||||
|
||||
extra-deps:
|
||||
- multipart-0.2.1@sha256:559c04eed5218a9673e9fb6a225287fee1aeb38a45a0caf91a2598967bd75659,1150
|
||||
- cgi-3001.5.1.0@sha256:408e1f96ac6134965484c891b5fae35c7303fa841b09ce5baea52ddb078eef6b,3442
|
||||
|
||||
11
stack.yaml
11
stack.yaml
@@ -3,6 +3,17 @@
|
||||
# See: https://github.com/GrammaticalFramework/gf-core/pull/106
|
||||
resolver: ghc-9.6.7
|
||||
|
||||
## To install GF with C-runtime support, comment out the following lines:
|
||||
|
||||
# flags:
|
||||
# gf:
|
||||
# c-runtime: true
|
||||
# extra-lib-dirs:
|
||||
# - /usr/local/lib
|
||||
|
||||
|
||||
## Need exact versions of libraries, to ensure predictable build
|
||||
|
||||
extra-deps:
|
||||
- multipart-0.2.1@sha256:559c04eed5218a9673e9fb6a225287fee1aeb38a45a0caf91a2598967bd75659,1150
|
||||
- cgi-3001.5.1.0@sha256:408e1f96ac6134965484c891b5fae35c7303fa841b09ce5baea52ddb078eef6b,3442
|
||||
|
||||
Reference in New Issue
Block a user