millanek / Dsuite

Fast calculation of Patterson's D (ABBA-BABA) and the f4-ratio statistics across many populations/species
161 stars 25 forks source link

compile error on ubuntu 18.04 #52

Closed angusdavison closed 2 years ago

angusdavison commented 2 years ago

Hi Milan

after struggling with admixtools, your new software looks really useful.

I am having troubling installing, same error on two different systems. Can you spot the error? GCC is 7.5.0 and Zlib is 1.2.11

The error I got after "make" is below.

Thanks

g++ -c -std=c++11 Dsuite.cpp -o Build/Dsuite.o g++ -c -std=c++11 Dsuite_utils.cpp -o Build/Dsuite_utils.o g++ -c -std=c++11 D.cpp -o Build/D.o g++ -c -std=c++11 gzstream.cpp -o Build/gzstream.o g++ -c -std=c++11 Dmin.cpp -o Build/Dmin.o g++ -c -std=c++11 Dmin_combine.cpp -o Build/Dmin_combine.o g++ -c -std=c++11 Dsuite_fBranch.cpp -o Build/Dsuite_fBranch.o g++ -c -std=c++11 Dquartets.cpp -o Build/Dquartets.o g++ -c -std=c++11 Dsuite_common.cpp -o Build/Dsuite_common.o g++ -c -std=c++11 kstest.cpp -o Build/kstest.o In file included from kstest.cpp:21:0: kstest.h:29:26: error: ‘int64_t’ was not declared in this scope double ks_test(std::list s1, std::list s2, std::ostream& output, bool printDebug); ^~~ kstest.h:29:33: error: template argument 1 is invalid double ks_test(std::list s1, std::list s2, std::ostream& output, bool printDebug); ^ kstest.h:29:33: error: template argument 2 is invalid kstest.h:29:49: error: ‘int64_t’ was not declared in this scope double ks_test(std::list s1, std::list s2, std::ostream& output, bool printDebug); ^~~ kstest.h:29:56: error: template argument 1 is invalid double ks_test(std::list s1, std::list s2, std::ostream& output, bool printDebug); ^ kstest.h:29:56: error: template argument 2 is invalid kstest.h:29:67: error: ‘std::ostream’ has not been declared double ks_test(std::list s1, std::list s2, std::ostream& output, bool printDebug); ^~~ In file included from kstest.cpp:22:0: Dsuite_utils.h: In member function ‘void TrioDinfo::testIfStrongSitesUniformlyDistributed()’: Dsuite_utils.h:593:94: error: cannot convert ‘std::__cxx11::list’ to ‘int’ for argument ‘1’ to ‘double ks_test(int, int, int&, bool)’ KSpvalForStrongSites = ks_test(uniABBAvals, linearStrongPosList, std::cerr, false);

xw18n842 commented 2 years ago

Hi,

I've got exactly the same errors. With google I found two lines and added to file 'kstest.h' and it seemed working:

#include <stdint.h>
#include <iostream>

I don't really understand why but hope they can help.

angusdavison commented 2 years ago

I dont know how you worked that out but I think it worked - marvellous, thanks!