安装protobuf
1、由于Hadoop底层的序列化用到了Protobuf框架,因此在对hadoop进行源码编译之前一定要确保平台安装了Protobuf软件,由于Hadoop底层使用了Protobuf-2.5.0因此需要下载相关软件protobuf-2.5.0.tar.gz
这里需要注意由于平台使用的是银河麒麟高级服务器操作系统 V10 SP1 ARM64操作系统因此无法使用通用的方法安装序列化软件
#error Host architecture was not detected as supported by protobuf
因此需要按照以下方式安装
①下载并解压源码。
wget https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
tar -zxf protobuf-2.5.0.tar.gz
②将解压后的目录移至“/opt/tools/installed/”目录
mv protobuf-2.5.0 /opt/tools/installed/
③进入“/opt/tools/installed/”目录。
cd /opt/tools/installed
④下载protoc.zip并解压得到protoc.patch文件,其中protoc.patch存放的路径可自己指定(例如:“/opt/tools/installed/”)
wget https://mirrors.huaweicloud.com/kunpeng/archive/kunpeng_solution/bigdata/Patch/protoc.zip
unzip protoc.zip
cp ./protoc/protoc.patch ./protobuf-2.5.0/src/google/protobuf/stubs/
diff -uprN stubs/atomicops_internals_arm_gcc.h stubs/atomicops_internals_arm_gcc.h
--- subs/atomicops_internals_arm_gcc.h 2018-08-03 08:50:58.579413324 +0000
+++ stubs/atomicops_internals_arm_gcc.h 2018-08-03 08:50:58.711413322 +0000
@@ -68,6 +68,30 @@ inline Atomic32 NoBarrier_CompareAndSwap
} while (prev_value == old_value);
return prev_value;
}
+inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
+ Atomic64 old_value,
+ Atomic64 new_value) {
+ Atomic64 prev;
+ int32_t temp;
+
+ __asm__ __volatile__ ( // NOLINT
+ "0: \n