Maratyszcza / NNPACK

Acceleration package for neural networks on multi-core CPUs
BSD 2-Clause "Simplified" License
1.68k stars 316 forks source link

'MAP_HUGETLB' undeclared #117

Closed NHZlX closed 6 years ago

NHZlX commented 6 years ago

I met the following error during compile.

[1/140] CC src/fully-connected-output.c FAILED: /home/xingzhaolong/thiry_party/SOURCE/NNPACK/build/src/fully-connected-output.c.o gcc -o /home/xingzhaolong/thiry_party/SOURCE/NNPACK/build/src/fully-connected-output.c.o -c /home/xingzhaolong/thiry_party/SOURCE/NNPACK/src/fully-connected-output.c -MMD -MF /home/xingzhaolong/thiry_party/SOURCE/NNPACK/build/src/fully-connected-output.c.o.d -O2 -std=gnu99 -g -pthread -DNNP_CONVOLUTION_ONLY=0 -DNNP_INFERENCE_ONLY=0 -I/home/xingzhaolong/thiry_party/SOURCE/NNPACK/include -I/home/xingzhaolong/thiry_party/SOURCE/NNPACK/src/x86_64-fma -I/home/xingzhaolong/thiry_party/SOURCE/NNPACK/src -I/home/xingzhaolong/thiry_party/SOURCE/NNPACK/src/ref -I/home/xingzhaolong/thiry_party/SOURCE/NNPACK/deps/pthreadpool/include -I/home/xingzhaolong/thiry_party/SOURCE/NNPACK/deps/fxdiv/include -I/home/xingzhaolong/thiry_party/SOURCE/NNPACK/deps/fp16/include In file included from /home/xingzhaolong/thiry_party/SOURCE/NNPACK/src/fully-connected-output.c:6:0: /home/xingzhaolong/thiry_party/SOURCE/NNPACK/include/nnpack/system.h: In function 'allocate_memory': /home/xingzhaolong/thiry_party/SOURCE/NNPACK/include/nnpack/system.h:99:117: error: 'MAP_HUGETLB' undeclared (first use in this function) void* memory_block = mmap(NULL, memory_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE | MAP_HUGETLB, -1, 0);

My platform:

Linux version 3.10.0_2-0-0-0 (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Tue Sep 20 17:18:54 CST 2016

Look forward to a reply, thanks

Maratyszcza commented 6 years ago

MAP_HUGETLB definition should be provided by libc headers. If your system headers do not define this symbol, you can do it yourself, #define MAP_HUGETLB 0x0040000