XRT icon indicating copy to clipboard operation
XRT copied to clipboard

error: ‘MAP_HUGE_SHIFT’ was not declared in this scope

Open malith199122 opened this issue 4 years ago • 2 comments

When I tried to build the XRT with the build script (build.sh) I got the following error XRT/src/runtime_src/core/pcie/linux/shim.cpp: In member function ‘int xocl::shim::cmaEnable(bool, uint64_t)’: XRT/src/runtime_src/core/pcie/linux/shim.cpp:1215:140: error: ‘MAP_HUGE_SHIFT’ was not declared in this scope void *addr_local = mmap(0x0, page_sz, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | hugepage_flag << MAP_HUGE_SHIFT, 0, 0);

Could you please let me know how to fix this error ?

Thanks in advance

malith199122 avatar Jun 12 '20 12:06 malith199122

Hello @malith199122, could you please share the OS/kernel version you are using?

run uname -a & uname -r in terminal(assume you are using Linux)

There is a quick hack to pass the check:

Add this line at XRT/src/runtime_src/core/pcie/linux/shim.cpp:83(or any where)

#define MAP_HUGE_SHIFT 26

It should fix the compile issue

chienwei-lan avatar Jun 16 '20 23:06 chienwei-lan

@malith199122 is this issue resolved with standard Linux install? Do you still the hack?

sonals avatar Nov 05 '21 03:11 sonals