Gerp++ installation error
1
0
Entering edit mode
5.2 years ago

I am trying to compile gerp++ source code on Ubuntu 18.04.1 LTS but i am getting error using make command.

sudo make
g++ -Wall -W -pedantic -O4 -c MIter.cc
g++ -Wall -W -pedantic -O4 -c Mseq.cc
Mseq.cc: In member function ‘Vec<char> Mseq::getAlignment(Seq::size_type, Seq::size_type) const’:
Mseq.cc:328:16: warning: variable ‘X_end’ set but not used [-Wunused-but-set-variable]
                X_end = X.getEnd(),
                ^~~~~
Mseq.cc:329:16: warning: variable ‘Y_end’ set but not used [-Wunused-but-set-variable]
                Y_end = Y.getEnd();
                ^~~~~
g++ -Wall -W -pedantic -O4 -c Seq.cc
g++ -Wall -W -pedantic -O4 -c etree.cc
g++ -Wall -W -pedantic -O4 -c emodel.cc
g++ -Wall -W -pedantic -O4 -c gerpcol.cc
gerpcol.cc: In function ‘void estimateFreqs(std::vector<std::__cxx11::basic_string<char> >&, double*)’:
gerpcol.cc:154:49: error: no matching function for call to ‘find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, std::__cxx11::string&)’
       if (find(species.begin(), species.end(), s) == species.end()) {
                                                 ^
In file included from /usr/include/c++/7/bits/locale_facets.h:48:0,
                 from /usr/include/c++/7/bits/basic_ios.h:37,
                 from /usr/include/c++/7/ios:44,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from gerpcol.cc:23:
/usr/include/c++/7/bits/streambuf_iterator.h:369:5: note: candidate: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&)
     find(istreambuf_iterator<_CharT> __first,
     ^~~~
/usr/include/c++/7/bits/streambuf_iterator.h:369:5: note:   template argument deduction/substitution failed:
gerpcol.cc:154:49: note:   ‘__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >’ is not derived from ‘std::istreambuf_iterator<_CharT>’
       if (find(species.begin(), species.end(), s) == species.end()) {
                                                 ^
gerpcol.cc: In function ‘void processMAF(std::ofstream&, ETree&, double*)’:
gerpcol.cc:197:3: error: ‘sort’ was not declared in this scope
   sort(species.begin(), species.end());
   ^~~~
gerpcol.cc:197:3: note: suggested alternative: ‘qsort’
   sort(species.begin(), species.end());
   ^~~~
   qsort
gerpcol.cc: In function ‘int main(int, char**)’:
gerpcol.cc:459:11: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
     system("date");
     ~~~~~~^~~~~~~~
Makefile:14: recipe for target 'gerpcol.o' failed
make: *** [gerpcol.o] Error 1

Anyone have any idea how to resolve this issue.

gerp gerp++ SNP gerp2 • 2.1k views
ADD COMMENT
0
Entering edit mode

No idea, but you shouldn't need sudo for make

Try also make -j 4 for multiple cores

ADD REPLY
0
Entering edit mode
3.0 years ago

Hello, You have to add into files etree.cc, gerpcol.cc, and gerpelem.cc one line :

#include <cstdlib>

and run:

$ make clean
$ make

It's all . Good luck!

Alessandro

ADD COMMENT
0
Entering edit mode

If you still have problems after adding #include <cstdlib>, try to add also these lines to the same files:

#include <algorithm>

#include <cstring>

ADD REPLY

Login before adding your answer.

Traffic: 1840 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6