j-levy / bwa-gasal2

BWA-MEM program accelerated with the GASAL2 library
GNU General Public License v3.0
18 stars 8 forks source link

compile error #3

Open dawe opened 3 years ago

dawe commented 3 years ago

Hi all, I tried to build bwa-gasal2 on my system but I'm getting errors in the procedure. I cloned the repo, built GASAL2 library for my platform (it seems to work), although I had to substitute this

g++ -std=c++11 -O3 -o test_prog.out -L/usr/local/cuda//targets/x86_64-linux/lib -L../lib test_prog.o -fopenmp -lcudart -lgasal

with this in the Makefile

nvcc -std=c++11 -O3 -o test_prog.out -L/usr/local/cuda//targets/x86_64-linux/lib -L../lib test_prog.o -lgomp -lcudart -lgasal. Nevertheless, when issuing make at bwa-gasal2 level, I have this error:

$ make
If you donot see anything below this line then there is nothing to "make"
g++ -c -g -Wall -Wno-unused-function -O2 -msse4.2 -std=c++11 -fpermissive -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  -I./GASAL2/include/  -I/beegfs/scratch/ric.cosr/cittaro.davide/src/boost_1_74_0 src/bwamem.c -o ./obj/bwamem.o
Makefile:57: recipe for target 'bwamem.o' failed

In file included from src/bwamem.c:18:0:
src/vector_filter.h:12:36: error: ‘aligned’ was not declared in this scope
 #define __aligned__ __attribute__((aligned(16)))
                                    ^
src/vector_filter.h:12:36: note: suggested alternative: ‘signed’
In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/xmmintrin.h:31:0,
                 from /usr/lib/gcc/x86_64-linux-gnu/7/include/emmintrin.h:31,
                 from /usr/lib/gcc/x86_64-linux-gnu/7/include/pmmintrin.h:31,
                 from /usr/lib/gcc/x86_64-linux-gnu/7/include/tmmintrin.h:31,
                 from /usr/lib/gcc/x86_64-linux-gnu/7/include/smmintrin.h:32,
                 from /usr/lib/gcc/x86_64-linux-gnu/7/include/nmmintrin.h:31,
                 from src/vector_filter.h:16,
                 from src/bwamem.c:18:
/usr/lib/gcc/x86_64-linux-gnu/7/include/mmintrin.h:45:85: error: expected ‘)’ before ‘(’ token
 typedef int __m64_u __attribute__ ((__vector_size__ (8), __may_alias__, __aligned__ (1)));
                                                                                     ^
/usr/lib/gcc/x86_64-linux-gnu/7/include/mmintrin.h:45:85: error: expected ‘)’ before ‘(’ token
In file included from src/bwamem.c:18:0:
src/vector_filter.h:12:36: error: ‘aligned’ was not declared in this scope
 #define __aligned__ __attribute__((aligned(16)))
                                    ^
src/vector_filter.h:12:36: note: suggested alternative: ‘signed’
In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/emmintrin.h:31:0,
                 from /usr/lib/gcc/x86_64-linux-gnu/7/include/pmmintrin.h:31,
                 from /usr/lib/gcc/x86_64-linux-gnu/7/include/tmmintrin.h:31,
                 from /usr/lib/gcc/x86_64-linux-gnu/7/include/smmintrin.h:32,
                 from /usr/lib/gcc/x86_64-linux-gnu/7/include/nmmintrin.h:31,
                 from src/vector_filter.h:16,
                 from src/bwamem.c:18:
/usr/lib/gcc/x86_64-linux-gnu/7/include/xmmintrin.h:72:89: error: expected ‘)’ before ‘(’ token
 typedef float __m128_u __attribute__ ((__vector_size__ (16), __may_alias__, __aligned__ (1)));
                                                                                         ^
/usr/lib/gcc/x86_64-linux-gnu/7/include/xmmintrin.h:72:89: error: expected ‘)’ before ‘(’ token
In file included from src/bwamem.c:18:0:
src/vector_filter.h:12:36: error: ‘aligned’ was not declared in this scope
 #define __aligned__ __attribute__((aligned(16)))
                                    ^
src/vector_filter.h:12:36: note: suggested alternative: ‘signed’
In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/pmmintrin.h:31:0,
                 from /usr/lib/gcc/x86_64-linux-gnu/7/include/tmmintrin.h:31,
                 from /usr/lib/gcc/x86_64-linux-gnu/7/include/smmintrin.h:32,
                 from /usr/lib/gcc/x86_64-linux-gnu/7/include/nmmintrin.h:31,
                 from src/vector_filter.h:16,
                 from src/bwamem.c:18:
/usr/lib/gcc/x86_64-linux-gnu/7/include/emmintrin.h:57:94: error: expected ‘)’ before ‘(’ token
 typedef long long __m128i_u __attribute__ ((__vector_size__ (16), __may_alias__, __aligned__ (1)));
                                                                                              ^
/usr/lib/gcc/x86_64-linux-gnu/7/include/emmintrin.h:57:94: error: expected ‘)’ before ‘(’ token
In file included from src/bwamem.c:18:0:
src/vector_filter.h:12:36: error: ‘aligned’ was not declared in this scope
 #define __aligned__ __attribute__((aligned(16)))
                                    ^
src/vector_filter.h:12:36: note: suggested alternative: ‘signed’
In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/pmmintrin.h:31:0,
                 from /usr/lib/gcc/x86_64-linux-gnu/7/include/tmmintrin.h:31,
                 from /usr/lib/gcc/x86_64-linux-gnu/7/include/smmintrin.h:32,
                 from /usr/lib/gcc/x86_64-linux-gnu/7/include/nmmintrin.h:31,
                 from src/vector_filter.h:16,
                 from src/bwamem.c:18:
/usr/lib/gcc/x86_64-linux-gnu/7/include/emmintrin.h:58:91: error: expected ‘)’ before ‘(’ token
 typedef double __m128d_u __attribute__ ((__vector_size__ (16), __may_alias__, __aligned__ (1)));
                                                                                           ^
/usr/lib/gcc/x86_64-linux-gnu/7/include/emmintrin.h:58:91: error: expected ‘)’ before ‘(’ token
In file included from src/kstring.h:8:0,
                 from src/bwamem.c:11:
src/bwamem.c: In function ‘mem_opt_t* mem_opt_init()’:
src/malloc_wrap.h:28:36: warning: invalid conversion from ‘void*’ to ‘mem_opt_t*’ [-fpermissive]
 #  define calloc(n, s)  wrap_calloc( (n), (s), __FILE__, __LINE__, __func__)
                         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:52:6: note: in expansion of macro ‘calloc’
  o = calloc(1, sizeof(mem_opt_t));
      ^~~~~~
src/bwamem.c: In function ‘smem_aux_t* smem_aux_init()’:
src/malloc_wrap.h:28:36: warning: invalid conversion from ‘void*’ to ‘smem_aux_t*’ [-fpermissive]
 #  define calloc(n, s)  wrap_calloc( (n), (s), __FILE__, __LINE__, __func__)
                         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:110:6: note: in expansion of macro ‘calloc’
  a = calloc(1, sizeof(smem_aux_t));
      ^~~~~~
src/malloc_wrap.h:28:36: warning: invalid conversion from ‘void*’ to ‘bwtintv_v*’ [-fpermissive]
 #  define calloc(n, s)  wrap_calloc( (n), (s), __FILE__, __LINE__, __func__)
                         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:111:15: note: in expansion of macro ‘calloc’
  a->tmpv[0] = calloc(1, sizeof(bwtintv_v));
               ^~~~~~
src/malloc_wrap.h:28:36: warning: invalid conversion from ‘void*’ to ‘bwtintv_v*’ [-fpermissive]
 #  define calloc(n, s)  wrap_calloc( (n), (s), __FILE__, __LINE__, __func__)
                         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:112:15: note: in expansion of macro ‘calloc’
  a->tmpv[1] = calloc(1, sizeof(bwtintv_v));
               ^~~~~~
src/bwamem.c: In function ‘void mem_collect_intv(mem_opt_t*, const bwt_t*, int, const uint8_t*, smem_aux_t*)’:
src/bwamem.c:202:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (i = 0; i < a->mem1.n; ++i) {
                ~~^~~~~~~~~~~
src/bwamem.c:217:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if (end - start < split_len || p->x[2] > opt->split_width)
                                   ~~~~~~~~^~~~~~~~~~~~~~~~~~
src/bwamem.c:220:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (i = 0; i < a->mem1.n; ++i)
                ~~^~~~~~~~~~~
src/bwamem.c:221:66: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if ((uint32_t) a->mem1.a[i].info - (a->mem1.a[i].info >> 32) >= opt->min_seed_len)
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
src/bwamem.c:236:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (i = 0; i < a->mem1.n; ++i)
                   ~~^~~~~~~~~~~
src/bwamem.c:164:26: warning: unused variable ‘max’ [-Wunused-variable]
  int i, k, x = 0, old_n, max, max_i;
                          ^~~
src/bwamem.c:164:31: warning: unused variable ‘max_i’ [-Wunused-variable]
  int i, k, x = 0, old_n, max, max_i;
                               ^~~~~
src/bwamem.c:167:6: warning: unused variable ‘min_miss_match’ [-Wunused-variable]
  int min_miss_match = 0;
      ^~~~~~~~~~~~~~
src/bwamem.c:168:19: warning: unused variable ‘w’ [-Wunused-variable]
  bwt_mem_width_t *w;
                   ^
In file included from src/kstring.h:8:0,
                 from src/bwamem.c:11:
src/bwamem.c: In function ‘int test_and_merge(const mem_opt_t*, int64_t, mem_chain_t*, const mem_seed_t*, int)’:
src/malloc_wrap.h:38:37: warning: invalid conversion from ‘void*’ to ‘mem_seed_t*’ [-fpermissive]
 #  define realloc(p, s) wrap_realloc((p), (s), __FILE__, __LINE__, __func__)
                         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:374:16: note: in expansion of macro ‘realloc’
     c->seeds = realloc(c->seeds, c->m * sizeof(mem_seed_t));
                ^~~~~~~
src/bwamem.c: In function ‘void mem_print_chain(const bntseq_t*, mem_chain_v*)’:
src/bwamem.c:409:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < chn->n; ++i) {
              ~~^~~~~~~~
src/bwamem.c: In function ‘mem_chain_v mem_chain(const mem_opt_t*, const bwt_t*, const bntseq_t*, int, const uint8_t*, void*)’:
src/bwamem.c:438:42: warning: invalid conversion from ‘const mem_opt_t*’ to ‘mem_opt_t*’ [-fpermissive]
  mem_collect_intv(opt, bwt, len, seq, aux);
                                          ^
src/bwamem.c:163:13: note:   initializing argument 1 of ‘void mem_collect_intv(mem_opt_t*, const bwt_t*, int, const uint8_t*, smem_aux_t*)’
 static void mem_collect_intv(mem_opt_t *opt, const bwt_t *bwt, int len, const uint8_t *seq, smem_aux_t *a) {
             ^~~~~~~~~~~~~~~~
src/bwamem.c:439:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0, b = e = l_rep = 0; i < aux->mem.n; ++i) { // compute frac_rep
                                 ~~^~~~~~~~~~~~
src/bwamem.c:442:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (p->x[2] <= opt->max_occ)
       ~~~~~~~~^~~~~~~~~~~~~~~
src/bwamem.c:450:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < aux->mem.n; ++i) {
              ~~^~~~~~~~~~~~
src/bwamem.c:455:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   step = p->x[2] > opt->max_occ ? p->x[2] / opt->max_occ : 1;
          ~~~~~~~~^~~~~~~~~~~~~~
src/bwamem.c:456:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (k = count = 0; k < p->x[2] && count < opt->max_occ; k += step, ++count) {
                       ~~^~~~~~~~~
In file included from src/kstring.h:8:0,
                 from src/bwamem.c:11:
src/malloc_wrap.h:28:36: warning: invalid conversion from ‘void*’ to ‘mem_seed_t*’ [-fpermissive]
 #  define calloc(n, s)  wrap_calloc( (n), (s), __FILE__, __LINE__, __func__)
                         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:476:17: note: in expansion of macro ‘calloc’
     tmp.seeds = calloc(tmp.m, sizeof(mem_seed_t));
                 ^~~~~~
src/bwamem.c:493:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < chain.n; ++i)
              ~~^~~~~~~~~
src/bwamem.c: In function ‘int mem_chain_flt(const mem_opt_t*, int, mem_chain_t*)’:
src/bwamem.c:536:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (k = 0; k < chains.n; ++k) {
                ~~^~~~~~~~~~
src/bwamem.c:555:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if (k == chains.n) {
        ~~^~~~~~~~~~~
src/bwamem.c:560:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (i = 0; i < chains.n; ++i) {
               ~~^~~~~~~~~~
src/bwamem.c: In function ‘void mem_mark_primary_se_core(const mem_opt_t*, int, mem_alnreg_t*, int_v*)’:
src/bwamem.c:717:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (k = 0; k < z->n; ++k) {
                ~~^~~~~~
src/bwamem.c:732:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if (k == z->n)
        ~~^~~~~~~
In file included from src/kstring.h:8:0,
                 from src/bwamem.c:11:
src/bwamem.c: In function ‘void mem_chain2aln(const mem_opt_t*, const bntseq_t*, const uint8_t*, int, const uint8_t*, const mem_chain_t*, mem_alnreg_v*, int*, int*, gpu_batch*)’:
src/malloc_wrap.h:33:36: warning: invalid conversion from ‘void*’ to ‘uint64_t* {aka long unsigned int*}’ [-fpermissive]
 #  define malloc(s)     wrap_malloc( (s),      __FILE__, __LINE__, __func__)
                         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:1087:8: note: in expansion of macro ‘malloc’
  srt = malloc(c->n * 8);
        ^~~~~~
src/bwamem.c:1098:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (i = 0; i < av->n; ++i)  // test whether extension has been made before
               ~~^~~~~~~
src/bwamem.c:1119:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (i < av->n)
       ~~^~~~~~~
src/bwamem.c:1226:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (curr_gpu_batch->n_target_batch < curr_gpu_batch->gpu_storage->host_max_target_batch_bytes)
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:1246:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if (curr_gpu_batch->n_seqs < curr_gpu_batch->gpu_storage->host_max_n_alns)
        ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:1253:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if (curr_gpu_batch->n_seqs < curr_gpu_batch->gpu_storage->host_max_n_alns)
        ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:1260:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if (curr_gpu_batch->n_seqs < curr_gpu_batch->gpu_storage->host_max_n_alns)
        ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:1267:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if (curr_gpu_batch->n_seqs < curr_gpu_batch->gpu_storage->host_max_n_alns)
        ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:1211:8: warning: unused variable ‘j’ [-Wunused-variable]
    int j;
        ^
src/bwamem.c:1048:12: warning: unused variable ‘rid’ [-Wunused-variable]
  int i, k, rid, max_off[2], aw[2]; // aw: actual bandwidth used in extension
            ^~~
src/bwamem.c:1048:17: warning: unused variable ‘max_off’ [-Wunused-variable]
  int i, k, rid, max_off[2], aw[2]; // aw: actual bandwidth used in extension
                 ^~~~~~~
src/bwamem.c:1049:39: warning: unused variable ‘tmp’ [-Wunused-variable]
  int64_t l_pac = bns->l_pac, rmax[2], tmp, max = 0;
                                       ^~~
src/bwamem.c:1051:11: warning: unused variable ‘rseq’ [-Wunused-variable]
  uint8_t *rseq = NULL;
           ^~~~
src/bwamem.c: In function ‘void mem_aln2sam(const mem_opt_t*, const bntseq_t*, kstring_t*, bseq1_t*, int, const mem_aln_t*, int, const mem_aln_t*)’:
src/bwamem.c:1563:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (i = tmp; i < str->l; ++i) // replace TAB in the comment to SPACE
                       ~~^~~~~~~~
src/bwamem.c: In function ‘void mem_reg2sam(const mem_opt_t*, const bntseq_t*, const uint8_t*, bseq1_t*, mem_alnreg_v*, int, const mem_aln_t*)’:
src/bwamem.c:1621:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (k = l = 0; k < a->n; ++k) {
                     ~~^~~~~~
src/bwamem.c:1649:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (k = 0; k < aa.n; ++k)
                     ~~^~~~~~
src/bwamem.c:1651:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (k = 0; k < aa.n; ++k)
                     ~~^~~~~~
src/bwamem.c:1657:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (k = 0; k < a->n; ++k)
                     ~~^~~~~~
src/bwamem.c: In function ‘void mem_gasal_fill(gpu_batch*, int, int, char*, int)’:
src/bwamem.c:1679:54: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (gpu_batch_arr[gpu_batch_arr_idx].n_query_batch < gpu_batch_arr[gpu_batch_arr_idx].gpu_storage->host_max_query_batch_bytes)
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:1697:54: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (gpu_batch_arr[gpu_batch_arr_idx].n_query_batch < gpu_batch_arr[gpu_batch_arr_idx].gpu_storage->host_max_query_batch_bytes)
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c: In function ‘void mem_align1_core(const mem_opt_t*, const bwt_t*, const bntseq_t*, const uint8_t*, bseq1_t*, void*, int, int, mem_alnreg_v*, int, gasal_gpu_storage_v*)’:
src/bwamem.c:1803:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 for (i = 0; i < chn.n; ++i) {
                             ~~^~~~~~~
src/bwamem.c:1851:16: warning: unused variable ‘cur’ [-Wunused-variable]
     gpu_batch *cur = &gpu_batch_arr[gpu_batch_arr_idx];
                ^~~
src/bwamem.c:1857:132: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
                 fprintf(stderr, "Thread no. %d is here with internal batch size %d, regs.n %d \n", tid, internal_batch_size, regs.n);
                                                                                                                              ~~~~~~^
In file included from src/bntseq.h:31:0,
                 from src/bwamem.h:5,
                 from src/bwamem.c:12:
src/bwamem.c:1865:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             assert(kv_size(regs_vec) == batch_processed);
src/bwamem.c:1902:139: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
                     if (gpu_batch_arr[internal_batch_idx].no_extend == 1) fprintf(stderr, "I am here too as well with regs.n %d\n", regs.n);
                                                                                                                                     ~~~~~~^
src/bwamem.c:1903:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                     for(i = 0; i < regs.n; ++i){
                                ~~^~~~~~~~
src/bwamem.c:1923:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         for (i = 0; i < regs.n; ++i) {
                                     ~~^~~~~~~~
src/bwamem.c:1928:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                     for (i = 0; i < regs.n; ++i) {
                                 ~~^~~~~~~~
In file included from src/kstring.h:8:0,
                 from src/bwamem.c:11:
src/bwamem.c: In function ‘mem_aln_t mem_reg2aln(const mem_opt_t*, const bntseq_t*, const uint8_t*, int, const char*, const mem_alnreg_t*)’:
src/malloc_wrap.h:33:36: warning: invalid conversion from ‘void*’ to ‘uint8_t* {aka unsigned char*}’ [-fpermissive]
 #  define malloc(s)     wrap_malloc( (s),      __FILE__, __LINE__, __func__)
                         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:1970:13: note: in expansion of macro ‘malloc’
     query = malloc(l_query);
             ^~~~~~
src/malloc_wrap.h:38:37: warning: invalid conversion from ‘void*’ to ‘uint32_t* {aka unsigned int*}’ [-fpermissive]
 #  define realloc(p, s) wrap_realloc((p), (s), __FILE__, __LINE__, __func__)
                         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:2027:19: note: in expansion of macro ‘realloc’
         a.cigar = realloc(a.cigar, 4 * (a.n_cigar + 2) + l_MD);
                   ^~~~~~~
src/bwamem.c: In function ‘void mem_process_seqs(const mem_opt_t*, const bwt_t*, const bntseq_t*, const uint8_t*, int64_t, int, bseq1_t*, const mem_pestat_t*)’:
src/malloc_wrap.h:33:36: warning: invalid conversion from ‘void*’ to ‘mem_alnreg_v*’ [-fpermissive]
 #  define malloc(s)     wrap_malloc( (s),      __FILE__, __LINE__, __func__)
                         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:2104:14: note: in expansion of macro ‘malloc’
     w.regs = malloc(n * sizeof(mem_alnreg_v));
              ^~~~~~
src/malloc_wrap.h:33:36: warning: invalid conversion from ‘void*’ to ‘smem_aux_t**’ [-fpermissive]
 #  define malloc(s)     wrap_malloc( (s),      __FILE__, __LINE__, __func__)
                         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/bwamem.c:2112:13: note: in expansion of macro ‘malloc’
     w.aux = malloc(opt->n_threads * sizeof(smem_aux_t));
             ^~~~~~
src/bwamem.c:2116:80: warning: invalid conversion from ‘void (*)(void*, int, int, int, int, gasal_gpu_storage_v*)’ to ‘void (*)(void*, int, int, int, int)’ [-fpermissive]
     kt_for(opt->n_threads, worker1, &w, /*(opt->flag & MEM_F_PE) ? n >> 1 : */n); // find mapping positions
                                                                                ^
In file included from src/bwamem.c:12:0:
src/bwamem.h:197:14: note:   initializing argument 2 of ‘void kt_for(int, void (*)(void*, int, int, int, int), void*, int)’
  extern void kt_for(int n_threads, void (*func)(void*, int, int, int, int), void *data, int n);
              ^~~~~~
src/bwamem.c:2136:76: warning: invalid conversion from ‘void (*)(void*, int, int, int, int, gasal_gpu_storage_v*)’ to ‘void (*)(void*, int, int, int, int)’ [-fpermissive]
     kt_for(opt->n_threads, worker2, &w, (opt->flag & MEM_F_PE) ? n >> 1 : n); // generate alignment
                                                                            ^
In file included from src/bwamem.c:12:0:
src/bwamem.h:197:14: note:   initializing argument 2 of ‘void kt_for(int, void (*)(void*, int, int, int, int), void*, int)’
  extern void kt_for(int n_threads, void (*func)(void*, int, int, int, int), void *data, int n);
              ^~~~~~
make: *** [bwamem.o] Error 1

Here's some system info:

$ uname -a
Linux dgx01 4.15.0-130-generic #134-Ubuntu SMP Tue Jan 5 20:46:26 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) 
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Tue_Sep_15_19:10:02_PDT_2020
Cuda compilation tools, release 11.1, V11.1.74
Build cuda_11.1.TC455_06.29069683_0
bearwithdog commented 3 years ago

@dawe Hi,I have the same problem . Have a try gcc-4.8.5 which support c++11. I have compiled it successfully. good luck!

sflorescu commented 2 years ago

@dawe @bearwithdog Quite a late reply to the both of you but I am currently working on this project and I fixed this issue that arises with newer G++ versions due to the newer C++ standards. In order to compile with newer G++versions you need to change in the vector_filter.h and popcount.h how the aligned memory is defined. Currently it has the following structure:

#ifndef __aligned__ #define __aligned__ __attribute__((aligned(16))) #endif

You need to change it to something like this since the double undescore in newer C++ standards is reserved for the compiler's internal use: #ifndef align_16 #define align_16 __attribute__((aligned(16))) #endif

Also you will have to change in bwamem.c every instance where memory is aligned to the new definition.

duronxx commented 1 year ago

@dawe @bearwithdog Quite a late reply to the both of you but I am currently working on this project and I fixed this issue that arises with newer G++ versions due to the newer C++ standards. In order to compile with newer G++versions you need to change in the vector_filter.h and popcount.h how the aligned memory is defined. Currently it has the following structure:

#ifndef __aligned__ #define __aligned__ __attribute__((aligned(16))) #endif

You need to change it to something like this since the double undescore in newer C++ standards is reserved for the compiler's internal use: #ifndef align_16 #define align_16 __attribute__((aligned(16))) #endif

Also you will have to change in bwamem.c every instance where memory is aligned to the new definition.

After following your instructions, the compilation was successful. However, when I tried to compare it, an error occurred. I have tried multiple times to test it, but still couldn't fix it. Could you please tell me how to fix it? Thank you very much. ./bwa-gasal2 gase_aln -t 4 -l 150 /data/home/cuda/bwa-gasal2/hg19.fasta /data/Sample_D1M1SY03221122MaReCs102BTCF10ZCL_1/D1M1SY03221122MaReCs102BTCF10ZCL_1_S62_R1_001.fastq.gz >t2.log Found 1 GPUs GPU 0: NVIDIA GeForce RTX 3090 Selected device 0 : NVIDIA GeForce RTX 3090 [M::bwa_idx_load_from_disk] read 0 ALT contigs [M::process] read 727274 sequences (40000070 bp)... [M::process] read 727274 sequences (40000070 bp)... [M::mem_process_seqs] Processed 727274 reads in 92.257 CPU sec, 23.689 real sec [M::process] read 727274 sequences (40000070 bp)... [M::mem_process_seqs] Processed 727274 reads in 82.475 CPU sec, 20.498 real sec [M::process] read 727274 sequences (40000070 bp)... bwa-gasal2: src/bwamem.c:2039: mem_aln_t mem_reg2aln(const mem_opt_t, const bntseq_t, const uint8_t, int, const char, const mem_alnreg_t*): Assertion `a.rid == ar->rid' failed. Aborted (core dumped)

sflorescu commented 1 year ago

@dawe @bearwithdog Quite a late reply to the both of you but I am currently working on this project and I fixed this issue that arises with newer G++ versions due to the newer C++ standards. In order to compile with newer G++versions you need to change in the vector_filter.h and popcount.h how the aligned memory is defined. Currently it has the following structure: #ifndef __aligned__ #define __aligned__ __attribute__((aligned(16))) #endif You need to change it to something like this since the double undescore in newer C++ standards is reserved for the compiler's internal use: #ifndef align_16 #define align_16 __attribute__((aligned(16))) #endif Also you will have to change in bwamem.c every instance where memory is aligned to the new definition.

After following your instructions, the compilation was successful. However, when I tried to compare it, an error occurred. I have tried multiple times to test it, but still couldn't fix it. Could you please tell me how to fix it? Thank you very much. ./bwa-gasal2 gase_aln -t 4 -l 150 /data/home/cuda/bwa-gasal2/hg19.fasta /data/Sample_D1M1SY03221122MaReCs102BTCF10ZCL_1/D1M1SY03221122MaReCs102BTCF10ZCL_1_S62_R1_001.fastq.gz >t2.log Found 1 GPUs GPU 0: NVIDIA GeForce RTX 3090 Selected device 0 : NVIDIA GeForce RTX 3090 [M::bwa_idx_load_from_disk] read 0 ALT contigs [M::process] read 727274 sequences (40000070 bp)... [M::process] read 727274 sequences (40000070 bp)... [M::mem_process_seqs] Processed 727274 reads in 92.257 CPU sec, 23.689 real sec [M::process] read 727274 sequences (40000070 bp)... [M::mem_process_seqs] Processed 727274 reads in 82.475 CPU sec, 20.498 real sec [M::process] read 727274 sequences (40000070 bp)... bwa-gasal2: src/bwamem.c:2039: mem_aln_t mem_reg2aln(const mem_opt_t, const bntseq_t, const uint8_t, int, const char, const mem_alnreg_t*): Assertion `a.rid == ar->rid' failed. Aborted (core dumped)

I am not sure what this error is I never really encountered it. I only used "left-right-align" branch in my other project and that seemed to work for me.