I'm a college student and I really need to use link-grammar parser in
my java project. I'm trying to do this in MinGW/minsys environment on
either Windows XP 32 bit or Windows 7 64bit. I've followed readme
instructions about installing mingw/minsys closely. So far, I've
managed to get past ./configure with the 4.6.6 version without any
errors (had to remove -lc attribute from configure and configure.in
files to get past regex checking).
Now, I've encountered a problem I'm unable to solve by myself. When I
issue the 'make' command it starts compiling, does it for quite a
while and then stops, displaying the following error:
<i>
link-parser.c:46:21: termios.h: No such file or directory
link-parser.c:47:23: sys/ioctl.h: No such file or directory
link-parser.c: In function `check_winsize':
link-parser.c:480: error: storage size of 'ws' isn't known
link-parser.c:483: error: implicit declaration of function `ioctl'
link-parser.c:483: warning: nested extern declaration of `ioctl'
link-parser.c:483: error: `TIOCGWINSZ' undeclared (first use in this
function)
link-parser.c:483: error: (Each undeclared identifier is reported only
once
link-parser.c:483: error: for each function it appears in.)
link-parser.c:480: warning: unused variable `ws'
make[2]: *** [link-parser.o] Error 1
make[2]: Leaving directory `/home/Browar/link-grammar-4.6.6/link-
grammar'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/Browar/link-grammar-4.6.6/link-
grammar'
make: *** [all-recursive] Error 1
</i>
Where should I look for termios.h and ioctl.h? I think I know where to
put them when I find them :)
Please help me with this problem, I can't move forward with my work
until I get link-grammar working in my java project.
Thanks in advance
Brovar
Actually, nevermind what I asked before, I managed to get past that
problem. I even managed to complete the 'make' succesfully, it even
made the linkgrammar-4.6.6.jar for me. According to the readme, I'm
now supposed to create the .dlls. And I encounter another problem
there:
.libs/and.o: In function `free_AND_tables':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/and.c:328:
undefined reference to `free_disjuncts'
.libs/and.o: In function `put_disjunct_into_table':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/and.c:637:
undefined reference to `copy_disjunct'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/and.c:610:
undefined reference to `copy_disjunct'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/and.c:540:
undefined reference to `copy_disjunct'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/and.c:632:
undefined reference to `free_disjuncts'
.libs/and.o: In function `build_fat_link_substitutions':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/and.c:875:
undefined reference to `copy_disjunct'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/and.c:881:
undefined reference to `copy_disjunct'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/and.c:899:
undefined reference to `copy_disjunct'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/and.c:905:
undefined reference to `copy_disjunct'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/and.c:923:
undefined reference to `copy_disjunct'
.libs/and.o:C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/
and.c:929: more undefined references to `copy_disjunct' follow
.libs/and.o: In function `explode_disjunct_list':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/and.c:951:
undefined reference to `catenate_disjuncts'
.libs/and.o: In function `build_COMMA_disjunct_list':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/and.c:990:
undefined reference to `copy_disjunct'
.libs/and.o: In function `build_AND_disjunct_list':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/and.c:1016:
undefined reference to `copy_disjunct'
.libs/api.o: In function `dictionary_six':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/api.c:621:
undefined reference to `read_regex_file'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/api.c:623:
undefined reference to `compile_regexs'
.libs/api.o: In function `dictionary_delete':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/api.c:760:
undefined reference to `free_regexs'
.libs/api.o: In function `linkage_get_disjunct_str':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/api.c:1627:
undefined reference to `lg_compute_disjunct_strings'
.libs/build-disjuncts.o: In function `build_sentence_disjuncts':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/build-
disjuncts.c:484: undefined reference to `catenate_disjuncts'
.libs/count.o: In function `delete_unmarked_disjuncts':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/count.c:759:
undefined reference to `free_disjuncts'
.libs/massage.o: In function `glom_aux_connector':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/massage.c:123:
undefined reference to `catenate_disjuncts'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/massage.c:105:
undefined reference to `copy_disjunct'
.libs/massage.o: In function `install_special_conjunctive_connectors':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/massage.c:224:
undefined reference to `catenate_disjuncts'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/massage.c:254:
undefined reference to `catenate_disjuncts'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/massage.c:275:
undefined reference to `catenate_disjuncts'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/massage.c:279:
undefined reference to `catenate_disjuncts'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/massage.c:284:
undefined reference to `catenate_disjuncts'
.libs/massage.o:C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-
grammar/massage.c:314: more undefined references to
`catenate_disjuncts' follow
.libs/massage.o: In function `install_special_conjunctive_connectors':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/massage.c:71:
undefined reference to `copy_disjunct'
.libs/preparation.o: In function `install_fat_connectors':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/preparation.c:
225: undefined reference to `catenate_disjuncts'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/preparation.c:
222: undefined reference to `catenate_disjuncts'
.libs/preparation.o: In function `free_sentence_disjuncts':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/preparation.c:
297: undefined reference to `free_disjuncts'
.libs/preparation.o: In function `prepare_to_parse':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/preparation.c:
320: undefined reference to `eliminate_duplicate_disjuncts'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/preparation.c:
375: undefined reference to `eliminate_duplicate_disjuncts'
.libs/prune.o: In function `power_prune':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/prune.c:1167:
undefined reference to `free_disjuncts'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/prune.c:1509:
undefined reference to `free_disjuncts'
.libs/read-dict.o: In function `dict_display_word_info':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/read-dict.c:
1746: undefined reference to `free_disjuncts'
.libs/tokenize.o: In function `is_entity':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/tokenize.c:60:
undefined reference to `match_regex'
.libs/tokenize.o: In function `boolean_reg_dict_lookup':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/tokenize.c:
258: undefined reference to `match_regex'
.libs/tokenize.o: In function `build_sentence_expressions':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/tokenize.c:
883: undefined reference to `match_regex'
.libs/word-utils.o: In function `word_has_connector':
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/word-utils.c:
445: undefined reference to `free_disjuncts'
C:/msys/1.0/home/Browar/link-grammar-4.6.6/link-grammar/word-utils.c:
450: undefined reference to `free_disjuncts'
collect2: ld returned 1 exit status
I have literally no idea what to do now :)
I also tried to make the files using visual studio, but no luck with
that either.
Please help,
Thanks in advance
Brovar
/bin/install -c .libs/liblink-grammar.dll.a /usr/local/lib
/bin/install: cannot stat `.libs/liblink-grammar.dll.a': No such file
or directo
ry
make[3]: *** [install-libtool-import-lib] Error 1
make[3]: Leaving directory `/home/Browar/link-grammar-4.6.6/link-
grammar'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/home/Browar/link-grammar-4.6.6/link-
grammar'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/Browar/link-grammar-4.6.6/link-
grammar'
make: *** [install-recursive] Error 1
Can't find liblink-grammar.dll.a ... where am I supposed to get it
from?
Brovar
Brovar
Congratulation on getting this to work.
Anyway, if you don't mind, would you please list the steps of how you
get this to work? Did you end up compiling it on Visual Studio?
Thank you,
Patt
Sure, here's what I did (I'm running windows xp 32bit atm):
1. I installed MinGW (default path)
2. I installed minsys (default settings)
3. I downloaded minsysdvlpr, not extracted it yet though.
4. I downloaded regex from the address from the Link-Grammar readme,
installed it and copied its contents over my mingw installation.
5. I edited configure and configure.in files in LinkGrammar directory,
removing -lc from the
LDFLAGS="${LDFLAGS} -L/usr/lib/mingw -lmingwex -lcrtdll -
lmsvcrt -lc -Wl,--allow-multiple-definition",
line.
6. After this, the ./configure completed no problems.
7. Then I opened minsysdvlpr and copied include/termios.h, include/
sys.ioctl.h and include/sys/termios.h from it to my minGW include
directory.
7. Then I had to modify link-parser.c file in link-grammar/ directory,
because it failed to compile. There is a static void
check_winsize(Parse_Options popts) method causing problems with ioctl.
Just as the comment above it says - its designed to work in Linux, but
it causes problems in windows. Its probably possible to re-write it to
work in windows, but I went the easy way and removed most of the
method, just assuming that standard console window width is 80
columns, so I deleted most of the method, leaving only one line:
static void check_winsize(Parse_Options popts)
{
#ifndef _MSC_VER
{
parse_options_set_screen_width(popts, 79);
}
#endif /* _MSC_VER */
}
8. That made my 'make' work ok.
9. Then I went inside the generated link-grammar directory and edited
makefile in there. Problem is, it was looking for liblink-
grammar.dll.a file, which I couldn't find. Its near the end of the
file. Without thinking much, I changed it from liblink.grammar.dll.a
to liblink.grammar.a :P
10. Then I edited the makefile in the main link-grammar directory,
because it was trying to move the .jar file it generated into //usr/
(...) folder, which is obviously a typo, so I modified it to /usr/
(...).
11. That made it install ok.
12. Then I downloaded the .dlls from a link mr Borislav Iordanov
kindly provided some time ago in this group: http://www.kobrix.com/index.jsp
and I've put them all in msys's local/bin folder.
13. Then I just included the .jar provided in my eclipse project.
Hope this helps.
Thing is though... I'm not sure how to make it do anything. I can do
LinkGrammar.parse(String), I can set path to dictionary, I can get the
version numbers, but whenever I try to actually make it do something
by accessing linkages or stuff, I just get .dll errors. Is it because
I used mr Iordanovs dlls, and they're from a different version? Or am
I not using it correctly? Please help, I really need to start using it
in my java project...
Thanks in advance,
Brovar
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10008846, pid=2596,
tid=2620
#
# JRE version: 6.0_18-b07
# Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing
windows-x86 )
# Problematic frame:
# C [link-grammar.dll+0x8846]
#
# An error report file with more information is saved as:
# C:\Documents and Settings\Browar\Desktop\Eclipse Projects\WNtst
\hs_err_pid2596.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
And if I try running link-parser.exe from the command line I get:
link-parser.exe: Warning: locale was not UTF-8; force-setting to
en_US.UTF-8
link-grammar: Info: Dictionary found at C:/msys/1.0/local/share/link-
grammar\en\
4.0.dict
link-grammar: Error opening word file en/words/entities.given-
bisex.sing
link-grammar: Error opening word file /en/words/entities.given-
bisex.sing
link-parser.exe: Fatal error: Unable to open dictionary.
Please help the poor student, almighty C-men :)
Regards
Brovar
> --
> You received this message because you are subscribed to the Google Groups "link-grammar" group.
> To post to this group, send email to link-g...@googlegroups.com.
> To unsubscribe from this group, send email to link-grammar...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/link-grammar?hl=en.
>
>
--
http://www.kobrix.com - HGDB graph database, Java Scripting IDE, NLP
http://kobrix.blogspot.com - news and rants
"Frozen brains tell no tales."
-- Buckethead
Thanks for your reply. I'm glad its one problem occuring in two places and not two different problems ;)What do you suggest I do about it? The dictionaries are available and installed.Do you think its because of the weird path?
I mean, that part of the path uses "/" and the other one uses "\"?
link-grammar: Info: Dictionary found at C:/msys/1.0/local/share/link-grammar\en\4.0.dict
How can I change the path where link-grammar looks for the dictionaries?The file it asks about, "entities.given-bisex.sing", is only 2.79KB in size on my system, is that ok?I tried rebuilding it all, but no change.Please help,Brovar2010/3/25 Borislav Iordanov <borislav...@gmail.com>
Looks like both errors are due to the fact that it can't find the
Sorry for spamming, but I just thought of something... I think there is a possibility that its an encoding problem. When I run something link-grammar related in java, I get:Warning: The word "â€" found near line 4691 of en\4.0.dict matches the following words:â€This word will be ignored.Warning: The word "â€" found near line 4691 of en\4.0.dict matches the following words:â€This word will be ignored.Warning: The word "â€" found near line 21 of en\4.0.affix matches the following words:â€This word will be ignored.Warning: The word "â€" found near line 21 of en\4.0.affix matches the following words:â€This word will be ignored.And when I try running link-parser.exe from the command line, I get link-parser.exe: Warning: locale was not UTF-8; force-setting to en_US.UTF-8
Sooooo... (this is a longshot - I'm not sure what I'm talking about) wouldn't it be possible to set mingw/msys to use en_US.UTF-8 all the time
and rebuild all the files (including dictionaries) using it?
How would I do that?
Thanks for your reply. I'm glad its one problem occuring in two places and not two different problems ;)What do you suggest I do about it? The dictionaries are available and installed.Do you think its because of the weird path?
I mean, that part of the path uses "/" and the other one uses "\"?link-grammar: Info: Dictionary found at C:/msys/1.0/local/share/link-grammar\en\4.0.dict
How can I change the path where link-grammar looks for the dictionaries?The file it asks about, "entities.given-bisex.sing", is only 2.79KB in size on my system, is that ok?
I think the core problem here, as I understand it, is that mingw is
intended to compile *windows* applications for windows (using
the gnu toolset), and not unix applications for windows. Thus, it
doesn't cleanly handle the issues that the unix world takes for granted.
My understanding is that cygwin is the correct choice for compiling
unix apps on windows. Or at least, that's what I've been told.
Certainly, this would explain the assortment of troubles with the
dll's and makefiles and so on.
--linas
Can you help me with the below? A very quick skim of the main
google hits for mingw and cygwin very quickly indicates that
mingw is intended for compiling *windows* programs while
cygwin is intended for compiling linux programs on windows.
So I was about to change the link-grammar readme to recommend
cygwin, not mingw, when it suddenly struck me that maybe this will
negatively affect the Java bindings. .. so, in your dll's did you
build against mingw, or cygwin ?
--linas
Dave
David Hart | phone +61 419 483 263 | sent from iPhone
I didn't follow the discussion very carefully and I haven't followed
the latest link-grammar updates, otherwise I would have tried to help
more. I used to build with MS VC++. Cygwin didn't work and actually
Murilo had found mingw because cygwin failed and/or because cygwin
requires an extra runtime DLL to run. My understanding is that mingw
is a simplified, cleaner toolset, lighter weight, perhaps missing some
features, which is probably what makes it for "windows" rather for
"unix" apps. But link grammar should build with mingw as it doesn't
have many (if any) dependencies on a unix env, which is what cygwin
provides with its runtime dll.
Now that I re-read Brovar's email more carefully, he's trying to run
my MSVC++ DLLs from an older version of LG with an executable built
with mingw of the newer version and newer jar....bad idea :)
I remember seeing those encoding warnings and I don't believe they are
problematic. I don't think they would cause a crash. More likely, it's
about missing dictionary files.
I'll try to find some time this week-end to research this.
Boris
--
--
You received this message because you are subscribed to the Google Groups "link-grammar" group.
To post to this group, send email to link-g...@googlegroups.com.
To unsubscribe from this group, send email to link-grammar...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/link-grammar?hl=en.
Hi Linas,
I'll try to find some time this week-end to research this.
Mr Lordanov,
Since you've successfully managed to build the LGP binaries in MSVC++, I don't suppose you could give me a walkthrough on how to get past the annoying "strings.h" issue? Or better yet, could you perhaps provide compiled binaries for the latest SVN of the source? I'm building a wrapper unit for my friend Rich Cooper (an active member of this group) for his project, and I just can't get the damn binaries to build! MinGW gives me more problems when compiling than MSVC++ so there's just no point in me persuing that method... and Cygwin's "Make" system is being overriden by Borland C++ 6.2 (2010) and I don't want to have to completely change my environment settings and risk breaking BC++ (which I use all the time).
Would it be possible for you to produce an automated "Makefile" for MSVC++ Command Prompt even?
I've Google'd my problem for over 9 hours now and all I've found is that Strings.h is a UNIX C source and is not available on Windows. I read a message where someone replaced the Strings.h include line in the source with the Regex.h unit (which I've tried) but that also gives me linker issues during the build.
I believe that all I need are the following binaries:
liblink-grammar-4.dll
link-grammar.dll
link-parser.exe
This project doesn't need the Java bindings since I'll be producing a full binding for Pascal so that Mr. Cooper can natively interact with the LGP engine without having to use the somewhat-hacky method of piping the command-line tool.
I appreciate any assistance or advice you can provide.
Kind regards,
Simon J Stuart
------Original Mail------
From: "Borislav Iordanov" <borislav...@gmail.com>
To: <linasv...@gmail.com>,
<link-g...@googlegroups.com>
Sent: Fri, 26 Mar 2010 07:26:39 -0400
Subject: Re: [Link Grammar] Re: Errors while doing 'make' on MinGW/minsys
--
You received this message because you are subscribed to the Google Groups "link-grammar" group.
To post to this group, send email to link-g...@googlegroups.com.
To unsubscribe from this group, send email to link-grammar...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/link-grammar?hl=en.
____________________________________________________________________________
E-Mail scanned by Kaspersky Antivirus (Up To Date)
See my recent email and project files. strings.h can simply be
commented out - the depedencies were already removed, but the include
hasn't be #ifdef-ed yet. Do you still need the DLLs? Perhaps it's
better for you to be able to compile with MSVC++....perhaps you would
want to link regex.lib statically to reduce the deployment hassle of
multiple DLLs...
Best,
Boris