moses-smt / mosesdecoder

Moses, the machine translation system
http://www.statmt.org/moses
GNU Lesser General Public License v2.1
1.58k stars 778 forks source link

util/mmap.cc doesn't compile with a Linux kernel older than 2.6.38 #130

Closed hidetokazawa closed 9 years ago

hidetokazawa commented 9 years ago

Line 209 in util/mmap.cc refers the symbol MADV_HUGEPAGE, which is available only for a Linux kernel later than 2.6.38. (Ref. http://linux.die.net/man/2/madvise) Compilation fails with older kernels. CentOS 6 still uses such kernel for example.

There is another reference to MADV_HUGEPAGE in util/mmap.cc but it is guarded by #ifdef. I think it is better to guard the above bare reference in a similar way.

hieuhoang commented 9 years ago

I saw this checkin by @kpu. https://github.com/moses-smt/mosesdecoder/commit/ebf31f3e8dd53c7059bb0c4e03a0920a5790ef6c

Is this to your liking?

hieuhoang commented 9 years ago

It sounds like it should be fixed now. I'm closing the issue if no-one objects