verse icon indicating copy to clipboard operation
verse copied to clipboard

Issue while using the make command!!

Open aj280192 opened this issue 5 years ago • 5 comments

Hi Author,

I am getting the below error while using the make command.

verse.cpp: In function 'void* aligned_malloc(size_t, size_t)': verse.cpp:80:5: error: 'posix_memalign' was not declared in this scope 80 | if (posix_memalign(&result, align, size)) result = 0; | ^~~~~~~~~~~~~~ make: *** [makefile:22: verse] Error 1

How can I fix this issue??

aj280192 avatar Jun 25 '20 16:06 aj280192

Hey, which compiler are you using?

xgfs avatar Jun 25 '20 18:06 xgfs

I am using g++ compiler on windows!! Also, I have dropped a mail can you confirm if you have received it.

aj280192 avatar Jun 25 '20 19:06 aj280192

Are you using WSL? It seems that Windows version does not come with OpenMP, you'd probably need visual studio to compile the thing, or search for ways to use OpenMP within Windows WSL gcc.

My bandwith on answering things is currently limited, I'm trying to process things FIFO.

xgfs avatar Jun 28 '20 15:06 xgfs

Ya you are right.. when I complied just verse.cpp using -fopenmp... maybe I need to make changes to the make file to use -fopenmp?

aj280192 avatar Jun 28 '20 15:06 aj280192

It doesn't seem to be an OpenMP issue. GCC on Windows doesn't seem to support the memory alignment. You can replace

void *result; if (posix_memalign(&result, align, size)) result = 0;

with something like results = malloc(size);

xgfs avatar Jun 29 '20 22:06 xgfs