Problems with RASP lemmatizer in GATE (using Mac) - plugins

I am analysing novels in English to extract relevant linguistic information from them. To this end, I am using GATE and need a lemmatizer, so I was trying to use the RASP tool with one of the example pipelines that are suggested:
1) RegEx Sentence Splitter
2) RAPS2 Tokenizer
3) RASP2 POS Tagger
4) RASP 2 Morphological Analyser
5) RASP2 Parser.
I am using a desktop Mac (OS X 10.9.4) and the latest version of GATE. When I load the RegEx Sentence Splitter in the "Processing Resources" of GATE, I have no problem. But then, when I try loading the first RAPS tool, RAPS2 Tokenizer, I get an error message saying "gate.creole.ResourceInstantiationException: java.lang.Exception: Executable /Applications/gate-8.0-build4825-ALL/plugins/Parser_RASP/resources/tokenise/token.x86_64_mac os x does not exist
at com.digitalpebble.rasp2.token.RASPTokenizer.init(RASPTokenizer.java:71)
at gate.Factory.createResource(Factory.java:432)
at gate.gui.NewResourceDialog$4.run(NewResourceDialog.java:250)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.Exception: Executable /Applications/gate-8.0-build4825-ALL/plugins/Parser_RASP/resources/tokenise/token.x86_64_mac os x does not exist"
and the RASP2 Tokenizer does not get loaded into GATE.
Can you tell me why this is? What is happening? How can I solve it?

RASP itself is a native (non-Java) program. The GATE plugin includes a selection of different versions of the RASP binary compiled for specific platforms, and tries to select the appropriate one automatically by constructing a file name from the architecture and operating system name of the host platform.
There isn't a .x86_64_mac os x variant, but 64-bit Mac OS can run 32-bit binaries. The .ix86_darwin version works for me on OS X (10.10) so you should be able to make it work by making a copy of or a link to the token.ix86_darwin file named token.x86_64_mac os x (including the spaces). In a Terminal:
cd /Applications/gate-8.0-build4825-ALL/plugins/Parser_RASP/resources/tokenise
ln -s 'token.ix86_darwin' 'token.x86_64_mac os x'

Related

Creating an X11 frame in mit-scheme + scmutils

I am working through the book Structure and Interpretation of Classical Mechanics, which requires writing scheme code in mit-scheme for its exercises. I've installed scmutils, the scheme library provided with the book, and when I launch mit-scheme, the following items are listed:
Release 10.1.10
Microcode 15.3
Runtime 15.7
SF 4.41
LIAR/x86-64 4.118
SOS 1.8
XML 1.0
Edwin 3.117
X11 1.3
X11-Screen 1.0
ScmUtils Mechanics.Summer 2019
This seems to suggest that X11 support is enabled. However when I use the frame command to try and create a window for a plot,
(frame 0 :pi/2 0 5)
I get the error:
;Could not find plugin: "x11"
;To continue, call RESTART with an option number:
; (RESTART 1) => Return to read-eval-print level 1
This is on Linux with X11, with mit-scheme installed through the package manager (pacman) and scmutils downloaded from the book/course website.
Moreover, some other commands from scmutils that involve invoking X-windows, like show-expression (that generates DVI output from an input math expression and launches XDVI) work fine.
The install guide for mit-scheme says I need libx11-dev (or equivalent) installed if I want support for X11 graphics, but I downloaded the binary package from the repositories and I can't tell if it comes with X11 support.
Figured it out. The version of mit-scheme available in the Arch Linux repositories does not come bundled with the plugin x11 for X11 support, and it wasn't straightforward to add it manually.
Instead I downloaded the source from gnu.org and compiled it manually, then reinstalled scmutils on top for the SICM-specific features.

why does the error regarding gcc is occuring in matlab?

I have download that code from github.
Whenever that code tries to check mexopencv (a file inside lib folder). It shows an error on Matlab 2017a that is:
[error 3] please make sure gcc >= 4.4 g++ >= 4.4 is installed ...
I am having a gcc version of 8.8.0
Following is the description of system
Window 10
Visual Studio 2012
Matlab 2017a
opencv 2.4.10
mexopencv (install from your folder LIB)
You might lack of standard libraries (.dll in Windows but .lib in Linux). The code was developed under Linux (help is also only provided for Linux systems) and once tested under Windows 7.
The method was tested under OS linux lubuntu 14.04, CPU intel i5 and
16GB of RAM. This guide was written under a linux-based distribution
scope, more precisely debian. Unfortunately we lack experience to
address bugs or any problem that could emerge in non-linux OS, we will
provide only linux OS help regarding execution problems, we apologise.
we tested this code on Windows7. We successfully installed opencv
2.4.10 following this tutorial: [http://www.learnopencv.com/install-opencv3-on-windows/]
This suggests that the mex-function is also linux-based. The error should vanish if you compile the source code yourself on your system, e.g. with MinGW (also GCC), see here.
EDITED:
the README.markdown file (under LIB/mexopencv-master.zip) provides a little guide through the installation process of both, openCV and the mexopencv function for unix (including ubuntu 14.04) and Windows systems. The latter states:
Browse to mexopencv root folder, and type the following in the MATLAB
command window:
>> mexopencv.make
By default, mexopencv assumes the OpenCV library is installed in
C:\opencv. If this is not the case, specify the path as an argument:
>> mexopencv.make('opencv_path', 'c:\your\path\to\opencv')
Note that if you build OpenCV from source, this path specification
might not work out of the box. You need to replace dll files in the
OpenCV package with newly built binaries. Or, you need to modify
+mexopencv/make.m to correctly link your MEX-files with the library.
To remove existing mexopencv binaries, use the following command.
>> mexopencv.make('clean', true)
It requires a standard C++ compiler supported by Matlab (see here), any Visual Studio installation should be OK, as an open-source option MinGW is recommended. Just remember to pick the right system (usually 64-bit).

How can I copy a new version of libc?

I have a computer which is not to be connected to the internet for security reasons. It is running Linux. On a separate computer, I have code and a cross compiler for linux. When I move the program over to the offline Linux computer, I cannot execute it, due to an error " version `GLIBC_2.17' not found "
After checking /lib, I see that I do indeed only have version 2.13 of libc. On my development computer, I have all the relevant files for the 2.22 version which is being used to compile the program. I would like to somehow copy this version of libc on my development computer over to my offline computer so that I can run my program.
The problem is, I cannot seem to copy the files. Attempting to do so gives an error:
mv: error writing ‘./libc.so.6’: No space left on device
or something similar. I know this is not actually due to there not being space left on the device, because I don't have much of anything ON the device, and I can copy the files to other places in the filesystem, just not to the /lib directory. How can I migrate my newer version of libc over to the offline computer?
I would like to somehow copy this version of libc on my development computer over to my offline computer so that I can run my program.
Incorrectly updating libc on your "offline" computer is a very easy way to render it unbootable. You should not attempt this unless you understand what you are doing (which you clearly do not), and unless you know how to restore "offline" computer in case of failure.
The best approach is to use the package manager on the "offline" computer to install libc package correctly (details vary on what package manager is being used).
If the package manager approach doesn't work, you can copy individual files. Hoever note that system ld-linux.so and libc.so.6 must match at all times, or every dynamically linked program (your shell, cp, mv etc.) will break.
Since you need to update two files simultaneously, how could this be done? You need a statically-linked copy of cp. It is best to have a statically-linked copy of $SHELL and ln as well (in case you make a mistake).

PDFtk error when doing any command on Mac OS X

We have installed PDFTK server edition on Mac OS X 10.10 and Ubuntu 12 and Ubuntu 14.
When trying to do a dump_data_fields for any PDF it seems to throw a weird error before even getting to that operation..
$ pdftk SchoolPermissionSlip.pdf dump_data_fields
dyld: _dyld_bind_fully_image_containing_address() error
dyld: Symbol not found: ___emutls_get_address
Referenced from: /opt/pdflabs/pdftk/bin/../lib/libgcj.11.dylib
Expected in: /usr/lib/libSystem.B.dylib
in /opt/pdflabs/pdftk/bin/../lib/libgcj.11.dylib
Trace/BPT trap: 5
It's the latest version. Any ideas?
pdftk --version
pdftk 2.02 a Handy Tool for Manipulating PDF Documents
Copyright (c) 2003-13 Steward and Lee, LLC - Please Visit: www.pdftk.com
This is free software; see the source code for copying conditions. There is
NO warranty, not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
We have seen reports of this error intermittently on Mac OS X only.
That ___emutls_get_address symbol is provided by pdftk's own libgcc_s.1.dylib. The default location for pdftk's libraries on OS X is /opt/pdflabs/pdftk/lib. The default location for the pdftk binary is /opt/pdflabs/pdftk/bin/pdftk. If you ever move this pdftk binary, it is important to move its libraries along with it so that the pdftk bin directory remains siblings with this lib directory. This helps ensure that the binary can find its libraries. Perhaps your pdftk binary has been moved without also moving these libraries?
In any case, we have a solution that has worked for others.
Reading the dyld man page, the DYLD_LIBRARY_PATH environment variable can be used to give precedence to pdftk's libraries. From the Terminal, run:
export DYLD_LIBRARY_PATH=/opt/pdflabs/pdftk/lib:$DYLD_LIBRARY_PATH
Then test pdftk:
pdftk input.pdf dump_data_fields output data.txt
This is a duplicate of PDFtk Server on OS X 10.11 but posting our response here too:
We raised this to Sid back in August and he still has not fixed it so I think its fair to say that its a good idea to look for alternatives. Because of this, we have taken the initiative to submit a few first tools that people can enjoy for free in the following repository:
https://github.com/flexpaper/OSX-PDF-Toolkit
It contains easy to use scripts for CAT and BURST. We intend to add more tools going forward. Feel free to contribute
These new tools are using the native OSX libraries and no third party dependencies are needed whatsoever. Yay!

Calling pdftops does not work in Matlab

I want to use the export_fig package for Matlab. At one point this worked, but now it's broken. The error occurs here:
>> system('pdftops -h')
dyld: Library not loaded: /opt/local/lib/libtiff.5.dylib
Referenced from: /opt/local/bin/pdftops
Reason: Incompatible library version: pdftops requires version 8.0.0 or later, but libtiff.5.dylib provides version 6.0.0
pdftops -h: Trace/breakpoint trap
But when I call pdftops from my own bash terminal everything works fine. I suppose it must be because Matlab has some bad library paths or something, but I don't know where to go from here?
Some relevant environmental vars used by matlab:
>> system('env')
SHELL=/bin/bash
OSG_LD_LIBRARY_PATH=/Applications/MATLAB_R2013b.app/sys/openscenegraph/lib/maci64
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin
__CHECKFIX1436934=1
XFILESEARCHPATH=/Applications/MATLAB_R2013b.app/sys/java/jre/maci64/jre/lib/locale/%L/%T/%N%S:
DYLD_FRAMEWORK_PATH=/Applications/MATLAB_R2013b.app/sys/os/maci64:/Applications/MATLAB_R2013b.app/bin/maci64/../../Contents/MacOS:/Applications/MATLAB_R2013b.app/bin/maci64:/Applications/MATLAB_R2013b.app/extern/lib/maci64:/Applications/MATLAB_R2013b.app/sys/java/jre/maci64/jre/lib/./native_threads:/Applications/MATLAB_R2013b.app/sys/java/jre/maci64/jre/lib/./server:/Applications/MATLAB_R2013b.app/sys/java/jre/maci64/jre/lib/./lib/jli
SHLVL=1
__KMP_REGISTERED_LIB_33586=0x124404710-cafeb339-libiomp5.dylib
DYLD_LIBRARY_PATH=/Applications/MATLAB_R2013b.app/sys/os/maci64:/Applications/MATLAB_R2013b.app/bin/maci64/../../Contents/MacOS:/Applications/MATLAB_R2013b.app/bin/maci64:/Applications/MATLAB_R2013b.app/extern/lib/maci64:/Applications/MATLAB_R2013b.app/sys/java/jre/maci64/jre/lib/./native_threads:/Applications/MATLAB_R2013b.app/sys/java/jre/maci64/jre/lib/./server:/Applications/MATLAB_R2013b.app/sys/java/jre/maci64/jre/lib/./lib/jli
If you take a look at the error message, MATLAB uses libtiff to call pdftops, but only has version 6.0.0. It says it needs version 8.0.0 or later. There has been a case where this happened before here on StackOverflow. Someone was trying to install mexopencv and has encountered the same error that you're talking about: Compiling mexopencv in OS X 10.9 with Xcode 5 and Matlab R2013b
Though this is unrelated to what you're doing, they encountered the libtiff error that you speak of. They provide two solutions how to fix this error:
Go into MATLAB's root directory, then go bin/os directory where os is the directory of the operating system you are using (in my case, it's maci64). To get into the root directory, in the command prompt do this: cd/(matlabroot). Once you're here, locate the libtiff.5.dylib file and rename it to something like libtiff.5.dylib.bak so that the libtiff libraries that are used are the ones that are default to your system rather than what MATLAB is using internally in the program.
Force MATLAB to point to the library that is part of the system rather than using the one built into MATLAB. As such, in MATLAB's command prompt, run this command:
setenv('DYLD_INSERT_LIBRARIES','/opt/local/lib/libtiff.5.dylib');
Once you do this, you may get further errors that are similar but are with other libraries. As such, you need to keep appending these libraries in the second parameter of setenv and colon-delimiting them until you resolve the issues. You need to make sure that you're pointing to the ones on your system rather than the ones installed with MATLAB. In your case, you have to do:
setenv('DYLD_INSERT_LIBRARIES', ...
'/opt/local/lib/libtiff.5.dylib:/opt/local/lib/l‌​ibcurl.4.dylib');
Glad this helped!