Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in setup.py #46

Open
hyunynim opened this issue Oct 20, 2020 · 5 comments
Open

Error in setup.py #46

hyunynim opened this issue Oct 20, 2020 · 5 comments

Comments

@hyunynim
Copy link

Thank you for your great working.
I get this error messge when i run setup.py

running build_ext
building 'im2mesh.utils.libkdtree.pykdtree.kdtree' extension
Emitting ninja build file /home/hongza/lab/differentiable_volumetric_rendering/build/temp.linux-x86_64-3.8/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/1] c++ -MMD -MF /home/hongza/lab/differentiable_volumetric_rendering/build/temp.linux-x86_64-3.8/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.o.d -pthread -B /home/hongza/.conda/envs/dvr/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/hongza/.conda/envs/dvr/lib/python3.8/site-packages/numpy/core/include -I/home/hongza/.conda/envs/dvr/include/python3.8 -c -c /home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c -o /home/hongza/lab/differentiable_volumetric_rendering/build/temp.linux-x86_64-3.8/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.o -std=c99 -O3 -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=kdtree -D_GLIBCXX_USE_CXX11_ABI=0
FAILED: /home/hongza/lab/differentiable_volumetric_rendering/build/temp.linux-x86_64-3.8/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.o 
c++ -MMD -MF /home/hongza/lab/differentiable_volumetric_rendering/build/temp.linux-x86_64-3.8/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.o.d -pthread -B /home/hongza/.conda/envs/dvr/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/hongza/.conda/envs/dvr/lib/python3.8/site-packages/numpy/core/include -I/home/hongza/.conda/envs/dvr/include/python3.8 -c -c /home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c -o /home/hongza/lab/differentiable_volumetric_rendering/build/temp.linux-x86_64-3.8/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.o -std=c99 -O3 -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=kdtree -D_GLIBCXX_USE_CXX11_ABI=0
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-std=c99’ is valid for C/ObjC but not for C++
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:49:3: error: conflicting declaration ‘typedef struct Node_float Node_float’
 } Node_float;
   ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: previous declaration as ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:70:3: error: conflicting declaration ‘typedef struct Node_double Node_double’
 } Node_double;
   ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: previous declaration as ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:95:40: error: expected ‘,’ or ‘...’ before ‘pa’
 void search_leaf_float(float *restrict pa, uint32_t *restrict pidx, int8_t no_dims, uint32_t start_idx, uint32_t n, float *restrict point_coord,
                                        ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:97:45: error: expected ‘,’ or ‘...’ before ‘pa’
 void search_leaf_float_mask(float *restrict pa, uint32_t *restrict pidx, int8_t no_dims, uint32_t start_idx, uint32_t n, float *restrict point_coord,
                                             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:119:42: error: expected ‘,’ or ‘...’ before ‘pa’
 void search_leaf_double(double *restrict pa, uint32_t *restrict pidx, int8_t no_dims, uint32_t start_idx, uint32_t n, double *restrict point_coord,
                                          ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:121:47: error: expected ‘,’ or ‘...’ before ‘pa’
 void search_leaf_double_mask(double *restrict pa, uint32_t *restrict pidx, int8_t no_dims, uint32_t start_idx, uint32_t n, double *restrict point_coord,
                                               ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: In function ‘Node_float* construct_subtree_float(float*, uint32_t*, int8_t, uint32_t, uint32_t, uint32_t, float*)’:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:346:13: error: invalid use of incomplete type ‘struct Node_float’
         root->cut_dim = -1;
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:355:17: error: invalid use of incomplete type ‘struct Node_float’
             root->cut_dim = -1;
                 ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:358:13: error: invalid use of incomplete type ‘struct Node_float’
         root->cut_val = cut_val;
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:359:13: error: invalid use of incomplete type ‘struct Node_float’
         root->cut_dim = cut_dim;
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:366:13: error: invalid use of incomplete type ‘struct Node_float’
         root->cut_bounds_lv = lv;
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:367:13: error: invalid use of incomplete type ‘struct Node_float’
         root->cut_bounds_hv = hv;
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:371:13: error: invalid use of incomplete type ‘struct Node_float’
         root->left_child = (struct Node_float *)construct_subtree_float(pa, pidx, no_dims, start_idx, n_lo, bsp, bbox);
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:376:13: error: invalid use of incomplete type ‘struct Node_float’
         root->right_child = (struct Node_float *)construct_subtree_float(pa, pidx, no_dims, start_idx + n_lo, n - n_lo, bsp, bbox);
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: In function ‘Node_float* create_node_float(uint32_t, uint32_t, int)’:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:433:58: error: invalid application of ‘sizeof’ to incomplete type ‘Node_float’
         new_node = (Node_float *)malloc(sizeof(Node_float) - 2 * sizeof(Node_float *));
                                                          ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:437:58: error: invalid application of ‘sizeof’ to incomplete type ‘Node_float’
         new_node = (Node_float *)malloc(sizeof(Node_float));
                                                          ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:439:13: error: invalid use of incomplete type ‘struct Node_float’
     new_node->n = n;
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:440:13: error: invalid use of incomplete type ‘struct Node_float’
     new_node->start_idx = start_idx;
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: In function ‘void delete_subtree_float(Node_float*)’:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:451:13: error: invalid use of incomplete type ‘struct Node_float’
     if (root->cut_dim != -1)
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:453:48: error: invalid use of incomplete type ‘struct Node_float’
         delete_subtree_float((Node_float *)root->left_child);
                                                ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:454:48: error: invalid use of incomplete type ‘struct Node_float’
         delete_subtree_float((Node_float *)root->right_child);
                                                ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: In function ‘void print_tree_float(Node_float*, int)’:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:482:48: error: invalid use of incomplete type ‘struct Node_float’
     printf("(cut_val: %f, cut_dim: %i)\n", root->cut_val, root->cut_dim);
                                                ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:482:63: error: invalid use of incomplete type ‘struct Node_float’
     printf("(cut_val: %f, cut_dim: %i)\n", root->cut_val, root->cut_dim);
                                                               ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:483:13: error: invalid use of incomplete type ‘struct Node_float’
     if (root->cut_dim != -1)
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:484:44: error: invalid use of incomplete type ‘struct Node_float’
         print_tree_float((Node_float *)root->left_child, level + 1);
                                            ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:485:13: error: invalid use of incomplete type ‘struct Node_float’
     if (root->cut_dim != -1)
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:486:44: error: invalid use of incomplete type ‘struct Node_float’
         print_tree_float((Node_float *)root->right_child, level + 1);
                                            ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: At global scope:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:569:40: error: expected ‘,’ or ‘...’ before ‘pa’
 void search_leaf_float(float *restrict pa, uint32_t *restrict pidx, int8_t no_dims, uint32_t start_idx, uint32_t n, float *restrict point_coord,
                                        ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: In function ‘void search_leaf_float(float*)’:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:575:21: error: ‘n’ was not declared in this scope
     for (i = 0; i < n; i++)
                     ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:20: error: ‘pa’ was not declared in this scope
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                    ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:578:37: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_float(&PA(start_idx + i, 0), point_coord, no_dims);
                                     ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:23: error: ‘no_dims’ was not declared in this scope
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                       ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:578:37: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_float(&PA(start_idx + i, 0), point_coord, no_dims);
                                     ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:33: error: ‘pidx’ was not declared in this scope
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                 ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:578:37: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_float(&PA(start_idx + i, 0), point_coord, no_dims);
                                     ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:33: note: suggested alternative: ‘pid_t’
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                 ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:578:37: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_float(&PA(start_idx + i, 0), point_coord, no_dims);
                                     ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:578:40: error: ‘start_idx’ was not declared in this scope
         cur_dist = calc_dist_float(&PA(start_idx + i, 0), point_coord, no_dims);
                                        ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:38: note: in definition of macro ‘PA’
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                      ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:578:40: note: suggested alternative: ‘strtold’
         cur_dist = calc_dist_float(&PA(start_idx + i, 0), point_coord, no_dims);
                                        ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:38: note: in definition of macro ‘PA’
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                      ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:578:59: error: ‘point_coord’ was not declared in this scope
         cur_dist = calc_dist_float(&PA(start_idx + i, 0), point_coord, no_dims);
                                                           ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:580:24: error: ‘closest_dist’ was not declared in this scope
         if (cur_dist < closest_dist[k - 1])
                        ^~~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:580:24: note: suggested alternative: ‘cur_dist’
         if (cur_dist < closest_dist[k - 1])
                        ^~~~~~~~~~~~
                        cur_dist
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:580:37: error: ‘k’ was not declared in this scope
         if (cur_dist < closest_dist[k - 1])
                                     ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:582:32: error: ‘closest_idx’ was not declared in this scope
             insert_point_float(closest_idx, closest_dist, pidx[start_idx + i], cur_dist, k);
                                ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: At global scope:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:601:45: error: expected ‘,’ or ‘...’ before ‘pa’
 void search_leaf_float_mask(float *restrict pa, uint32_t *restrict pidx, int8_t no_dims, uint32_t start_idx, uint32_t n, float *restrict point_coord,
                                             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: In function ‘void search_leaf_float_mask(float*)’:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:607:21: error: ‘n’ was not declared in this scope
     for (i = 0; i < n; i++)
                     ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:610:13: error: ‘mask’ was not declared in this scope
         if (mask[pidx[start_idx + i]])
             ^~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:610:18: error: ‘pidx’ was not declared in this scope
         if (mask[pidx[start_idx + i]])
                  ^~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:610:18: note: suggested alternative: ‘pid_t’
         if (mask[pidx[start_idx + i]])
                  ^~~~
                  pid_t
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:610:23: error: ‘start_idx’ was not declared in this scope
         if (mask[pidx[start_idx + i]])
                       ^~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:610:23: note: suggested alternative: ‘strtold’
         if (mask[pidx[start_idx + i]])
                       ^~~~~~~~~
                       strtold
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:20: error: ‘pa’ was not declared in this scope
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                    ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:615:37: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_float(&PA(start_idx + i, 0), point_coord, no_dims);
                                     ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:23: error: ‘no_dims’ was not declared in this scope
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                       ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:615:37: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_float(&PA(start_idx + i, 0), point_coord, no_dims);
                                     ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:33: error: ‘pidx’ was not declared in this scope
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                 ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:615:37: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_float(&PA(start_idx + i, 0), point_coord, no_dims);
                                     ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:33: note: suggested alternative: ‘pid_t’
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                 ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:615:37: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_float(&PA(start_idx + i, 0), point_coord, no_dims);
                                     ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:615:40: error: ‘start_idx’ was not declared in this scope
         cur_dist = calc_dist_float(&PA(start_idx + i, 0), point_coord, no_dims);
                                        ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:38: note: in definition of macro ‘PA’
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                      ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:615:40: note: suggested alternative: ‘strtold’
         cur_dist = calc_dist_float(&PA(start_idx + i, 0), point_coord, no_dims);
                                        ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:38: note: in definition of macro ‘PA’
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                      ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:615:59: error: ‘point_coord’ was not declared in this scope
         cur_dist = calc_dist_float(&PA(start_idx + i, 0), point_coord, no_dims);
                                                           ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:617:24: error: ‘closest_dist’ was not declared in this scope
         if (cur_dist < closest_dist[k - 1])
                        ^~~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:617:24: note: suggested alternative: ‘cur_dist’
         if (cur_dist < closest_dist[k - 1])
                        ^~~~~~~~~~~~
                        cur_dist
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:617:37: error: ‘k’ was not declared in this scope
         if (cur_dist < closest_dist[k - 1])
                                     ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:619:32: error: ‘closest_idx’ was not declared in this scope
             insert_point_float(closest_idx, closest_dist, pidx[start_idx + i], cur_dist, k);
                                ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: In function ‘void search_splitnode_float(Node_float*, float*, uint32_t*, int8_t, float*, float, uint32_t, float, float, uint8_t*, uint32_t*, float*)’:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:652:15: error: invalid use of incomplete type ‘struct Node_float’
     dim = root->cut_dim;
               ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:659:59: error: invalid use of incomplete type ‘struct Node_float’
             search_leaf_float_mask(pa, pidx, no_dims, root->start_idx, root->n, point_coord, k, mask, closest_idx, closest_dist);
                                                           ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:659:76: error: invalid use of incomplete type ‘struct Node_float’
             search_leaf_float_mask(pa, pidx, no_dims, root->start_idx, root->n, point_coord, k, mask, closest_idx, closest_dist);
                                                                            ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:663:54: error: invalid use of incomplete type ‘struct Node_float’
             search_leaf_float(pa, pidx, no_dims, root->start_idx, root->n, point_coord, k, closest_idx, closest_dist);
                                                      ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:663:71: error: invalid use of incomplete type ‘struct Node_float’
             search_leaf_float(pa, pidx, no_dims, root->start_idx, root->n, point_coord, k, closest_idx, closest_dist);
                                                                       ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:669:41: error: invalid use of incomplete type ‘struct Node_float’
     new_offset = point_coord[dim] - root->cut_val;
                                         ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:678:54: error: invalid use of incomplete type ‘struct Node_float’
             search_splitnode_float((Node_float *)root->left_child, pa, pidx, no_dims, point_coord, dist_left, k, distance_upper_bound, eps_fac, mask, closest_idx, closest_dist);
                                                      ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:684:24: error: invalid use of incomplete type ‘struct Node_float’
         box_diff = root->cut_bounds_lv - point_coord[dim];
                        ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:693:54: error: invalid use of incomplete type ‘struct Node_float’
             search_splitnode_float((Node_float *)root->right_child, pa, pidx, no_dims, point_coord, dist_right, k, distance_upper_bound, eps_fac, mask, closest_idx, closest_dist);
                                                      ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:703:54: error: invalid use of incomplete type ‘struct Node_float’
             search_splitnode_float((Node_float *)root->right_child, pa, pidx, no_dims, point_coord, dist_right, k, distance_upper_bound, eps_fac, mask, closest_idx, closest_dist);
                                                      ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:709:43: error: invalid use of incomplete type ‘struct Node_float’
         box_diff = point_coord[dim] - root->cut_bounds_hv;
                                           ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:718:54: error: invalid use of incomplete type ‘struct Node_float’
             search_splitnode_float((Node_float *)root->left_child, pa, pidx, no_dims, point_coord, dist_left, k, distance_upper_bound, eps_fac, mask, closest_idx, closest_dist);
                                                      ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:47:12: note: forward declaration of ‘struct Node_float’
     struct Node_float *left_child;
            ^~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: In function ‘Node_double* construct_subtree_double(double*, uint32_t*, int8_t, uint32_t, uint32_t, uint32_t, double*)’:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:990:13: error: invalid use of incomplete type ‘struct Node_double’
         root->cut_dim = -1;
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:999:17: error: invalid use of incomplete type ‘struct Node_double’
             root->cut_dim = -1;
                 ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1002:13: error: invalid use of incomplete type ‘struct Node_double’
         root->cut_val = cut_val;
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1003:13: error: invalid use of incomplete type ‘struct Node_double’
         root->cut_dim = cut_dim;
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1010:13: error: invalid use of incomplete type ‘struct Node_double’
         root->cut_bounds_lv = lv;
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1011:13: error: invalid use of incomplete type ‘struct Node_double’
         root->cut_bounds_hv = hv;
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1015:13: error: invalid use of incomplete type ‘struct Node_double’
         root->left_child = (struct Node_double *)construct_subtree_double(pa, pidx, no_dims, start_idx, n_lo, bsp, bbox);
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1020:13: error: invalid use of incomplete type ‘struct Node_double’
         root->right_child = (struct Node_double *)construct_subtree_double(pa, pidx, no_dims, start_idx + n_lo, n - n_lo, bsp, bbox);
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: In function ‘Node_double* create_node_double(uint32_t, uint32_t, int)’:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1077:60: error: invalid application of ‘sizeof’ to incomplete type ‘Node_double’
         new_node = (Node_double *)malloc(sizeof(Node_double) - 2 * sizeof(Node_double *));
                                                            ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1081:60: error: invalid application of ‘sizeof’ to incomplete type ‘Node_double’
         new_node = (Node_double *)malloc(sizeof(Node_double));
                                                            ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1083:13: error: invalid use of incomplete type ‘struct Node_double’
     new_node->n = n;
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1084:13: error: invalid use of incomplete type ‘struct Node_double’
     new_node->start_idx = start_idx;
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: In function ‘void delete_subtree_double(Node_double*)’:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1095:13: error: invalid use of incomplete type ‘struct Node_double’
     if (root->cut_dim != -1)
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1097:50: error: invalid use of incomplete type ‘struct Node_double’
         delete_subtree_double((Node_double *)root->left_child);
                                                  ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1098:50: error: invalid use of incomplete type ‘struct Node_double’
         delete_subtree_double((Node_double *)root->right_child);
                                                  ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: In function ‘void print_tree_double(Node_double*, int)’:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1126:48: error: invalid use of incomplete type ‘struct Node_double’
     printf("(cut_val: %f, cut_dim: %i)\n", root->cut_val, root->cut_dim);
                                                ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1126:63: error: invalid use of incomplete type ‘struct Node_double’
     printf("(cut_val: %f, cut_dim: %i)\n", root->cut_val, root->cut_dim);
                                                               ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1127:13: error: invalid use of incomplete type ‘struct Node_double’
     if (root->cut_dim != -1)
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1128:46: error: invalid use of incomplete type ‘struct Node_double’
         print_tree_double((Node_double *)root->left_child, level + 1);
                                              ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1129:13: error: invalid use of incomplete type ‘struct Node_double’
     if (root->cut_dim != -1)
             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1130:46: error: invalid use of incomplete type ‘struct Node_double’
         print_tree_double((Node_double *)root->right_child, level + 1);
                                              ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: At global scope:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1213:42: error: expected ‘,’ or ‘...’ before ‘pa’
 void search_leaf_double(double *restrict pa, uint32_t *restrict pidx, int8_t no_dims, uint32_t start_idx, uint32_t n, double *restrict point_coord,
                                          ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: In function ‘void search_leaf_double(double*)’:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1219:21: error: ‘n’ was not declared in this scope
     for (i = 0; i < n; i++)
                     ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:20: error: ‘pa’ was not declared in this scope
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                    ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1222:38: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_double(&PA(start_idx + i, 0), point_coord, no_dims);
                                      ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:23: error: ‘no_dims’ was not declared in this scope
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                       ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1222:38: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_double(&PA(start_idx + i, 0), point_coord, no_dims);
                                      ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:33: error: ‘pidx’ was not declared in this scope
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                 ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1222:38: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_double(&PA(start_idx + i, 0), point_coord, no_dims);
                                      ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:33: note: suggested alternative: ‘pid_t’
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                 ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1222:38: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_double(&PA(start_idx + i, 0), point_coord, no_dims);
                                      ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1222:41: error: ‘start_idx’ was not declared in this scope
         cur_dist = calc_dist_double(&PA(start_idx + i, 0), point_coord, no_dims);
                                         ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:38: note: in definition of macro ‘PA’
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                      ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1222:41: note: suggested alternative: ‘strtold’
         cur_dist = calc_dist_double(&PA(start_idx + i, 0), point_coord, no_dims);
                                         ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:38: note: in definition of macro ‘PA’
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                      ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1222:60: error: ‘point_coord’ was not declared in this scope
         cur_dist = calc_dist_double(&PA(start_idx + i, 0), point_coord, no_dims);
                                                            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1224:24: error: ‘closest_dist’ was not declared in this scope
         if (cur_dist < closest_dist[k - 1])
                        ^~~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1224:24: note: suggested alternative: ‘cur_dist’
         if (cur_dist < closest_dist[k - 1])
                        ^~~~~~~~~~~~
                        cur_dist
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1224:37: error: ‘k’ was not declared in this scope
         if (cur_dist < closest_dist[k - 1])
                                     ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1226:33: error: ‘closest_idx’ was not declared in this scope
             insert_point_double(closest_idx, closest_dist, pidx[start_idx + i], cur_dist, k);
                                 ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: At global scope:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1245:47: error: expected ‘,’ or ‘...’ before ‘pa’
 void search_leaf_double_mask(double *restrict pa, uint32_t *restrict pidx, int8_t no_dims, uint32_t start_idx, uint32_t n, double *restrict point_coord,
                                               ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: In function ‘void search_leaf_double_mask(double*)’:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1251:21: error: ‘n’ was not declared in this scope
     for (i = 0; i < n; i++)
                     ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1254:13: error: ‘mask’ was not declared in this scope
         if (mask[pidx[start_idx + i]])
             ^~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1254:18: error: ‘pidx’ was not declared in this scope
         if (mask[pidx[start_idx + i]])
                  ^~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1254:18: note: suggested alternative: ‘pid_t’
         if (mask[pidx[start_idx + i]])
                  ^~~~
                  pid_t
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1254:23: error: ‘start_idx’ was not declared in this scope
         if (mask[pidx[start_idx + i]])
                       ^~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1254:23: note: suggested alternative: ‘strtold’
         if (mask[pidx[start_idx + i]])
                       ^~~~~~~~~
                       strtold
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:20: error: ‘pa’ was not declared in this scope
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                    ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1259:38: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_double(&PA(start_idx + i, 0), point_coord, no_dims);
                                      ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:23: error: ‘no_dims’ was not declared in this scope
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                       ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1259:38: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_double(&PA(start_idx + i, 0), point_coord, no_dims);
                                      ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:33: error: ‘pidx’ was not declared in this scope
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                 ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1259:38: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_double(&PA(start_idx + i, 0), point_coord, no_dims);
                                      ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:33: note: suggested alternative: ‘pid_t’
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                 ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1259:38: note: in expansion of macro ‘PA’
         cur_dist = calc_dist_double(&PA(start_idx + i, 0), point_coord, no_dims);
                                      ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1259:41: error: ‘start_idx’ was not declared in this scope
         cur_dist = calc_dist_double(&PA(start_idx + i, 0), point_coord, no_dims);
                                         ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:38: note: in definition of macro ‘PA’
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                      ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1259:41: note: suggested alternative: ‘strtold’
         cur_dist = calc_dist_double(&PA(start_idx + i, 0), point_coord, no_dims);
                                         ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:31:38: note: in definition of macro ‘PA’
 #define PA(i,d)   (pa[no_dims * pidx[i] + d])
                                      ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1259:60: error: ‘point_coord’ was not declared in this scope
         cur_dist = calc_dist_double(&PA(start_idx + i, 0), point_coord, no_dims);
                                                            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1261:24: error: ‘closest_dist’ was not declared in this scope
         if (cur_dist < closest_dist[k - 1])
                        ^~~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1261:24: note: suggested alternative: ‘cur_dist’
         if (cur_dist < closest_dist[k - 1])
                        ^~~~~~~~~~~~
                        cur_dist
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1261:37: error: ‘k’ was not declared in this scope
         if (cur_dist < closest_dist[k - 1])
                                     ^
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1263:33: error: ‘closest_idx’ was not declared in this scope
             insert_point_double(closest_idx, closest_dist, pidx[start_idx + i], cur_dist, k);
                                 ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c: In function ‘void search_splitnode_double(Node_double*, double*, uint32_t*, int8_t, double*, double, uint32_t, double, double, uint8_t*, uint32_t*, double*)’:
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1296:15: error: invalid use of incomplete type ‘struct Node_double’
     dim = root->cut_dim;
               ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1303:60: error: invalid use of incomplete type ‘struct Node_double’
             search_leaf_double_mask(pa, pidx, no_dims, root->start_idx, root->n, point_coord, k, mask, closest_idx, closest_dist);
                                                            ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1303:77: error: invalid use of incomplete type ‘struct Node_double’
             search_leaf_double_mask(pa, pidx, no_dims, root->start_idx, root->n, point_coord, k, mask, closest_idx, closest_dist);
                                                                             ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1307:55: error: invalid use of incomplete type ‘struct Node_double’
             search_leaf_double(pa, pidx, no_dims, root->start_idx, root->n, point_coord, k, closest_idx, closest_dist);
                                                       ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1307:72: error: invalid use of incomplete type ‘struct Node_double’
             search_leaf_double(pa, pidx, no_dims, root->start_idx, root->n, point_coord, k, closest_idx, closest_dist);
                                                                        ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1313:41: error: invalid use of incomplete type ‘struct Node_double’
     new_offset = point_coord[dim] - root->cut_val;
                                         ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1322:56: error: invalid use of incomplete type ‘struct Node_double’
             search_splitnode_double((Node_double *)root->left_child, pa, pidx, no_dims, point_coord, dist_left, k, distance_upper_bound, eps_fac, mask, closest_idx, closest_dist);
                                                        ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1328:24: error: invalid use of incomplete type ‘struct Node_double’
         box_diff = root->cut_bounds_lv - point_coord[dim];
                        ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1337:56: error: invalid use of incomplete type ‘struct Node_double’
             search_splitnode_double((Node_double *)root->right_child, pa, pidx, no_dims, point_coord, dist_right, k, distance_upper_bound, eps_fac, mask, closest_idx, closest_dist);
                                                        ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1347:56: error: invalid use of incomplete type ‘struct Node_double’
             search_splitnode_double((Node_double *)root->right_child, pa, pidx, no_dims, point_coord, dist_right, k, distance_upper_bound, eps_fac, mask, closest_idx, closest_dist);
                                                        ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1353:43: error: invalid use of incomplete type ‘struct Node_double’
         box_diff = point_coord[dim] - root->cut_bounds_hv;
                                           ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:1362:56: error: invalid use of incomplete type ‘struct Node_double’
             search_splitnode_double((Node_double *)root->left_child, pa, pidx, no_dims, point_coord, dist_left, k, distance_upper_bound, eps_fac, mask, closest_idx, closest_dist);
                                                        ^~
/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c:68:12: note: forward declaration of ‘struct Node_double’
     struct Node_double *left_child;
            ^~~~~~~~~~~
ninja: build stopped: subcommand failed.

I use conda and my envirnment is below.

OS: ubuntu 18.04
GPU: RTX2080
CUDA: 10.0
@hyunynim
Copy link
Author

hyunynim commented Oct 20, 2020

When I remove all "restrict" keyword in _kdtree_code.c, setup.py working well.
But I have new error in generate.py

Traceback (most recent call last):
  File "generate.py", line 11, in <module>
    from im2mesh import config
  File "/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/config.py", line 3, in <module>
    from im2mesh import dvr
  File "/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/dvr/__init__.py", line 1, in <module>
    from im2mesh.dvr import (
  File "/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/dvr/config.py", line 3, in <module>
    from im2mesh.encoder import encoder_dict
  File "/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/encoder/__init__.py", line 1, in <module>
    from im2mesh.encoder import conv
  File "/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/encoder/conv.py", line 3, in <module>
    from im2mesh.common import normalize_imagenet
  File "/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/common.py", line 2, in <module>
    from im2mesh.utils.libkdtree import KDTree
  File "/home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/__init__.py", line 1, in <module>
    from .pykdtree.kdtree import KDTree
ImportError: /home/hongza/lab/differentiable_volumetric_rendering/im2mesh/utils/libkdtree/pykdtree/kdtree.cpython-38-x86_64-linux-gnu.so: undefined symbol: construct_tree_double
  • Add1

And I also edit name of struct in _kdtree_core.c

typedef struct
{
...
} Node_float;

to

typedef struct Node_float
{
...
} Node_float;
  • Add2

When I replace all "restrict" to "__restrict", it also working well.
But I still get an error in generate.py.

@trancelestial
Copy link

Hi, have you in the meantime found a way to solve this issue?

@hyunynim
Copy link
Author

Hi, have you in the meantime found a way to solve this issue?

No I don't yet

@ShunChengWu
Copy link

Pytorch tries to use c++ compiler to compile a c project.
an easy hack for this is to set your CXX to gcc
CC=gcc CXX=gcc python setup.py build_ext --inplace

of course, this may cause errors on other modules. try to compile them separately.
i.e. comment out pykdtree first and run
python setup.py build_ext --inplace,
then comment out all others except pykdtree and run again with
CC=gcc CXX=gcc python setup.py build_ext --inplace

@DaddyWesker
Copy link

I have the same error. Unfortunately, easy hack mentioned above doesn't work either. I've managed to run python setup.py build_ext --inplace after commenting pykdtree in ext_modules, but i am unable to build kdtree separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants