Recompile Plink 2.0

256 views
Skip to first unread message

Mallory Morgan

unread,
Aug 3, 2022, 1:36:42 PM8/3/22
to plink2-users
Hello,

I am running into Error: Too many distinct nonstandard chromosome/contig names. I saw that I needed to git clone the source and uncomment #define HIGH_CONTIG_BUILD" plink2_common.h, which I have done. However, I am not sure how to recompile. Any direction would be much appreciated!

Christopher Chang

unread,
Aug 3, 2022, 1:40:15 PM8/3/22
to plink2-users
What happens if you navigate to the build_dynamic/ subdirectory, and then type "make" on the command line?

Mallory Morgan

unread,
Aug 3, 2022, 2:28:46 PM8/3/22
to plink2-users
It looks like it begins to work but then runs into errors, starting with:

In file included from ../plink2_glm_shared.h:22:0,
                 from ../plink2_glm.h:22,
                 from ../plink2.cc:23:
../plink2_matrix.h:116:31: fatal error: cblas.h: No such file or directory
 #            include <cblas.h>
                               ^
compilation terminated.

Mallory Morgan

unread,
Aug 3, 2022, 2:32:24 PM8/3/22
to plink2-users
Here is the entire output:

[mallory.morgan@login4 build_dynamic]$ make
cc -O2 -std=gnu99 -DZSTD_MULTITHREAD  -msse4.2 -DCPU_CHECK_SSE42  -DSTATIC_ZSTD -Wall -Wextra -Wshadow -Wformat-security -I../libdeflate -I../libdeflate/common -I../simde ../include/SFMT.c ../libdeflate/lib/adler32.c ../libdeflate/lib/crc32.c ../libdeflate/lib/deflate_compress.c ../libdeflate/lib/deflate_decompress.c ../libdeflate/lib/gzip_compress.c ../libdeflate/lib/gzip_decompress.c ../libdeflate/lib/utils.c ../libdeflate/lib/zlib_compress.c ../libdeflate/lib/zlib_decompress.c ../libdeflate/lib/arm/arm_cpu_features.c ../libdeflate/lib/x86/x86_cpu_features.c -c
cc -O2 -std=gnu99 -DZSTD_MULTITHREAD  -msse4.2 -DCPU_CHECK_SSE42  -DSTATIC_ZSTD -Wall -Wextra -Wshadow -Wformat-security -I../zstd/lib -I../zstd/lib/common ../zstd/lib/common/debug.c ../zstd/lib/common/entropy_common.c ../zstd/lib/common/error_private.c ../zstd/lib/common/fse_decompress.c ../zstd/lib/common/pool.c ../zstd/lib/common/threading.c ../zstd/lib/common/xxhash.c ../zstd/lib/common/zstd_common.c ../zstd/lib/compress/fse_compress.c ../zstd/lib/compress/hist.c ../zstd/lib/compress/huf_compress.c ../zstd/lib/compress/zstd_compress.c ../zstd/lib/compress/zstd_compress_literals.c ../zstd/lib/compress/zstd_compress_sequences.c ../zstd/lib/compress/zstd_compress_superblock.c ../zstd/lib/compress/zstd_double_fast.c ../zstd/lib/compress/zstd_fast.c ../zstd/lib/compress/zstd_lazy.c ../zstd/lib/compress/zstd_ldm.c ../zstd/lib/compress/zstd_opt.c ../zstd/lib/compress/zstdmt_compress.c ../zstd/lib/decompress/huf_decompress.c ../zstd/lib/decompress/zstd_ddict.c ../zstd/lib/decompress/zstd_decompress.c ../zstd/lib/decompress/zstd_decompress_block.c ../zstd/lib/decompress/huf_decompress_amd64.S -c
g++ -std=c++11 -O2 -DZSTD_MULTITHREAD  -msse4.2 -DCPU_CHECK_SSE42  -DSTATIC_ZSTD -Wall -Wextra -Wshadow -Wformat-security -Wold-style-cast -I../simde ../include/plink2_base.cc ../include/plink2_bits.cc ../include/pgenlib_misc.cc ../include/pgenlib_read.cc ../include/pgenlib_write.cc ../include/plink2_bgzf.cc ../include/plink2_bitmap.cc ../include/plink2_fmath.cc ../include/plink2_stats.cc ../include/plink2_string.cc ../include/plink2_text.cc ../include/plink2_thread.cc ../include/plink2_zstfile.cc ../plink2.cc ../plink2_adjust.cc ../plink2_cmdline.cc ../plink2_common.cc ../plink2_compress_stream.cc ../plink2_data.cc ../plink2_decompress.cc ../plink2_export.cc ../plink2_export_legacy.cc ../plink2_fasta.cc ../plink2_filter.cc ../plink2_glm.cc ../plink2_glm_linear.cc ../plink2_glm_logistic.cc ../plink2_glm_shared.cc ../plink2_help.cc ../plink2_import.cc ../plink2_import_legacy.cc ../plink2_ld.cc ../plink2_matrix.cc ../plink2_matrix_calc.cc ../plink2_merge.cc ../plink2_misc.cc ../plink2_psam.cc ../plink2_pvar.cc ../plink2_random.cc ../plink2_set.cc -c

In file included from ../plink2_glm_shared.h:22:0,
                 from ../plink2_glm.h:22,
                 from ../plink2.cc:23:
../plink2_matrix.h:116:31: fatal error: cblas.h: No such file or directory
 #            include <cblas.h>
                               ^
compilation terminated.
In file included from ../include/pgenlib_misc.h:77:0,
                 from ../include/pgenlib_read.h:23,
                 from ../plink2_common.h:26,
                 from ../plink2_filter.h:21,
                 from ../plink2_filter.cc:19:
../include/plink2_bits.h: In function ‘plink2::PglErr plink2::ReadAlleleFreqs(const uintptr_t*, const char* const*, const uintptr_t*, const char* const*, const char*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, double, uint32_t, double*, uintptr_t**)’:
../include/plink2_bits.h:303:36: warning: ‘matched_internal_alleles’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   return (bitarr[idx / kBitsPerWord] >> (idx % kBitsPerWord)) & 1;
                                    ^
../plink2_filter.cc:2427:16: note: ‘matched_internal_alleles’ was declared here
     uintptr_t* matched_internal_alleles;
                ^
In file included from ../include/pgenlib_misc.h:77:0,
                 from ../include/pgenlib_read.h:23,
                 from ../plink2_common.h:26,
                 from ../plink2_filter.h:21,
                 from ../plink2_filter.cc:19:
../include/plink2_bits.h:303:38: warning: ‘matched_loaded_alleles’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   return (bitarr[idx / kBitsPerWord] >> (idx % kBitsPerWord)) & 1;
                                      ^
../plink2_filter.cc:2426:16: note: ‘matched_loaded_alleles’ was declared here
     uintptr_t* matched_loaded_alleles;
                ^

In file included from ../plink2_glm_shared.h:22:0,
                 from ../plink2_glm_linear.h:21,
                 from ../plink2_glm.cc:19:

../plink2_matrix.h:116:31: fatal error: cblas.h: No such file or directory
 #            include <cblas.h>
                               ^
compilation terminated.
In file included from ../plink2_glm_shared.h:22:0,
                 from ../plink2_glm_linear.h:21,
                 from ../plink2_glm_linear.cc:19:

../plink2_matrix.h:116:31: fatal error: cblas.h: No such file or directory
 #            include <cblas.h>
                               ^
compilation terminated.
In file included from ../plink2_glm_shared.h:22:0,
                 from ../plink2_glm_logistic.h:21,
                 from ../plink2_glm_logistic.cc:20:

../plink2_matrix.h:116:31: fatal error: cblas.h: No such file or directory
 #            include <cblas.h>
                               ^
compilation terminated.
In file included from ../plink2_glm_shared.h:22:0,
                 from ../plink2_glm_shared.cc:17:

../plink2_matrix.h:116:31: fatal error: cblas.h: No such file or directory
 #            include <cblas.h>
                               ^
compilation terminated.
../plink2_import.cc: In function ‘plink2::PglErr plink2::BcfToPgen(const char*, const char*, const char*, const char*, plink2::MiscFlags, plink2::ImportFlags, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, double, char, char, int32_t, int32_t, int32_t, plink2::VcfHalfCall, plink2::FamCol, uint32_t, char*, char*, plink2::ChrInfo*, uint32_t*, uint32_t*)’:
../plink2_import.cc:7913:35: warning: ‘contig_out_slens’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             contig_out_slens[chrom] = contig_out_buf_iter - rendered_chr_name;
                                   ^
../plink2_import.cc:7912:35: warning: ‘contig_out_names’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             contig_out_names[chrom] = rendered_chr_name;
                                   ^
../plink2_import.cc:8124:110: warning: ‘sample_nypbuf’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           bcf_parse_err = BcfScanGt(&(ctx.bic), gt_start, qual_starts, &phase_or_dosage_found, sample_nypbuf);
                                                                                                              ^
In file included from ../plink2_matrix.cc:18:0:

../plink2_matrix.h:116:31: fatal error: cblas.h: No such file or directory
 #            include <cblas.h>
                               ^
compilation terminated.
In file included from ../plink2_matrix_calc.cc:19:0:

../plink2_matrix.h:116:31: fatal error: cblas.h: No such file or directory
 #            include <cblas.h>
                               ^
compilation terminated.
../plink2_misc.cc: In function ‘plink2::PglErr plink2::RecoverVarIds(const char*, const uintptr_t*, const ChrInfo*, const uint32_t*, const uintptr_t*, const char* const*, const char*, uint32_t, uint32_t, plink2::RecoverVarIdsFlags, uint32_t, char**, uint32_t*, char*, char*)’:
../plink2_misc.cc:967:86: warning: ‘orig_alt_starts’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             if (!strequal_overread(cur_alt_alleles[alt_idx], orig_alt_starts[alt_idx])) {
                                                                                      ^
make: *** [plink2""] Error 1

Christopher Chang

unread,
Aug 3, 2022, 8:08:24 PM8/3/22
to plink2-users
You need to install LAPACK on your system.  On Ubuntu, "sudo apt-get install liblapack-dev libatlas-base-dev" should do this.
Reply all
Reply to author
Forward
0 new messages