• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

README-Cygwin.mdH A D03-May-20222.3 KiB7449

README-MinGW64.mdH A D03-May-20224 KiB11187

link-parser-cygwin.batH A D03-May-2022566 2015

link-parser.batH A D03-May-2022537 1814

README-Cygwin.md

1Building on Windows using  Cygwin
2=================================
3Tested on Cygwin 2.10.0 under Windows 10,
4with link-grammar version RC 5.5.2.
5
6Language bindings
7-----------------
8The build system produces successful Python2&3 and Java bindings.
9Other language bindings have not been tested.
10
11For the Java bindings, install Java and Ant under Windows.
12Make sure, under Windows, that `JAVA_HOME` is set correctly
13and `ant` is the `PATH`.
14
15
16Building
17--------
18Install all the prerequisit tools,
19Also install the desired optional libraries
20
21Note: Installing the library `pcre2` is **required** for correct operation
22since the default REGEX implementation (in libc) is not capable enough.
23
24Use the `configure` command as outlined in the main [README](/README.md#creating-the-system).
25Note that compiling with more than one concurrent process may be extremely slow.
26To make sure only a single process is used supply `make ` with `-j 1`.
27Also, the `make` build-in rules cause a lot of I/O and are not needed here, so
28supplying `make` with the `-r` argument makes it much faster.
29
30`$ make -r -j 1`
31
32`$ make -r install`
33
34The dictionaries are installed by default under
35`/usr/local/share/link-grammar`.
36
37
38
39Running link-parser
40-------------------
41
42* From the sources directory, using cmd.exe Windows console:
43
44Note: ^Z/^D/^C are not supported when running under Cygwin!
45In particular, don't press ^Z - it may crash or stuck the window.
46To exit, use the `!exit` command.
47
48      > PATH-TO-LG-CONF-DIRECTORY\link-parser\link-parser [arguments]
49
50* Form the Cygwin shell:
51
52Before installation (supposing no installed version yet):
53
54      `$ PATH-TO-LG-CONF-DIRECTORY/link-parser/link-parser [args]`
55
56After "make install" (supposing `/usr/local/bin` is in the `PATH`):
57
58      `$ link-parser [arguments]`
59
60To run the executable from other location, liblink-grammar-5.dll needs to be
61in a directory in PATH (e.g. in the directory of the executable).
62
63A helper BAT file link-parser-cygwin.bat is provided (currently under the
64`mingw` directory) for invoking `link-parser`.
65
66For more details, see "RUNNING the program" in the main
67[README](/README.md#running-the-program).
68
69Tests
70-----
71All the tests pass (the Python and C++ tests in the `tests` directory).
72However, the C++ tests that involve multi-threading severely trash the
73system and take very much time to complete.
74

README-MinGW64.md

1BUILDING on Windows (MinGW/MSYS2)
2=================================
3
4General
5-------
6In this document we will suppose you use a 64-bit machine.
7
8MinGW/MSYS2 uses the Gnu toolset to compile Windows programs for
9Windows.  This is probably the easiest way to obtain workable Java
10bindings for Windows.
11
12In order to prepare this document, MSYS2 version 20161025 was installed.
13
14A note for new MSYS2 users
15--------------------------
16Download and install MinGW/MSYS2 from http://msys2.org.
17
18MSYS2 uses the `pacman` package management. If you are not familiar
19with it, consult the
20[Pacman Rosetta](https://wiki.archlinux.org/index.php/Pacman/Rosetta).
21
22Also note that MSYS2 have two working modes (shells): MSYS and MINGW64.
23The difference between them is the value of environment variables, e.g.
24PATH, PKG_CONFIG_PATH and MANPATH.  For native Windows software
25development, the MINGW64 shell must be used (the MSYS shell is for
26MinGW/MSYS2 development- applications compiled from it recognize the MSYS
27virtual filesystem).
28
29First install `mingw-w64-x86_64-toolchain`. Also install the rest of the
30prerequisite tools from the list in the main
31[README](/README.md#building-from-the-github-repository).
32
33NOTE: You must also install **mingw-w64-x86_64-pkg-config** .
34
35You may find that the system is extremely slow. In that case, consult the
36Web for how to make tweaks that considerably speed it up. In addition, to
37avoid I/O trashing, don't use a too high `make` parallelism (maybe even
38only `-j 2`).
39
40Packages that are used by the link-grammar library
41--------------------------------------------------
42
43mingw-w64-x86_64-sqlite3<br>
44mingw-w64-x86_64-libtre-git<br>
45mingw-w64-x86_64-gettext<br>
46mingw-w64-x86_64-hunspell, mingw-w64-x86_64-hunspell-en (optional)<br>
47zlib-devel (optional - for the SAT parser)<br>
48mingw-w64-x86_64-python2<br>
49mingw-w64-x86_64-python3<br>
50
51Java bindings
52-------------
53Install [Apache Ant](ant.apache.org/manual/install.html) and
54Java JDK & JRE (both under Windows). Make sure you have
55the environment variable JAVA_HOME set as needed (under Windows,
56the MINGW64 shell will inherit it).
57
58Then build and install link-grammar with
59
60     mkdir build
61     cd build
62     ../configure
63     make
64     make install
65
66In MINGW64, the default install prefix is `/mingw64` which is mapped to
67`C:\msys64\mingw64`, so after 'make install', the libraries and executable
68will be found at `C:\msys64\mingw64\bin` and the dictionary files at
69`C:\msys64\mingw64\share\link-grammar`.
70
71
72Python bindings
73---------------
74The bindings for Python2 (2.7.15) and Python3 (3.7.0) work fine.<br>
75All the tests pass (when configured with `hunspell` and the SAT parser).
76
77Here is a way to work with python3 from Windows:
78```
79C:\>cd \msys64\mingw64\bin
80C:\msys64\mingw64\bin>.\python3
81Python 3.7.0 (default, Jul 14 2018, 09:27:14)  [GCC 7.3.0 64 bit (AMD64)] on win32
82Type "help", "copyright", "credits" or "license" for more information.
83>>> from linkgrammar import *
84>>> print(Sentence("This is a test",Dictionary(),ParseOptions()).parse().next().diagram())
85
86    +----->WV----->+---Ost--+
87    +-->Wd---+-Ss*b+  +Ds**c+
88    |        |     |  |     |
89LEFT-WALL this.p is.v a  test.n
90
91>>>
92```
93
94Test results
95------------
96All the `tests.py` tests pass, and also `make installcheck` is fine.
97From the tests in the `tests/`directory, the `multi-thread` test fails due to segfault
98at the hunspell library (a fix for that is being investigated). Regretfully, using
99Aspell for now is not an option, as it is not available yet for MinGW.
100
101BTW, here is how to run the `java-multi` test directly:<br>
102`cd tests; make TEST_LOGS=multi-java check-TESTS`
103
104Running
105-------
106On MINGW64, just invoke `link-parser`.<br>
107In Windows, put `C:\msys64\mingw64\bin` in your PATH (or `cd` to it), then invoke `link-parser`.
108On both MINGW64 and Windows console, you can invoke `mingw/link-parser.bat`, which also
109sets PATH for the `dot` and `PhotoViewer` commands (needed for the wordgraph display feature).
110For more details see [RUNNING the program](/README.md#running-the-program).
111