taku910 / crfpp

CRF++: Yet Another CRF toolkit
Other
505 stars 192 forks source link

Compilation of swig wrappers requires installation of library #23

Open garfieldnate opened 8 years ago

garfieldnate commented 8 years ago

The Swig wrappers can't be compiled right now because the link to CRFPP::Model::get_template is missing. Here's what happens when you run make in the java directory:

c++ -O3 -c -fpic CRFPP_wrap.cxx  -I/usr/lib/jvm/oracle-jdk-bin-1.8/include/ -I/usr/lib/jvm/oracle-jdk-bin-1.8/include/linux
CRFPP_wrap.cxx: In function ‘_jstring* Java_org_chasen_crfpp_CRFPPJNI_Model_1getTemplate(JNIEnv*, jclass, jlong, jobject)’:
CRFPP_wrap.cxx:311:54: error: ‘const class CRFPP::Model’ has no member named ‘getTemplate’
Makefile:14: recipe for target 'all' failed
make: *** [all] Error 1
garfieldnate commented 8 years ago

This was a problem with Swig. I was using an outdated version, and using the latest solved the problem.

garfieldnate commented 8 years ago

I'm reopening this because the problem persists on Linux with the latest version of Swig (3.0.8). The problem did not occur on Windows with the same version.

garfieldnate commented 8 years ago

I realized the (very silly) problem, which was that I had not installed the library, and the makefile requires it. I don't think installation should be required, since the result of this compilation is also a portable library, and the user may just want the library without installing anything.