gregdurrett / berkeley-doc-summarizer

The Berkeley Document Summarizer is a learning-based, single-document summarization system that extracts source document content, exploits syntactic information to compress it, and uses coreference constraints to ensure clarity.
GNU General Public License v3.0
741 stars 64 forks source link

get exceptions with running run-summarizer.sh #2

Open catherine667 opened 7 years ago

catherine667 commented 7 years ago

Hi,

I am trying to use your summarizer and refer your paper in my paper, but I got an exception as the following:

screen shot 2017-04-03 at 11 54 50 pm

I am using mac os. I am trying to set java jni but I always got an error. There will be /usr/local/lib/jni in mac os wrote in the readme, but I can't find any folder with jni in my mac. Could you please tell me how to set jni with mac? I appreciate your help. Thank you.

gregdurrett commented 7 years ago

(putting this here as well for others who have this issue)

I'm not sure what the exact issue is. I assume you followed the directions on http://glpk-java.sourceforge.net/index.html#Downloading for downloading and installing. I think I used brew (brew install glpk) for it.

You may need to add both /usr/local/lib/jni and /usr/lib/jni the path; that seems to be indicated on that download page.

This listserv post may also help (the error is similar): https://lists.gnu.org/archive/html/help-glpk/2010-04/msg00030.html

Finally, it's also possible that the glpk jar I distribute with the project is somehow outdated -- you might try replacing it with an updated one.

run-summarizer.sh runs a very small test that tests loading the JNI bindings (line 7, just below "# Extracts the existing java library path"). Running just that small java command may provide a faster way to debug.

Hope this helps, sorry I don't know what the issue is!

catherine667 commented 7 years ago

Hi, Thank you so much for your reply! May I know the computer system version you have used for this summarizer? I can try to find the same one to try your system.

Besides, I am really interested in how fast is your summarizer after training? I would appreciate if you can tell me the scale of the running time. Thank you.

Best,

skrealworld commented 7 years ago

@catherine667 were you able to solve this issue ? I am getting the similar error.

catherine667 commented 7 years ago

@skrealworld It seems like it was the version of system problem. I haven't solved it yet.

skrealworld commented 7 years ago

I have tried this on OSX 10.2 and Ubuntu 14.04, still giving me the same issue. In both cases I can't see "libglpk_java" file. I tried to install from the source also but it throwing this error : checking for mvn... /usr/local/bin/mvn checking whether to load GLPK library from java.library.path... no checking for thread local storage (TLS) class... _Thread_local checking glpk.h usability... no checking glpk.h presence... no checking for glpk.h... no configure: error: glpk.h not found

I can find this "glpk.h" at /usr/local/include.

Any help will be appreciated.

psmeros commented 7 years ago

Hi all,

I had the same problem on OSX 10.12.4 and I installed libglpk_java from sources by running configure -> make -> make install. During compilation I had to export:

CPPFLAGS="-I /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/include/ -I /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/include/darwin/".

Then run-summarizer.sh runs without errors.

Best, Panayiotis

ewanmellor commented 6 years ago

I think that the source of the confusion is that berkeley-doc-summarizer/lib/glpk-java-1.1.0.jar (i.e. the one committed to the repo) is useless, because it doesn't include its native library. It's not just the glpk package that is native code, libglpk-java has a native library too.

For macOS, you can use brew install glpk, and then compile libglpk-java from source (following the comment from @psmeros).

I saw a comment elsewhere that you need brew install swig too (I already had that so I'm not sure).

I ended up with:

./run-glpk-test.sh runs fine after that.