hadoop2.2.0 版本编译64位native库的问题

参考文章:

http://www.micmiu.com/bigdata/hadoop/hadoop-build-native-library-on-mac-os-x/

http://blog.sina.com.cn/s/blog_6baac06c0101gvxr.html

头疼的问题

release-2.2.0/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/security/JniBasedUnixGroupsNetgroupMapping.c:77:26: error: invalid operands to binary expression_r('void' and 'int')

     [exec]   if(setnetgrent(cgroup) == 1) {
     [exec]      ~~~~~~~~~~~~~~~~~~~ ^  ~
     [exec] 1 error generated.
     [exec] make[2]: *** [CMakeFiles/hadoop.dir/main/native/src/org/apache/hadoop/security/JniBasedUnixGroupsNetgroupMapping.c.o] Error 1
     [exec] make[1]: *** [CMakeFiles/hadoop.dir/all] Error 2
     [exec] make: *** [all] Error 2

解决方法:直接修改源码,源码中freebsd是不需要这样一行,直接setnetgrent(cgroup) 

 

 

posted on 2014-04-01 19:52  Ryan_Y  阅读(549)  评论(0编辑  收藏  举报