1 year ago
#385797
A.Gh
undefined reference to `polybench_alloc_data' error when running polybench
I wanted to start working with polybench https://web.cse.ohio-state.edu/~pouchet.2/software/polybench/, but there is an error that I couldn't find a way around. when I compile a module such as correlation the following error appears
/root/myCodes/polybench/datamining/correlation/correlation.c:135: undefined reference to `polybench_alloc_data'
/usr/bin/ld: /root/myCodes/polybench/datamining/correlation/correlation.c:136: undefined reference to `polybench_alloc_data'
/usr/bin/ld: /root/myCodes/polybench/datamining/correlation/correlation.c:137: undefined reference to `polybench_alloc_data'
/usr/bin/ld: /root/myCodes/polybench/datamining/correlation/correlation.c:138: undefined reference to `polybench_alloc_data'
collect2: error: ld returned 1 exit status
Build finished with error(s).
the reference is to polybench.h
and is declared as follows:
# define POLYBENCH_ALLOC_1D_ARRAY(n1, type) \
(type(*)[n1 + POLYBENCH_PADDING_FACTOR])polybench_alloc_data ((n1 + POLYBENCH_PADDING_FACTOR), sizeof(type))
# define POLYBENCH_ALLOC_2D_ARRAY(n1, n2, type) \
(type(*)[n1 + POLYBENCH_PADDING_FACTOR][n2 + POLYBENCH_PADDING_FACTOR])polybench_alloc_data (((n1 + POLYBENCH_PADDING_FACTOR) * (n2 + POLYBENCH_PADDING_FACTOR)), sizeof(type))
# define POLYBENCH_ALLOC_3D_ARRAY(n1, n2, n3, type) \
(type(*)[n1 + POLYBENCH_PADDING_FACTOR][n2 + POLYBENCH_PADDING_FACTOR][n3 + POLYBENCH_PADDING_FACTOR])polybench_alloc_data (((n1 + POLYBENCH_PADDING_FACTOR) * (n2 + POLYBENCH_PADDING_FACTOR) * (n3 + POLYBENCH_PADDING_FACTOR)), sizeof(type))
# define POLYBENCH_ALLOC_4D_ARRAY(n1, n2, n3, n4, type) \
(type(*)[n1 + POLYBENCH_PADDING_FACTOR][n2 + POLYBENCH_PADDING_FACTOR][n3 + POLYBENCH_PADDING_FACTOR][n4 + POLYBENCH_PADDING_FACTOR])polybench_alloc_data (((n1 + POLYBENCH_PADDING_FACTOR) * (n2 + POLYBENCH_PADDING_FACTOR) * (n3 + POLYBENCH_PADDING_FACTOR) * (n4 + POLYBENCH_PADDING_FACTOR)), sizeof(type))
# define POLYBENCH_ALLOC_5D_ARRAY(n1, n2, n3, n4, n5, type) \
(type(*)[n1 + POLYBENCH_PADDING_FACTOR][n2 + POLYBENCH_PADDING_FACTOR][n3 + POLYBENCH_PADDING_FACTOR][n4 + POLYBENCH_PADDING_FACTOR][n5 + POLYBENCH_PADDING_FACTOR])polybench_alloc_data (((n1 + POLYBENCH_PADDING_FACTOR) * (n2 + POLYBENCH_PADDING_FACTOR) * (n3 + POLYBENCH_PADDING_FACTOR) * (n4 + POLYBENCH_PADDING_FACTOR) * (n5 + POLYBENCH_PADDING_FACTOR)), sizeof(type))
And the polybench_alloc_data
is declared as follows
extern void* polybench_alloc_data(unsigned long long int n, int elt_size);
extern void polybench_free_data(void* ptr);
c++
c
undefined
0 Answers
Your Answer