• 编译hadoop的libhdfs.a


    进入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了。
  • 相关阅读:
    DS博客作业--线性表
    c博客06-2019-结构体&文件
    C语言博客作业03--函数
    DS博客作业05--查找
    DS博客作业04--图
    DS博客作业03--树
    DS博客作业02--栈和队列
    DS博客作业2--线性表
    c博客06-结构体&文件
    C语言博客作业—2019-指针
  • 原文地址:https://www.cnblogs.com/aquester/p/9891554.html
Copyright © 2020-2023  润新知