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
Compilation errors - undefined reference #1
Comments
Did you obtain your copy of freebayes using git clone --recursive ... ? |
Yes, the problem exists when using "git clone --recursive https://github.com/ekg/freebayes.git" or when trying to compile tabixpp on it's own. Let me know if I can supply any further information to help out. rob-> gcc -v |
I am an idiot. I assumed that tabix was already installed on this box, but it wasn't. Solution was:
So sorry for wasting your time. Hopefully this will help future fools :) |
Hi, I'm sorry, but I have exactly the same problem and the solution that @robsyme posted is not working for me. Compiling freebayes (once cloned using the --recursive option) or tabixpp alone gives me the following error: https://gist.github.com/3405009 Am I missing something? Thank you very much |
Hi Guillermo, Do you have zlib installed? (-lz). I think it's liblz-dev in ubuntu This might have been pulled in by @robsyme when he installed the tabix Erik
|
Hi Erik, Yes, I have zlib installed. In ubuntu 12.04 is called zlib1g-dev. This is why I'm confused, I think I have all the dependencies installed, but the compilation keeps rising this error. However I'm looking to my /usr/lib directory and I can't find the file zlib.so, which should be there... I have googled but I cannot find any explanation for this. I have tried to make a softlink from /lib/x86_64-linux-gnu/libz.so.1.2.3.4 to /usr/lib/libz.so, but doesn't seems to work. Do you know if other users of ubuntu 12.04 x86_64 are having the same problem? Thank you very much for your help. |
Hi Guillermo, I don't know if other 12.04 users are having this issue. I don't have a Does this thread help: Erik
|
Hi Erik, Thanks for the threat. In fact, it was not a problem of dependencies. Looking for the specific errors I finally found this thread that gave me the solution of the problem: http://stackoverflow.com/questions/2395355/linking-with-libpng-zlib It looks like (copy&pase the answer from stackoverflow): "The linker only includes a .o from inside the .a if the .o is needed to satisfy a reference". So depending on the order you link the libraries, the linker includes or not some objects... wired. The solution was to edit the file freebayes/vcflib/tabixpp/Makefile and put the -lz to the end of the link line, remaining like this one: https://gist.github.com/3416100 Maybe this is something you want to take into account? If you want, I can pull-request you with the changes (just if you want to change it, of course). I've tested it in a fresh installation and it has compiled without problems. Anyway, thank you very much for your help :-) |
I have been trying to coerce vcflib into cmake, and I have encountered this same issue with zlib not being added to the tabix archive. I just wanted to point out that this thread was of great help. I ended up explicitly linking zlib to the tabix library and things went great. The bits that got me through:
|
Hi all I've installed Freebayes onto fresh Ubuntu 12.04 installs twice now. Worked my way through these dependency issues the first time and documented them properly the second time.. The following should work.. sudo apt-get install git sudo apt-get install cmake sudo apt-get install tabix git clone --recursive git://github.com/ekg/freebayes.git make I don't do the make install I just manually move the binaries to where I want them (/home/me/bin) The first time around I also had problems with zlib - but it was actually fixed by an automatic update from Ubuntu.. no problems the second time round. So probably just get your updates if you see the zlib problem. |
Hi,
I'm trying to compile tabixpp on ubuntu , but am getting a lot of "undefined reference to
xxxxx
" errors (https://gist.github.com/2309326)Am I missing a step? Is this a known issue?
The text was updated successfully, but these errors were encountered: