-
Notifications
You must be signed in to change notification settings - Fork 446
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
Linker error in 1.4 #493
Comments
If I had to guess I would say homebrew have either not added -lbz2 and -llzma to their cmake file or got the linking order wrong. I would suggest you report this to Homebrew in the first instance as their CMake is not of our making.
… On 20 Mar 2017, at 19:56, Daniel Cooke ***@***.***> wrote:
I've just upgraded in 1.4 with Homebrew and I'm now getting the following linker error:
Undefined symbols for architecture x86_64:
"_BZ2_bzBuffToBuffCompress", referenced from:
_cram_compress_by_method in libhts.a(cram_io.o)
"_BZ2_bzBuffToBuffDecompress", referenced from:
_cram_uncompress_block in libhts.a(cram_io.o)
"_lzma_code", referenced from:
_cram_uncompress_block in libhts.a(cram_io.o)
"_lzma_easy_buffer_encode", referenced from:
_cram_compress_by_method in libhts.a(cram_io.o)
"_lzma_easy_decoder_memusage", referenced from:
_cram_uncompress_block in libhts.a(cram_io.o)
"_lzma_end", referenced from:
_cram_uncompress_block in libhts.a(cram_io.o)
"_lzma_stream_buffer_bound", referenced from:
_cram_compress_by_method in libhts.a(cram_io.o)
"_lzma_stream_decoder", referenced from:
_cram_uncompress_block in libhts.a(cram_io.o)
ld: symbol(s) not found for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/octopus] Error 1
make[1]: *** [src/CMakeFiles/octopus.dir/all] Error 2
make: *** [all] Error 2
Compiled with Clang 4.0.
Dan
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.
|
I've reported this to Homebrew, but I've also tried building myself from the latest Github develop branch and I'm still getting linker errors:
|
What commands are you typing for compilation? Is this straight make, or with configure first? The missing symbols here are almost certainly due to missing dependencies. The INSTALL file lists the dependencies needed and they should be checked in the configure script too, but not the default Makefile. |
I used the commands given in the README (i.e. with configure first). I can successfully link to 1.3.2 (using either Homebrew or manual install). |
What output did you get from configure? It should complain if it can't link to libcurl or libbz2. |
Ah, it does indeed complain about being unable to find liblzma. I do however already have xz installed (version 5.2.3). |
Also, Homebrew does seem to be aware of this requirement, on attempting to uninstall xz:
|
This could be due to stale configuration files. Try If you're using the version from homebrew, apparantly with CMake files in it, then try instead using a clean checkout from github (or the release tarball) instead. It's likely that CMake has replaced htslib's Makefile with one that won't work, even if you try to reconfigure. |
Still no luck, here is the full output:
And to sanity check the library is installed:
|
Our official stance on this is that if your include files are installed somewhere other than the default compiler path then you have to manually modify the compiler flags at configure/make time. Eg However I think this is pretty distgusting personally and my own preference was for --with-lzma=DIR type syntax, as well as having a more intelligent search path that looked in more places including "standard" non-system localities such as /usr/local. Maybe we should reconsider the original PR - eg see https://github.com/samtools/htslib/pull/331/files#diff-3928dcc0b7a862396236aae91c495bffR89 |
This is very odd, as configure found the lzma library, but not the header file. As @jkbonfield mentioned, you can use
You might want to try You can check the include search path for gcc using
Check that
Check that You may also want to look for lzma-related files in directories above You should also look for
When it doesn't, you usually get a lot more output. |
The symlinked header is where it's supposed to be and is readable:
Also, nothing reported by
So I guess that explains why There are no other versions of
|
I'd ignore the homebrew version and concentrate on the Github develop branch. Run It should have made
Config.mk should include these lines (possibly also with libcurl):
If that's the case then |
Resolved! The |
Hi Dan, Thanks for figuring that out. For those of us with the same problem who are not so technically inclined, can you explain where we should put the FindHTSlib.cmake script you created and how we should reference it when running make? Thanks! |
Hi @ejewett, sorry for the delayed response! I usually but CMake modules in |
I've just upgraded in 1.4 with Homebrew and I'm getting the following linker error:
Compiled with Clang 4.0.
Dan
The text was updated successfully, but these errors were encountered: