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

pthread library required #3

Closed
Dogora opened this issue Aug 11, 2015 · 5 comments
Closed

pthread library required #3

Dogora opened this issue Aug 11, 2015 · 5 comments

Comments

@Dogora
Copy link

Dogora commented Aug 11, 2015

I'm running openSUSE 13.1 (x64) and have libmxml v2.6 installed. When I run ./configure, it fails, claiming mxml is missing or <2.6. Looking at config.log, I determined that ./configure is missing the -lpthread switch to the linker command when it tries to compile and link conftest.c around line 3711. Once I manually add -lpthread, everything works well.

Error lines from my config.log are:
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/libmxml.so: undefined reference to 'pthread_getspecific' /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/libmxml.so: undefined reference to 'pthread_key_create' /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/libmxml.so: undefined reference to 'pthread_once' /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/libmxml.so: undefined reference to 'pthread_setspecific'

You may want to add the requirement of libpthread to the list and add it so ./configure uses it.

@tjko
Copy link
Owner

tjko commented Aug 12, 2015

Seems as if libmxml.so in openSUSE is not pre-linked against libptread.so (?) As I don't see this issue in Debian, where libmxml.so seems to be linked against libptread.so.

Could you try if following change fixes this? cd9fc53

@Dogora
Copy link
Author

Dogora commented Aug 12, 2015

I pulled down the complete package again, using the "Download ZIP" button on the main page, and I get the same error about missing pthread. I'm not very good at this, but it looks like your changes above to configure and config/configure.in are in the version I downloaded.

@tjko
Copy link
Owner

tjko commented Aug 13, 2015

Autoconf can be tricky sometimes, I think I may have found way to conditionally add linking of libpthread if libmxml depends on it, its not pretty but should work: 67f1dee

If that doesn't work then manually specifying "extra" libraries should do it.
Something like this probably works (?)

# LIBS="-lphtread" ./configure

@Dogora
Copy link
Author

Dogora commented Aug 13, 2015

This one worked; it created the Makefile that included -lpthread on the LIBS= line (line 44).
It's a bit funky, but it does work. The output of configure has these 2 lines:

checking for library containing mxmlLoadFile... no
checking for library containing mxmlLoadFd... -lmxml

config.log is a bit confusing, but the end result is good.

What I've done in the past is manually modify my configure script to include -lpthread. Then, I also add that to the Makefile. I thought about LIBS="-lpthread", but I modified the files instead.

@tjko
Copy link
Owner

tjko commented Aug 14, 2015

This probably is not the best way to detect what dependencies a library may have, but seems to work. I'll leave it like this for now, until someone shows better way to do this...

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

No branches or pull requests

2 participants