ctSkennerton / crass

The CRISPR assembler
http://ctskennerton.github.io/crass
GNU General Public License v3.0
35 stars 11 forks source link

Install issue zlib related on gcc/g++ 4.7 and 4.8 on Ubuntu 16.04 LTS #83

Closed grokkaine closed 7 years ago

grokkaine commented 8 years ago

I had Crass installed and running on my Ubuntu 14.04 LTS laptop with gcc/g++ 4.8 and I wanted to install it on my workstation as well. The workstation runs the Ubuntu 16.04 LTS which has gcc 5* as default so after meeting the error I thought I should regress. I tried both gcc/g++ 4.7 and 4.8 with no luck. I still get the -lz related error bellow. The ./config tests list -lz as fine too. It is looking more like a code error at this point. Separately libcrispr installs, in case you're wondering. Do you have some clue?

$ g++ --version
g++ (Ubuntu/Linaro 4.7.4-3ubuntu12) 4.7.4
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(same for gcc of course)

./autogen.sh 
Preparing the crass build system...please wait

Found GNU Autoconf version 2.69
Found GNU Automake version 1.15
Found GNU Libtool version 2.4.6

As I said, -lz test checks out in ./configure. At make I get this:

g++ -DHAVE_CONFIGH -I. -I../.. -I/usr/include -I/usr/include/xercesc -pedantic -Wall -g -O2 -MT crass.o -MD -MP -MF .deps/crass.Tpo -c -o crass.o crass.cpp mv -f .deps/crass.Tpo .deps/crass.Po /bin/bash ../../libtool --tag=CXX --mode=link g++ -I/usr/include -I/usr/include/xercesc -pedantic -Wall -g -O2 -L/usr/lib -lz -lxerces-c -o crass crass.o libcrass.a ../../src/aho-corasick/libacism.a libtool: link: g++ -I/usr/include -I/usr/include/xercesc -pedantic -Wall -g -O2 -o crass crass.o -L/usr/lib -lz -lxerces-c libcrass.a ../../src/aho-corasick/libacism.a libcrass.a(SeqUtils.o): In function getFileHandle(char const*)': /home/sergiu/data/src/crass-master/src/crass/SeqUtils.cpp:105: undefined reference togzdopen' /home/sergiu/data/src/crass-master/src/crass/SeqUtils.cpp:109: undefined reference to gzopen' libcrass.a(libcrispr.o): In functionfindSingletons(char const, options const&, std::vector<std::string, std::allocator >, std::map<std::string, bool, std::less, std::allocator<std::pair<std::string const, bool> > >&, std::map<int, std::vector<ReadHolder, std::allocator<ReadHolder> >, std::less, std::allocator<std::pair<int const, std::vector<ReadHolder, std::allocator<ReadHolder*> >> > >, StringCheck, long&)': /home/sergiu/data/src/crass-master/src/crass/libcrispr.cpp:509: undefined reference to gzclose' libcrass.a(libcrispr.o): In functionsearchFile(char const, options const&, std::map<int, std::vector<ReadHolder, std::allocator<ReadHolder> >, std::less, std::allocator<std::pair<int const, std::vector<ReadHolder, std::allocator<ReadHolder*> >> > >, StringCheck, std::map<std::string, bool, std::less, std::allocator<std::pair<std::string const, bool> > >&, std::map<std::string, bool, std::less, std::allocator<std::pair<std::string const, bool> > >&, long&)': /home/sergiu/data/src/crass-master/src/crass/libcrispr.cpp:155: undefined reference to gzclose' /home/sergiu/data/src/crass-master/src/crass/libcrispr.cpp:144: undefined reference togzclose' libcrass.a(kseq.o): In function ks_getc(kstream_t_)': /home/sergiu/data/src/crass-master/src/crass/kseq.cpp:62: undefined reference togzread' libcrass.a(kseq.o): In functionks_getuntil(kstream_t_, int, kstring_t_, int_)': /home/sergiu/data/src/crass-master/src/crass/kseq.cpp:87: undefined reference togzread' collect2: error: ld returned 1 exit status Makefile:524: recipe for target 'crass' failed make[3]: _\ [crass] Error 1 make[3]: Leaving directory '/mnt/data/src/crass-master/src/crass' Makefile:372: recipe for target 'all-recursive' failed make[2]: * [all-recursive] Error 1 make[2]: Leaving directory '/mnt/data/src/crass-master/src' Makefile:477: recipe for target 'all-recursive' failed make[1]: * [all-recursive] Error 1 make[1]: Leaving directory '/mnt/data/src/crass-master' Makefile:388: recipe for target 'all' failed make: *\ [all] Error 2

ctSkennerton commented 8 years ago

Hmm... Well normally with this sort of error I would have thought that it was due to the development version of zlib not being installed, but configure should pick that up. You should just double check that manually though to make sure that there is libz.so in /usr/lib. Another possibility is the order of the linker flags that is messing things up, for example the linker flags should be at the end of the line after the local archives.

/bin/bash ../../libtool --tag=CXX --mode=link g++ -I/usr/include -I/usr/include/xercesc -pedantic -Wall -g -O2 -L/usr/lib -o crass crass.o libcrass.a ../../src/aho-corasick/libacism.a -lz -lxerces-c

This doesn't seem to be an issue with the versions of autoconf, automake, libtool, and gcc that I'm using but I am a few versions behind you. maybe something has changed.

grokkaine commented 8 years ago

True, if I run this line that threw my error from the crass source directory it seems to work, any insight on how to set this as part of the autotools though, so that my build process would continue?

$ g++ -I/usr/include -I/usr/include/xercesc -pedantic -Wall -g -O2 -o crass crass.o -L/usr/lib libcrass.a ../../src/aho-corasick/libacism.a -lz -lxerces-c

UPDATE:

Well I managed to somehow fix it by running the badly configured line with the above (making sure to be in the right directory). and then I just had the idea of running make again, it seemed that automake considered that step passed and just went forward.

Still, it would be nice to find an answer on how to change the order with the autotools!

ctSkennerton commented 8 years ago

I really have no idea why it is ordering things this way; autotools is a mystery to me.

ctSkennerton commented 8 years ago

BTW I think I've fixed the problem with the latest commit. Just needed to change how the linker variables were called in autotools