user3449212
user3449212

Reputation:

error while loading shared libraries: libcrfpp.so.0

I checked all previous threads, set

LD_LIBRARY_PATH and followed accordingly. But still no issue.

I am trying to execute cherrypicker software and executing in this way:

./cherrypicker.sh input.txt

Error message :

/root/Desktop/karim/software/cherrypicker1.01/tools/crf++/.libs/lt-crf_test: error while loading shared libraries: libcrfpp.so.0: cannot open shared object file: No such file or directory
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
    at java.util.Vector.get(Vector.java:744)
    at CreateNPSpan.<init>(CreateNPSpan.java:30)
    at CreateNPSpan.main(CreateNPSpan.java:81)
creating feature file....
java.io.FileNotFoundException: input.txt.npspan (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:146)
    at java.io.FileInputStream.<init>(FileInputStream.java:101)
    at java.io.FileReader.<init>(FileReader.java:58)
    at CherryPick.LoadManualEntities(CherryPick.java:111)
    at CherryPick.LoadEntities(CherryPick.java:139)
    at CherryPick.<init>(CherryPick.java:30)
    at CherryPick.main(CherryPick.java:2188)
Exception in thread "main" java.lang.NullPointerException
    at CherryPick.SortEntityMentions(CherryPick.java:171)
    at CherryPick.LoadEntities(CherryPick.java:141)
    at CherryPick.<init>(CherryPick.java:30)
    at CherryPick.main(CherryPick.java:2188)
classifying clusters using cr joint model.....
creating output.....
Gotcha creating entities : java.lang.NumberFormatException: For input string: "no"

I checked usr/lib but there's no such file.

In directory : cherrypicker1.01/tools/crf++/.libs I found following files

crf_learn        feature_index.o  libcrfpp.lai       lt-crf_test  tagger.o
crf_test         feature.o        libcrfpp.o         node.o
encoder.o        lbfgs.o          libcrfpp.so.0.0.0  param.o
feature_cache.o  libcrfpp.a       lt-crf_learn       path.o

Any suggestion for this?

Upvotes: 1

Views: 3927

Answers (2)

Nehal J Wani
Nehal J Wani

Reputation: 16639

The path to which the libraries reside depends upon the value passed to --prefix to the configure script. If it is not passed, then according to the source code, the default path is /usr/local/.

Actually, by default /usr/local/lib is not present the path where system searches for dynamic libraries. Hence, one can do:

echo "/usr/local/lib/" | sudo tee /etc/ld.so.conf.d/CRF.conf
sudo rm -f /etc/ld.so.cache
sudo ldconfig

Now, perform:

ldd $(which crf_test)

The output should be something similar to:

linux-vdso.so.1 (0x00007ffefc1f0000)
libcrfpp.so.0 => /usr/local/lib/libcrfpp.so.0 (0x00007f6b715b4000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f6b71398000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f6b71016000)
libm.so.6 => /lib64/libm.so.6 (0x00007f6b70d0e000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f6b70af7000)
libc.so.6 => /lib64/libc.so.6 (0x00007f6b70737000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6b717f3000)

The CRF developers may wish to hard code /usr/local/lib/ or $PREFIX/lib as one of the directories to search for, inside the binaries, using RPATH. To check if a binary contains RPATH, do:

objdump -x $binary | grep RPATH

Upvotes: 3

user123
user123

Reputation: 5407

Follow these steps

  1. Go to http://taku910.github.io/crfpp/#download and download CRF++-0.58.tar.gz
  2. Untar above file and do ./configure, make install
  3. In parent directories lookup for file sudo find ./ | grep libcrfpp.so.0, from there you will get where the missing file is located
  4. copy that file to /usr/lib and cherrypicker1.01/tools/crf++/.libs/

Now it should work

Upvotes: 4

Related Questions