error when install Rhtslib

error 1:

cram/cram_io.c:57:19: fatal error: bzlib.h: No such file or directory
#include
^
compilation terminated.

Answer:

This is because the compiler can not find the bzlib.h.

edit file Rhtslib/src/htslib/Makefile.Rhtslib to add the path in the lines:

From: CFLAGS = -g -Wall -O2

To: CFLAGS = -g -Wall -O2 -I”path/to/your/include”

From: LDFLAGS =

To: LDFLAGS = -L”path/to/your/lib”

error 2:

test/test_view.c: In function ‘main’:
test/test_view.c:195:13: error: unknown type name ‘hts_reglist_t’
hts_reglist_t *reg_list = calloc(argc-(optind+1), sizeof(*reg_list));
^
In file included from /usr/include/string.h:633:0,
from test/test_view.c:31:
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:209:43: error: request for member ‘reg’ in something not a structure or union
if (strcmp(reg_list[j].reg, argv[i]) == 0)
^
test/test_view.c:212:42: error: request for member ‘reg’ in something not a structure or union
reg_list[reg_count++].reg = argv[i];
^
test/test_view.c:214:36: error: request for member ‘tid’ in something not a structure or union
reg_list[j].tid = HTS_IDX_START;
^
test/test_view.c:217:36: error: request for member ‘tid’ in something not a structure or union
reg_list[j].tid = HTS_IDX_NOCOOR;
^
test/test_view.c:226:36: error: request for member ‘tid’ in something not a structure or union
reg_list[j].tid = k;
^
test/test_view.c:227:36: error: request for member ‘min_beg’ in something not a structure or union
reg_list[j].min_beg = h->target_len[k];
^
test/test_view.c:228:36: error: request for member ‘max_end’ in something not a structure or union
reg_list[j].max_end = 0;
^
test/test_view.c:232:17: error: unknown type name ‘hts_reglist_t’
hts_reglist_t *r = &reg_list[j];
^
test/test_view.c:233:18: error: request for member ‘intervals’ in something not a structure or union
r->intervals = realloc(r->intervals, ++r->count * sizeof(*r->intervals));
^
test/test_view.c:233:41: error: request for member ‘intervals’ in something not a structure or union
r->intervals = realloc(r->intervals, ++r->count * sizeof(*r->intervals));
^
test/test_view.c:233:57: error: request for member ‘count’ in something not a structure or union
r->intervals = realloc(r->intervals, ++r->count * sizeof(*r->intervals));
^
test/test_view.c:233:76: error: request for member ‘intervals’ in something not a structure or union
r->intervals = realloc(r->intervals, ++r->count * sizeof(*r->intervals));
^
test/test_view.c:234:23: error: request for member ‘intervals’ in something not a structure or union
if (!r->intervals)
^
test/test_view.c:237:24: error: request for member ‘tid’ in something not a structure or union
end = r->tid >= 0 ? h->target_len[r->tid] : 0;
^
test/test_view.c:237:52: error: request for member ‘tid’ in something not a structure or union
end = r->tid >= 0 ? h->target_len[r->tid] : 0;
^
test/test_view.c:243:18: error: request for member ‘intervals’ in something not a structure or union
r->intervals[r->count-1].beg = beg-1; // BED syntax
^
test/test_view.c:243:31: error: request for member ‘count’ in something not a structure or union
r->intervals[r->count-1].beg = beg-1; // BED syntax
^
test/test_view.c:244:18: error: request for member ‘intervals’ in something not a structure or union
r->intervals[r->count-1].end = end;
^
test/test_view.c:244:31: error: request for member ‘count’ in something not a structure or union
r->intervals[r->count-1].end = end;
^
test/test_view.c:246:22: error: request for member ‘min_beg’ in something not a structure or union
if (r->min_beg > beg)
^
test/test_view.c:247:22: error: request for member ‘min_beg’ in something not a structure or union
r->min_beg = beg;
^
test/test_view.c:248:22: error: request for member ‘max_end’ in something not a structure or union
if (r->max_end < end) ^ test/test_view.c:249:22: error: request for member ‘max_end’ in something not a structure or union r->max_end = end;
^
test/test_view.c:252:13: error: unknown type name ‘hts_itr_multi_t’
hts_itr_multi_t *iter = sam_itr_regions(idx, h, reg_list, reg_count);

Answers:
This is dirty. To make it be installed, remove all the lines related to test in file Rhtslib/src/htslib/Makefile.Rhtslib

发表评论

电子邮件地址不会被公开。 必填项已用*标注