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

undefined reference to `aligned_alloc' #5

Open
chenyuetian opened this issue Jun 2, 2018 · 1 comment
Open

undefined reference to `aligned_alloc' #5

chenyuetian opened this issue Jun 2, 2018 · 1 comment

Comments

@chenyuetian
Copy link

Dear semargl-ng developer:
When compiling semargl-ng on our cluster, i got the error:
core/interp.c: In function ‘gsl_interp_continuous_axis’:
core/interp.c:88:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
double *y64 = (double *)aligned_alloc(ALIGNETOCACHE, sizeof(double) * size);
^
/tmp/ccVkQPaQ.o: In function main': x2kc2c.c:(.text.startup+0x1b0): undefined reference to aligned_alloc'
x2kc2c.c:(.text.startup+0x1f3): undefined reference to aligned_alloc' x2kc2c.c:(.text.startup+0x20b): undefined reference to aligned_alloc'
/tmp/ccko3GJD.o: In function get_stamps_from_files': common.c:(.text+0x118f): undefined reference to aligned_alloc'
/tmp/ccgoXLSa.o: In function batch_gsl_interp_continuous_axis': interp.c:(.text+0xd1): undefined reference to aligned_alloc'
/tmp/ccgoXLSa.o:interp.c:(.text+0x913): more undefined references to `aligned_alloc' follow
collect2: error: ld returned 1 exit status
make: *** [release] Error 1

The "aligned_alloc" is only available in the glibc since glibc 2.16. Our current version of glibc is 2.12 and for security reason we cannot upgrade our system glibc, or install one in the user's /home directory.
Is there a way to replace those aligned_alloc with more general "malloc", if possible? Please help. I really appreciate if you could provide me a version/example using malloc.
Best,

@godsic
Copy link
Owner

godsic commented Jul 2, 2018

@chenyuetian You are free to replace aligned_alloc with malloc.

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

2 participants