You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all!
I am using the C API of tskit, specifically employing the tables functions. I am trying to compile tables.c but I am getting an error on compilation. I am using the 0.99.15 release. Here is a capture of what I am getting:
[wmawass@fusion tskit]$ gcc -I/home/wmawass/tskit/c -I/home/wmawass/kastore/c -c tables.c
tables.c: In function ‘tsk_table_sorter_sort_edges’:
tables.c:5937:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘node_time’
const double *restrict node_time = self->tables->nodes.time;
^
tables.c:5937:28: error: ‘node_time’ undeclared (first use in this function)
tables.c:5937:28: note: each undeclared identifier is reported only once for each function it appears in
tables.c: In function ‘tsk_ibd_finder_init_samples_from_nodes’:
tables.c:7726:33: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘flags’
const tsk_flags_t *restrict flags = self->tables->nodes.flags;
^
tables.c:7726:33: error: ‘flags’ undeclared (first use in this function)
tables.c: In function ‘tsk_table_collection_check_tree_integrity’:
tables.c:9732:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘site_position’
const double *restrict site_position = self->sites.position;
^
tables.c:9732:28: error: ‘site_position’ undeclared (first use in this function)
tables.c:9733:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘mutation_site’
const tsk_id_t *restrict mutation_site = self->mutations.site;
^
tables.c:9733:30: error: ‘mutation_site’ undeclared (first use in this function)
tables.c:9734:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘mutation_node’
const tsk_id_t *restrict mutation_node = self->mutations.node;
^
tables.c:9734:30: error: ‘mutation_node’ undeclared (first use in this function)
tables.c:9735:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘mutation_time’
const double *restrict mutation_time = self->mutations.time;
^
tables.c:9735:28: error: ‘mutation_time’ undeclared (first use in this function)
tables.c:9736:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘node_time’
const double *restrict node_time = self->nodes.time;
^
tables.c:9736:28: error: ‘node_time’ undeclared (first use in this function)
tables.c:9737:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘I’
const tsk_id_t *restrict I = self->indexes.edge_insertion_order;
^
tables.c:9737:30: error: ‘I’ undeclared (first use in this function)
tables.c:9738:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘O’
const tsk_id_t *restrict O = self->indexes.edge_removal_order;
^
tables.c:9738:30: error: ‘O’ undeclared (first use in this function)
tables.c:9739:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘edge_right’
const double *restrict edge_right = self->edges.right;
^
tables.c:9739:28: error: ‘edge_right’ undeclared (first use in this function)
tables.c:9740:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘edge_left’
const double *restrict edge_left = self->edges.left;
^
tables.c:9740:28: error: ‘edge_left’ undeclared (first use in this function)
tables.c:9741:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘edge_child’
const tsk_id_t *restrict edge_child = self->edges.child;
^
tables.c:9741:30: error: ‘edge_child’ undeclared (first use in this function)
tables.c:9742:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘edge_parent’
const tsk_id_t *restrict edge_parent = self->edges.parent;
^
tables.c:9742:30: error: ‘edge_parent’ undeclared (first use in this function)
tables.c:9743:24: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘parent’
tsk_id_t *restrict parent = NULL;
^
tables.c:9743:24: error: ‘parent’ undeclared (first use in this function)
tables.c: In function ‘tsk_table_collection_compute_mutation_times’:
tables.c:11261:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘I’
const tsk_id_t *restrict I = self->indexes.edge_insertion_order;
^
tables.c:11261:30: error: ‘I’ undeclared (first use in this function)
tables.c:11262:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘O’
const tsk_id_t *restrict O = self->indexes.edge_removal_order;
^
tables.c:11262:30: error: ‘O’ undeclared (first use in this function)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Hi @mawassw 👋
I suspect you need to tell gcc that this is c99, try using
-std=c99.If this doesn't work, can you give us more info about your gcc version, platform etc?