Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined symbol: ... #5

Closed
emanjavacas opened this issue Apr 20, 2018 · 8 comments
Closed

undefined symbol: ... #5

emanjavacas opened this issue Apr 20, 2018 · 8 comments
Assignees
Labels

Comments

@emanjavacas
Copy link

emanjavacas commented Apr 20, 2018

Hi there,

I have a clean ucto installation from sudo apt install ucto.
When I compile the python extension, however, I can't import it since it fails with:

ImportError: /home/manjavacas/.pyenv/versions/anaconda3-4.4.0/lib/python3.6/site-packages/ucto.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN9Tokenizer14TokenizerClass4initERKSs

Not sure what might be going bad, since ucto works perfectly fine and the extension manages to compile without errors.

Any ideas?

@proycon proycon self-assigned this Apr 23, 2018
@proycon
Copy link
Owner

proycon commented Apr 23, 2018

Hmm, hard to say exactly what happened here. Might there have been two different ucto version installed or ucto was upgraded after the Python extension was installed? Or compiled against a different Python version than your anaconda one? If you want to dive into this, you can use ldd to check what the library was linked to exactly.

A solution to get things working quickly may be to simply use LaMachine, which installs both ucto and python-ucto for you (in this case you'd have to uninstall the ucto package and dependencies first though)

@emanjavacas
Copy link
Author

You are right, there must've been some dependency issue. I've removed now everything related to ucto (ticcutils, libfolia, ucto). But installing ucto from the apt packages and trying to compile the extensions now results in a compilation failure not finding libfolia/folia.h:

running build
running build_ext
cythoning ucto_wrapper.pyx to ucto_wrapper.cpp
building 'ucto' extension
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/ -I/usr/include/libxml2 -I/usr/local/include/ -I/home/manjavacas/.pyenv/versions/anaconda3-4.4.0/include/python3.6m -c ucto_wrapper.cpp -o build/temp.linux-x86_64-3.6/ucto_wrapper.o --std=c++0x -D U_USING_ICU_NAMESPACE=1
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
ucto_wrapper.cpp:455:28: fatal error: libfolia/folia.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

However, libfolia did get installed as a dep of ucto:

[11:06:15][manjavacas@station ~/code/vendor/python-ucto](master %)$ ldconfig -p | grep folia
	libfolia.so.2 (libc6,x86-64) => /usr/lib/libfolia.so.2

@proycon
Copy link
Owner

proycon commented Apr 23, 2018

You'll need libfolia-dev as well which probably didn't get pulled in automatically.

(Also be aware that these debian packages are a bit older than the latest releases and there is currently an open issue (proycon/python-frog#6) regarding a missing libfrog-dev preventing compilation of python-frog)

@emanjavacas
Copy link
Author

Alright, thanks for the info:

I've installed libfolia-dev, libticcutils2-dev and libucto-dev.
After this, compilation fails on ucto with:

In file included from ucto_wrapper.cpp:457:0:
/usr/include/ucto/tokenize.h:33:20: fatal error: config.h: No such file or directory

I guess from your comment on the debian packages being older I gather that this issue is probably related to python-ucto relying on a newer version of ucto..

@proycon
Copy link
Owner

proycon commented Apr 23, 2018

That does seem likely yes, you could roll-back to an older python-ucto but that's not really recommended. I've been trying to get the debian packages updated for a while already but it takes quite some time and our primary effort goes into LaMachine.

@emanjavacas
Copy link
Author

emanjavacas commented Apr 23, 2018

I will try to compile the deps from scratch. I remember trying it not so long ago and having an issue with libtool version mismatches. I think it was ticcutils, so perhaps it makes sense to open an issue over there.

@proycon
Copy link
Owner

proycon commented Apr 23, 2018

Though it's a bit of a hassle, that should always work yeah (it's what LaMachine does too under the hood). Just make sure all debian packages are purged otherwise there may be duplicates lingering which will surely mess things up.

@emanjavacas
Copy link
Author

Alright, I managed to compile the extension after compiling deps from scratch.
For the record, the issue I was having with libtool was because anaconda was using its own installed version of it. Solution was to not just anaconda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants