diff options
author | Pjotr Prins | 2018-01-26 10:57:14 +0000 |
---|---|---|
committer | Pjotr Prins | 2018-01-26 10:57:14 +0000 |
commit | b0d31fa2631622d09730c85b5ce3e82b4886dd45 (patch) | |
tree | c35879b1e77dfb546ae8c2abe7bc8ea8a058ef53 | |
parent | 3293f7e6456574272418b16f4a5ba22f60f8d67a (diff) | |
download | pangemma-b0d31fa2631622d09730c85b5ce3e82b4886dd45.tar.gz |
Always check input data for strtok - unless -no-check is used
-rw-r--r-- | INSTALL.md | 14 | ||||
-rw-r--r-- | src/debug.cpp | 2 | ||||
-rw-r--r-- | src/io.cpp | 1 |
3 files changed, 16 insertions, 1 deletions
@@ -172,3 +172,17 @@ Note, for performance we want a 64-bit binary with threading. make EIGEN_INCLUDE_PATH=~/.guix-profile/include/eigen3 LIBS="~/opt/gsl2/lib/libgsl.a ~/tmp/OpenBLAS/libopenblas_haswell-r0.3.0.dev.a ~/.guix-profile/lib/libgfortran.a ~/.guix-profile/lib/libquadmath.a -pthread -lz" OPENBLAS_INCLUDE_PATH=~/tmp/OpenBLAS/ -j 4 fast-check Note we don't include standard lapack, because it is 32-bits. + +## Trouble shooting + +### undefined reference to `dpotrf_' + +If you get errors like + + gemma/src/lapack.cpp:58: undefined reference to `dpotrf_' + gemma/src/lapack.cpp:80: undefined reference to `dpotrs_' + gemma/src/lapack.cpp:162: undefined reference to `dsyev_' + +it means you need to link against LAPACK. E.g. + + make WITH_LAPACK=1 diff --git a/src/debug.cpp b/src/debug.cpp index fd94f1e..45e57d7 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -143,7 +143,7 @@ gsl_vector *gsl_vector_safe_alloc(size_t n) { char *do_strtok_safe(char *tokenize, const char *delimiters, const char *__pretty_function, const char *__file, int __line) { auto token = strtok(tokenize,delimiters); - if (token == NULL && (is_debug_mode() || is_strict_mode())) + if (token == NULL && is_check_mode()) fail_at_msg(__file,__line,string("strtok failed in ") + __pretty_function); return token; } @@ -707,6 +707,7 @@ bool ReadFile_geno(const string &file_geno, const set<string> &setSnps, if (indicator_idv[i] == 0) continue; + enforce_msg(ch_ptr,"Problem reading geno file"); if (strcmp(ch_ptr, "NA") == 0) { gsl_vector_set(genotype_miss, c_idv, 1); n_miss++; |