Btree error on openmv build

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
skylin008
Posts: 62
Joined: Wed Mar 11, 2015 6:21 am

Btree error on openmv build

Post by skylin008 » Thu Mar 19, 2020 12:32 pm

Hello, everyone! I git clone the openmv source from https://github.com/openmv/openmv.git,but when build,any erros as show:
In file included from ../../extmod/modbtree.c:37:0:
../../lib/berkeley-db-1.xx/PORT/include/db.h:1:1: error: expected identifier or '(' before '.' token
../../include/db.h
^
In file included from ../../extmod/modbtree.c:38:0:
../../lib/berkeley-db-1.xx/PORT/include/../../btree/btree.h:89:3: error: data definition has no type or storage class [-Werror]
} PAGE;
^~~~
../../lib/berkeley-db-1.xx/PORT/include/../../btree/btree.h:89:3: error: type defaults to 'int' in declaration of 'PAGE' [-Werror=implicit-int]
../../lib/berkeley-db-1.xx/PORT/include/../../btree/btree.h:127:2: error: unknown type name 'pgno_t'
pgno_t pgno; /* page number stored on */
^~~~~~
../../lib/berkeley-db-1.xx/PORT/include/../../btree/btree.h:157:2: error: unknown type name 'recno_t'
recno_t nrecs; /* number of records */
^~~~~~~
../../lib/berkeley-db-1.xx/PORT/include/../../btree/btree.h:158:2: error: unknown type name 'pgno_t'
pgno_t pgno; /* page number stored below */
^~~~~~
../../lib/berkeley-db-1.xx/PORT/include/../../btree/btree.h:247:2: error: unknown type name 'pgno_t'
pgno_t pgno; /* the page number */
^~~~~~
../../lib/berkeley-db-1.xx/PORT/include/../../btree/btree.h:248:2: error: unknown type name 'indx_t'
indx_t index; /* the index on the page */
^~~~~~
../../lib/berkeley-db-1.xx/PORT/include/../../btree/btree.h:252:2: error: expected specifier-qualifier-list before 'PAGE'
PAGE *page; /* the (pinned) page */
^~~~
../../lib/berkeley-db-1.xx/PORT/include/../../btree/btree.h:282:2: error: unknown type name 'DBT'
DBT key; /* B: Saved key, or key.data == NULL. */
^~~
../../lib/berkeley-db-1.xx/PORT/include/../../btree/btree.h:283:2: error: unknown type name 'recno_t'
recno_t rcursor; /* R: recno cursor (1-based) */
^~~~~~~
../../lib/berkeley-db-1.xx/PORT/include/../../btree/btree.h:310:2: error: unknown type name 'MPOOL'
MPOOL *bt_mp; /* memory pool cookie */
^~~~~
../../lib/berkeley-db-1.xx/PORT/include/../../btree/btree.h:312:2: error: unknown type name 'DB'
DB *bt_dbp; /* pointer to enclosing DB */
^~
../../lib/berkeley-db-1.xx/PORT/include/../../btree/btree.h:315:2: error: expected specifier-qualifier-list before 'PAGE'
PAGE *bt_pinned; /* page pinned across calls */
^~~~
In file included from /usr/arm-none-eabi/include/stdio.h:35:0,
from ../../extmod/modbtree.c:27:
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:36:22: error: unknown type name 'DB'
int __bt_close __P((DB *));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:37:35: error: unknown type name 'DBT'
int __bt_cmp __P((BTREE *, const DBT *, EPG *));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:39:29: error: unknown type name 'DBT'
int __bt_defcmp __P((const DBT *, const DBT *));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:39:42: error: unknown type name 'DBT'
int __bt_defcmp __P((const DBT *, const DBT *));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:40:32: error: unknown type name 'DBT'
size_t __bt_defpfx __P((const DBT *, const DBT *));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:40:45: error: unknown type name 'DBT'
size_t __bt_defpfx __P((const DBT *, const DBT *));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:41:29: error: unknown type name 'DB'
int __bt_delete __P((const DB *, const DBT *, u_int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:41:41: error: unknown type name 'DBT'
int __bt_delete __P((const DB *, const DBT *, u_int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:42:37: error: unknown type name 'DBT'
int __bt_dleaf __P((BTREE *, const DBT *, PAGE *, u_int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:42:44: error: expected declaration specifiers or '...' before 'PAGE'
int __bt_dleaf __P((BTREE *, const DBT *, PAGE *, u_int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:43:25: error: unknown type name 'DB'
int __bt_fd __P((const DB *));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:44:30: error: expected declaration specifiers or '...' before 'PAGE'
int __bt_free __P((BTREE *, PAGE *));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:45:26: error: unknown type name 'DB'
int __bt_get __P((const DB *, const DBT *, DBT *, u_int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:45:38: error: unknown type name 'DBT'
int __bt_get __P((const DB *, const DBT *, DBT *, u_int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:45:45: error: unknown type name 'DBT'; did you mean 'DWT'?
int __bt_get __P((const DB *, const DBT *, DBT *, u_int));
^
In file included from ../../lib/berkeley-db-1.xx/PORT/include/../../btree/btree.h:388:0,
from ../../extmod/modbtree.c:38:
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:46:1: error: unknown type name 'PAGE'
PAGE *__bt_new __P((BTREE *, pgno_t *));
^~~~
In file included from /usr/arm-none-eabi/include/stdio.h:35:0,
from ../../extmod/modbtree.c:27:
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:46:30: error: unknown type name 'pgno_t'; did you mean 'ino_t'?
PAGE *__bt_new __P((BTREE *, pgno_t *));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:47:30: error: unknown type name 'pgno_t'; did you mean 'ino_t'?
void __bt_pgin __P((void *, pgno_t, void *));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:48:31: error: unknown type name 'pgno_t'; did you mean 'ino_t'?
void __bt_pgout __P((void *, pgno_t, void *));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:49:30: error: unknown type name 'pgno_t'; did you mean 'ino_t'?
int __bt_push __P((BTREE *, pgno_t, int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:50:26: error: unknown type name 'DB'
int __bt_put __P((const DB *dbp, DBT *, const DBT *, u_int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:50:35: error: unknown type name 'DBT'; did you mean 'DWT'?
int __bt_put __P((const DB *dbp, DBT *, const DBT *, u_int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:50:48: error: unknown type name 'DBT'
int __bt_put __P((const DB *dbp, DBT *, const DBT *, u_int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:51:36: error: unknown type name 'DBT'; did you mean 'DWT'?
int __bt_ret __P((BTREE *, EPG *, DBT *, DBT *, DBT *, DBT *, int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:51:43: error: unknown type name 'DBT'; did you mean 'DWT'?
int __bt_ret __P((BTREE *, EPG *, DBT *, DBT *, DBT *, DBT *, int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:51:50: error: unknown type name 'DBT'; did you mean 'DWT'?
int __bt_ret __P((BTREE *, EPG *, DBT *, DBT *, DBT *, DBT *, int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:51:57: error: unknown type name 'DBT'; did you mean 'DWT'?
int __bt_ret __P((BTREE *, EPG *, DBT *, DBT *, DBT *, DBT *, int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:52:38: error: unknown type name 'DBT'
EPG *__bt_search __P((BTREE *, const DBT *, int *));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:53:26: error: unknown type name 'DB'
int __bt_seq __P((const DB *, DBT *, DBT *, u_int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:53:32: error: unknown type name 'DBT'; did you mean 'DWT'?
int __bt_seq __P((const DB *, DBT *, DBT *, u_int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:53:39: error: unknown type name 'DBT'; did you mean 'DWT'?
int __bt_seq __P((const DB *, DBT *, DBT *, u_int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:54:33: error: unknown type name 'pgno_t'; did you mean 'ino_t'?
void __bt_setcur __P((BTREE *, pgno_t, u_int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:55:31: error: expected declaration specifiers or '...' before 'PAGE'
int __bt_split __P((BTREE *, PAGE *,
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:56:12: error: unknown type name 'DBT'
const DBT *, const DBT *, int, size_t, u_int32_t));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:56:25: error: unknown type name 'DBT'
const DBT *, const DBT *, int, size_t, u_int32_t));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:57:27: error: unknown type name 'DB'
int __bt_sync __P((const DB *, u_int));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:61:37: error: unknown type name 'DBT'
int __ovfl_put __P((BTREE *, const DBT *, pgno_t *));
^
../../lib/berkeley-db-1.xx/PORT/include/../../btree/extern.h:61:44: error: unknown type name 'pgno_t'; did you mean 'ino_t'?
int __ovfl_put __P((BTREE *, const DBT *, pgno_t *));
^
../../extmod/modbtree.c:42:5: error: unknown type name 'DB'
DB *db;
^~
../../extmod/modbtree.c:64:16: error: unknown type name 'DB'
void __dbpanic(DB *db) {
^~
../../extmod/modbtree.c:68:34: error: unknown type name 'DB'
STATIC mp_obj_btree_t *btree_new(DB *db) {
^~
In file included from /home/phonelink/Desktop/openmv/src/micropython/py/mpstate.h:35:0,
from /home/phonelink/Desktop/openmv/src/micropython/py/runtime.h:29,
from ../../extmod/modbtree.c:32:
../../extmod/modbtree.c: In function 'btree_close':
../../extmod/modbtree.c:92:33: error: implicit declaration of function '__bt_close'; did you mean '__bt_delete'? [-Werror=implicit-function-declaration]
return MP_OBJ_NEW_SMALL_INT(__bt_close(self->db));
^
/home/phonelink/Desktop/openmv/src/micropython/py/obj.h:87:67: note: in definition of macro 'MP_OBJ_NEW_SMALL_INT'
#define MP_OBJ_NEW_SMALL_INT(small_int) ((mp_obj_t)((((mp_uint_t)(small_int)) << 1) | 1))
^~~~~~~~~
../../extmod/modbtree.c: In function 'btree_put':
../../extmod/modbtree.c:99:5: error: unknown type name 'DBT'; did you mean 'DWT'?
DBT key, val;
^~~
DWT
../../extmod/modbtree.c:100:8: error: request for member 'data' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(args[1], &key.size);
^
../../extmod/modbtree.c:100:56: error: request for member 'size' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(args[1], &key.size);
^
../../extmod/modbtree.c:101:8: error: request for member 'data' in something not a structure or union
val.data = (void*)mp_obj_str_get_data(args[2], &val.size);
^
../../extmod/modbtree.c:101:56: error: request for member 'size' in something not a structure or union
val.data = (void*)mp_obj_str_get_data(args[2], &val.size);
^
In file included from /home/phonelink/Desktop/openmv/src/micropython/py/mpstate.h:35:0,
from /home/phonelink/Desktop/openmv/src/micropython/py/runtime.h:29,
from ../../extmod/modbtree.c:32:
../../extmod/modbtree.c:102:33: error: implicit declaration of function '__bt_put'; did you mean '__bt_fd'? [-Werror=implicit-function-declaration]
return MP_OBJ_NEW_SMALL_INT(__bt_put(self->db, &key, &val, 0));
^
/home/phonelink/Desktop/openmv/src/micropython/py/obj.h:87:67: note: in definition of macro 'MP_OBJ_NEW_SMALL_INT'
#define MP_OBJ_NEW_SMALL_INT(small_int) ((mp_obj_t)((((mp_uint_t)(small_int)) << 1) | 1))
^~~~~~~~~
../../extmod/modbtree.c: In function 'btree_get':
../../extmod/modbtree.c:108:5: error: unknown type name 'DBT'; did you mean 'DWT'?
DBT key, val;
^~~
DWT
../../extmod/modbtree.c:109:8: error: request for member 'data' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(args[1], &key.size);
^
../../extmod/modbtree.c:109:56: error: request for member 'size' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(args[1], &key.size);
^
../../extmod/modbtree.c:110:15: error: implicit declaration of function '__bt_get'; did you mean '__bt_fd'? [-Werror=implicit-function-declaration]
int res = __bt_get(self->db, &key, &val, 0);
^~~~~~~~
__bt_fd
../../extmod/modbtree.c:111:16: error: 'RET_SPECIAL' undeclared (first use in this function)
if (res == RET_SPECIAL) {
^~~~~~~~~~~
../../extmod/modbtree.c:111:16: note: each undeclared identifier is reported only once for each function it appears in
../../extmod/modbtree.c:60:20: error: 'RET_ERROR' undeclared (first use in this function); did you mean 'URB_ERROR'?
if (res == RET_ERROR) { \
^
../../extmod/modbtree.c:118:5: note: in expansion of macro 'CHECK_ERROR'
CHECK_ERROR(res);
^~~~~~~~~~~
../../extmod/modbtree.c:119:32: error: request for member 'data' in something not a structure or union
return mp_obj_new_bytes(val.data, val.size);
^
../../extmod/modbtree.c:119:42: error: request for member 'size' in something not a structure or union
return mp_obj_new_bytes(val.data, val.size);
^
../../extmod/modbtree.c: In function 'btree_seq':
../../extmod/modbtree.c:126:5: error: unknown type name 'DBT'; did you mean 'DWT'?
DBT key, val;
^~~
DWT
../../extmod/modbtree.c:128:12: error: request for member 'data' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(args[2], &key.size);
^
../../extmod/modbtree.c:128:60: error: request for member 'size' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(args[2], &key.size);
^
../../extmod/modbtree.c:131:15: error: implicit declaration of function '__bt_seq'; did you mean '__bt_sync'? [-Werror=implicit-function-declaration]
int res = __bt_seq(self->db, &key, &val, flags);
^~~~~~~~
__bt_sync
../../extmod/modbtree.c:60:20: error: 'RET_ERROR' undeclared (first use in this function); did you mean 'URB_ERROR'?
if (res == RET_ERROR) { \
^
../../extmod/modbtree.c:132:5: note: in expansion of macro 'CHECK_ERROR'
CHECK_ERROR(res);
^~~~~~~~~~~
../../extmod/modbtree.c:133:16: error: 'RET_SPECIAL' undeclared (first use in this function)
if (res == RET_SPECIAL) {
^~~~~~~~~~~
../../extmod/modbtree.c:139:42: error: request for member 'data' in something not a structure or union
pair->items[0] = mp_obj_new_bytes(key.data, key.size);
^
../../extmod/modbtree.c:139:52: error: request for member 'size' in something not a structure or union
pair->items[0] = mp_obj_new_bytes(key.data, key.size);
^
../../extmod/modbtree.c:140:42: error: request for member 'data' in something not a structure or union
pair->items[1] = mp_obj_new_bytes(val.data, val.size);
^
../../extmod/modbtree.c:140:52: error: request for member 'size' in something not a structure or union
pair->items[1] = mp_obj_new_bytes(val.data, val.size);
^
../../extmod/modbtree.c: In function 'btree_iternext':
../../extmod/modbtree.c:197:5: error: unknown type name 'DBT'; did you mean 'DWT'?
DBT key, val;
^~~
DWT
../../extmod/modbtree.c:201:21: error: 'R_FIRST' undeclared (first use in this function)
int flags = R_FIRST;
^~~~~~~
../../extmod/modbtree.c:203:16: error: request for member 'data' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(self->start_key, &key.size);
^
../../extmod/modbtree.c:203:72: error: request for member 'size' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(self->start_key, &key.size);
^
../../extmod/modbtree.c:204:21: error: 'R_CURSOR' undeclared (first use in this function); did you mean 'CURSOR'?
flags = R_CURSOR;
^~~~~~~~
CURSOR
../../extmod/modbtree.c:206:21: error: 'R_LAST' undeclared (first use in this function); did you mean 'R_FIRST'?
flags = R_LAST;
^~~~~~
R_FIRST
../../extmod/modbtree.c:211:53: error: 'R_PREV' undeclared (first use in this function); did you mean '__REV'?
res = __bt_seq(self->db, &key, &val, desc ? R_PREV : R_NEXT);
^~~~~~
__REV
../../extmod/modbtree.c:211:62: error: 'R_NEXT' undeclared (first use in this function); did you mean 'R_LAST'?
res = __bt_seq(self->db, &key, &val, desc ? R_PREV : R_NEXT);
^~~~~~
R_LAST
../../extmod/modbtree.c:214:16: error: 'RET_SPECIAL' undeclared (first use in this function)
if (res == RET_SPECIAL) {
^~~~~~~~~~~
../../extmod/modbtree.c:60:20: error: 'RET_ERROR' undeclared (first use in this function); did you mean 'URB_ERROR'?
if (res == RET_ERROR) { \
^
../../extmod/modbtree.c:217:5: note: in expansion of macro 'CHECK_ERROR'
CHECK_ERROR(res);
^~~~~~~~~~~
../../extmod/modbtree.c:220:9: error: unknown type name 'DBT'; did you mean 'DWT'?
DBT end_key;
^~~
DWT
../../extmod/modbtree.c:221:16: error: request for member 'data' in something not a structure or union
end_key.data = (void*)mp_obj_str_get_data(self->end_key, &end_key.size);
^
../../extmod/modbtree.c:221:74: error: request for member 'size' in something not a structure or union
end_key.data = (void*)mp_obj_str_get_data(self->end_key, &end_key.size);
^
../../extmod/modbtree.c:222:28: error: request for member 'internal' in something not a structure or union
BTREE *t = self->db->internal;
^~
../../extmod/modbtree.c:223:22: error: 'BTREE {aka struct _btree}' has no member named 'bt_cmp'; did you mean 'bt_mp'?
int cmp = t->bt_cmp(&key, &end_key);
^~~~~~
bt_mp
../../extmod/modbtree.c:238:40: error: request for member 'data' in something not a structure or union
return mp_obj_new_bytes(key.data, key.size);
^
../../extmod/modbtree.c:238:50: error: request for member 'size' in something not a structure or union
return mp_obj_new_bytes(key.data, key.size);
^
../../extmod/modbtree.c:240:40: error: request for member 'data' in something not a structure or union
return mp_obj_new_bytes(val.data, val.size);
^
../../extmod/modbtree.c:240:50: error: request for member 'size' in something not a structure or union
return mp_obj_new_bytes(val.data, val.size);
^
../../extmod/modbtree.c:244:50: error: request for member 'data' in something not a structure or union
pair->items[0] = mp_obj_new_bytes(key.data, key.size);
^
../../extmod/modbtree.c:244:60: error: request for member 'size' in something not a structure or union
pair->items[0] = mp_obj_new_bytes(key.data, key.size);
^
../../extmod/modbtree.c:245:50: error: request for member 'data' in something not a structure or union
pair->items[1] = mp_obj_new_bytes(val.data, val.size);
^
../../extmod/modbtree.c:245:60: error: request for member 'size' in something not a structure or union
pair->items[1] = mp_obj_new_bytes(val.data, val.size);
^
../../extmod/modbtree.c: In function 'btree_subscr':
../../extmod/modbtree.c:255:9: error: unknown type name 'DBT'; did you mean 'DWT'?
DBT key;
^~~
DWT
../../extmod/modbtree.c:256:12: error: request for member 'data' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(index, &key.size);
^
../../extmod/modbtree.c:256:58: error: request for member 'size' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(index, &key.size);
^
../../extmod/modbtree.c:258:20: error: 'RET_SPECIAL' undeclared (first use in this function)
if (res == RET_SPECIAL) {
^~~~~~~~~~~
../../extmod/modbtree.c:60:20: error: 'RET_ERROR' undeclared (first use in this function); did you mean 'URB_ERROR'?
if (res == RET_ERROR) { \
^
../../extmod/modbtree.c:261:9: note: in expansion of macro 'CHECK_ERROR'
CHECK_ERROR(res);
^~~~~~~~~~~
../../extmod/modbtree.c:265:9: error: unknown type name 'DBT'; did you mean 'DWT'?
DBT key, val;
^~~
DWT
../../extmod/modbtree.c:266:12: error: request for member 'data' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(index, &key.size);
^
../../extmod/modbtree.c:266:58: error: request for member 'size' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(index, &key.size);
^
../../extmod/modbtree.c:272:36: error: request for member 'data' in something not a structure or union
return mp_obj_new_bytes(val.data, val.size);
^
../../extmod/modbtree.c:272:46: error: request for member 'size' in something not a structure or union
return mp_obj_new_bytes(val.data, val.size);
^
../../extmod/modbtree.c:275:9: error: unknown type name 'DBT'; did you mean 'DWT'?
DBT key, val;
^~~
DWT
../../extmod/modbtree.c:276:12: error: request for member 'data' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(index, &key.size);
^
../../extmod/modbtree.c:276:58: error: request for member 'size' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(index, &key.size);
^
../../extmod/modbtree.c:277:12: error: request for member 'data' in something not a structure or union
val.data = (void*)mp_obj_str_get_data(value, &val.size);
^
../../extmod/modbtree.c:277:58: error: request for member 'size' in something not a structure or union
val.data = (void*)mp_obj_str_get_data(value, &val.size);
^
../../extmod/modbtree.c: In function 'btree_binary_op':
../../extmod/modbtree.c:288:13: error: unknown type name 'DBT'; did you mean 'DWT'?
DBT key, val;
^~~
DWT
../../extmod/modbtree.c:289:16: error: request for member 'data' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(rhs_in, &key.size);
^
../../extmod/modbtree.c:289:63: error: request for member 'size' in something not a structure or union
key.data = (void*)mp_obj_str_get_data(rhs_in, &key.size);
^
../../extmod/modbtree.c:60:20: error: 'RET_ERROR' undeclared (first use in this function); did you mean 'URB_ERROR'?
if (res == RET_ERROR) { \
^
../../extmod/modbtree.c:291:13: note: in expansion of macro 'CHECK_ERROR'
CHECK_ERROR(res);
^~~~~~~~~~~
../../extmod/modbtree.c:292:43: error: 'RET_SPECIAL' undeclared (first use in this function)
return mp_obj_new_bool(res != RET_SPECIAL);
^~~~~~~~~~~
../../extmod/modbtree.c: At top level:
../../extmod/modbtree.c:327:14: error: unknown type name 'FILEVTABLE'
STATIC const FILEVTABLE btree_stream_fvtable = {
^~~~~~~~~~
../../extmod/modbtree.c:328:5: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
mp_stream_posix_read,
^~~~~~~~~~~~~~~~~~~~
../../extmod/modbtree.c:328:5: note: (near initialization for 'btree_stream_fvtable')
../../extmod/modbtree.c:329:5: error: excess elements in scalar initializer [-Werror]
mp_stream_posix_write,
^~~~~~~~~~~~~~~~~~~~~
../../extmod/modbtree.c:329:5: note: (near initialization for 'btree_stream_fvtable')
../../extmod/modbtree.c:330:5: error: excess elements in scalar initializer [-Werror]
mp_stream_posix_lseek,
^~~~~~~~~~~~~~~~~~~~~
../../extmod/modbtree.c:330:5: note: (near initialization for 'btree_stream_fvtable')
../../extmod/modbtree.c:331:5: error: excess elements in scalar initializer [-Werror]
mp_stream_posix_fsync
^~~~~~~~~~~~~~~~~~~~~
../../extmod/modbtree.c:331:5: note: (near initialization for 'btree_stream_fvtable')
../../extmod/modbtree.c: In function 'mod_btree_open':
../../extmod/modbtree.c:354:5: error: unknown type name 'BTREEINFO'; did you mean 'BTREE'?
BTREEINFO openinfo = {0};
^~~~~~~~~
BTREE
../../extmod/modbtree.c:355:13: error: request for member 'flags' in something not a structure or union
openinfo.flags = args.flags.u_int;
^
../../extmod/modbtree.c:356:13: error: request for member 'cachesize' in something not a structure or union
openinfo.cachesize = args.cachesize.u_int;
^
../../extmod/modbtree.c:357:13: error: request for member 'psize' in something not a structure or union
openinfo.psize = args.pagesize.u_int;
^
../../extmod/modbtree.c:358:13: error: request for member 'minkeypage' in something not a structure or union
openinfo.minkeypage = args.minkeypage.u_int;
^
../../extmod/modbtree.c:360:5: error: unknown type name 'DB'
DB *db = __bt_open(MP_OBJ_TO_PTR(pos_args[0]), &btree_stream_fvtable, &openinfo, /*dflags*/0);
^~
../../extmod/modbtree.c:360:14: error: implicit declaration of function '__bt_open'; did you mean '__bt_sync'? [-Werror=implicit-function-declaration]
DB *db = __bt_open(MP_OBJ_TO_PTR(pos_args[0]), &btree_stream_fvtable, &openinfo, /*dflags*/0);
^~~~~~~~~
__bt_sync
../../extmod/modbtree.c:360:14: error: initialization makes pointer from integer without a cast [-Werror=int-conversion]
In file included from /home/phonelink/Desktop/openmv/src/micropython/py/mpstate.h:35:0,
from /home/phonelink/Desktop/openmv/src/micropython/py/runtime.h:29,
from ../../extmod/modbtree.c:32:
../../extmod/modbtree.c:364:28: error: implicit declaration of function 'btree_new'; did you mean 'btree_seq'? [-Werror=implicit-function-declaration]
return MP_OBJ_FROM_PTR(btree_new(db));
^
/home/phonelink/Desktop/openmv/src/micropython/py/obj.h:240:39: note: in definition of macro 'MP_OBJ_FROM_PTR'
#define MP_OBJ_FROM_PTR(p) ((mp_obj_t)p)
^
At top level:
../../extmod/modbtree.c:314:28: error: 'btree_type' defined but not used [-Werror=unused-const-variable=]
STATIC const mp_obj_type_t btree_type = {
^~~~~~~~~~
cc1: all warnings being treated as errors
../../py/mkrules.mk:47: recipe for target '/home/phonelink/Desktop/openmv/src/build/micropython/extmod/modbtree.o' failed
make[1]: *** [/home/phonelink/Desktop/openmv/src/build/micropython/extmod/modbtree.o] Error 1
Makefile:584: recipe for target 'FIRMWARE_OBJS' failed
make: *** [FIRMWARE_OBJS] Error 2

The gcc version is:gcc version 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] (GNU Tools for Arm Embedded Processors 7-2018-q3-update)

How to solve this issue?Thanks!

User avatar
jimmo
Posts: 1681
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Btree error on openmv build

Post by jimmo » Fri Mar 20, 2020 3:27 am

You might need to raise this as an issue on openmv -- the build process for openmv is based on MicroPython's but has some differences.

This might be explained by an older arm-none-eabi-gcc version? Do you have at least 8.x ?

User avatar
jimmo
Posts: 1681
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Btree error on openmv build

Post by jimmo » Fri Mar 20, 2020 3:28 am

Ah I just noticed that you've already raised the bug there -- always good to include a link in both places to avoid duplicated effort.

Looks like a pretty old gcc version?

Also worth checking that you've pulled all the submodules? git submodule update --init --recursive

skylin008
Posts: 62
Joined: Wed Mar 11, 2015 6:21 am

Re: Btree error on openmv build

Post by skylin008 » Fri Mar 20, 2020 6:53 am

Thank you jimmo.Yes, I had pult the submodule. The arm-none-eabi-gcc version is: gcc version 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] (GNU Tools for Arm Embedded Processors 7-2018-q3-update)

Post Reply