Anushkasandaruwan / cleartk

Automatically exported from code.google.com/p/cleartk
0 stars 0 forks source link

crfsuite dyld problem #314

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run "mvn test"

What is the expected output?

Tests run: 2, Failures: 0, Errors: 0, Skipped: 0

What do you see instead?

WARNING: CRFSuite could not be executed!
Jul 18, 2012 5:57:16 PM org.cleartk.classifier.crfsuite.CRFSuiteWrapper 
<init>(86)
WARNING: The CRFSuite binary is not available for the current operation system, 
please install it!
Jul 18, 2012 5:57:16 PM org.cleartk.classifier.crfsuite.CRFSuiteWrapper 
trainClassifier(215)
WARNING: dyld: Library not loaded: 
/Users/dbaer/make_crfsuite/binaries/lib/libcrfsuite-0.12.dylibReferenced from: 
/Users/bethard/Code/cleartk/cleartk-ml-crfsuite/target/classes/crfsuite/osx_x86_
64/bin/crfsuiteReason: image not found
Jul 18, 2012 5:57:16 PM org.cleartk.classifier.crfsuite.CRFSuiteWrapper 
trainClassifier(216)
INFO: 

Jul 18, 2012 5:57:16 PM org.cleartk.classifier.crfsuite.CRFSuiteWrapper 
classifyFeatures(296)
WARNING: dyld: Library not loaded: 
/Users/dbaer/make_crfsuite/binaries/lib/libcrfsuite-0.12.dylibReferenced from: 
/Users/bethard/Code/cleartk/cleartk-ml-crfsuite/target/classes/crfsuite/osx_x86_
64/bin/crfsuiteReason: image not found

Please use labels and text to provide additional information.

So look in particular at that last line with the "dyld". It's referring to a 
hard-coded path on some system that I'm not on. Seems like the library path 
should be relative to the crfsuite binary. Or maybe the whole thing should be 
statically linked rather than dynamically linked?

Original issue reported on code.google.com by steven.b...@gmail.com on 19 Jul 2012 at 12:02

GoogleCodeExporter commented 9 years ago
That binary should be rebuilt statically.

Original comment by richard.eckart on 19 Jul 2012 at 6:55

GoogleCodeExporter commented 9 years ago
The binaries for the other platforms should also be linked statically, which 
should remove the need to include the "lib" and "include" folders in SVN.

Original comment by richard.eckart on 19 Jul 2012 at 9:10

GoogleCodeExporter commented 9 years ago
For OS X, there is another alternative, since static builds are a bit 
problematic on OS X:

builder.environment().put("DYLD_LIBRARY_PATH", ...path...to...lib...folder...);

I didn't look at the CRFSuiteWrapper in detail yet.

Original comment by richard.eckart on 20 Jul 2012 at 8:26

GoogleCodeExporter commented 9 years ago
Relevant link for OS X: 
http://developer.apple.com/library/mac/#qa/qa1393/_index.html

Original comment by richard.eckart on 20 Jul 2012 at 10:08

GoogleCodeExporter commented 9 years ago

Original comment by steven.b...@gmail.com on 24 Jul 2012 at 5:27

GoogleCodeExporter commented 9 years ago
I built a statically linked version of crfsuite 0.12 with liblbfgs 1.10. It's 
attached to this issue. It should work if you replace the current OS X binary 
with this one. Please test.

Original comment by richard.eckart on 24 Jul 2012 at 5:35

Attachments:

GoogleCodeExporter commented 9 years ago
For the record: 

- download liblbfgs and configure with --prefix=~/crf, make and install it
- download crfsuite and configure with --prefix=~/crf  --with-liblbfgs=~/crf/, 
make and install it
- go to crfsuite-0.12/frontend
- gcc -o crfsuite-static *.o ~/crf/lib/libcqdb.a ~/crf/lib/libcrfsuite.a 
~/crf/lib/liblbfgs.a

The result should be a statically linked binary called "crfsuite-static".

Original comment by richard.eckart on 24 Jul 2012 at 5:38

GoogleCodeExporter commented 9 years ago
@Steven: I think Martin is a bit busy at the moment and he doesn't have a Mac 
anyway. Please check if this static binary works for you.

Original comment by richard.eckart on 24 Jul 2012 at 5:41

GoogleCodeExporter commented 9 years ago
Works like a charm, thanks! I committed it in r3925.

I'm leaving this issue open until we have the linux binaries linked statically 
as well.

Original comment by steven.b...@gmail.com on 25 Jul 2012 at 4:06

GoogleCodeExporter commented 9 years ago
So I just tried this out on a Linux box where I don't have crfsuite installed, 
and the cleartk-ml-crfsuite tests all pass, meaning the dynamically linked 
crfsuite seems to work fine on Linux.

So, while we should probably still rebuild the crfsuite binaries statically for 
Linux, this issue won't block the 1.2 release.

Original comment by steven.b...@gmail.com on 26 Jul 2012 at 5:52

GoogleCodeExporter commented 9 years ago

Original comment by lee.becker on 17 Feb 2013 at 6:00

GoogleCodeExporter commented 9 years ago

Original comment by steven.b...@gmail.com on 3 May 2013 at 8:44

GoogleCodeExporter commented 9 years ago

Original comment by phi...@ogren.info on 15 Mar 2014 at 5:41