编译hadoop的libhdfs.a-阿里云开发者社区

开发者社区> 大数据> 正文

编译hadoop的libhdfs.a

简介: 进入hadoop-hdfs-project/hadoop-hdfs/src目录,执行cmake以生成Makefile文件。 如果遇到如下的错误: ~/hadoop-2.7.1-src/hadoop-hdfs-project/hadoop-hdfs/src]$ cmake .
进入hadoop-hdfs-project/hadoop-hdfs/src目录,执行cmake以生成Makefile文件。


如果遇到如下的错误:
~/hadoop-2.7.1-src/hadoop-hdfs-project/hadoop-hdfs/src]$ cmake .
JAVA_HOME=, JAVA_JVM_LIBRARY=/data/jdk/jre/lib/amd64/server/libjvm.so
JAVA_INCLUDE_PATH=/data/jdk/include, JAVA_INCLUDE_PATH2=/data/jdk/include/linux
Located all JNI components successfully.
CMake Error at CMakeLists.txt:84 (MESSAGE):
  You must set the CMake variable GENERATED_JAVAH
-- Configuring incomplete, errors occurred!


则指定一下cmake参数即可,如下所示:
cmake -DJAVA_HOME=/data/jdk -DGENERATED_JAVAH=/data/jdk .


然后带参数再次执行cmake:
~/hadoop-2.7.1-src/hadoop-hdfs-project/hadoop-hdfs/src]$ cmake -DJAVA_HOME=/data/jdk -DGENERATED_JAVAH=/data/jdk .


下面的显示表示cmake成功,会在当前目录下生成Makefile文件:
JAVA_HOME=/data/jdk, JAVA_JVM_LIBRARY=/data/jdk/jre/lib/amd64/server/libjvm.so
JAVA_INCLUDE_PATH=/data/jdk/include, JAVA_INCLUDE_PATH2=/data/jdk/include/linux
Located all JNI components successfully.
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.23") 
-- checking for module 'fuse'
--   package 'fuse' not found
-- Failed to find Linux FUSE libraries or include files.  Will not build FUSE client.
-- Configuring done
-- Generating done
-- Build files have been written to: /data/hadoop-2.7.1-src/hadoop-hdfs-project/hadoop-hdfs/src


接下来就可以执行make来编译生成libhdfs.a了。

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

分享:
大数据
使用钉钉扫一扫加入圈子
+ 订阅

大数据计算实践乐园,近距离学习前沿技术

其他文章