编译gdal3.0.0源码使支持gdal读写hdfs, 首先编译hadoop3.1.2源码,然后编译gdal3.0.0源码,生成所需gdal.jar包和动态库.hadoop编译结果下载链接;gdal动态库下载链接。
参考:[GDAL编译安装指南](https://www.jianshu.com/p/bb20c2c2043d)
1. hadoop3.1.2源码编译
主要介绍依赖库安装,遇到的问题与解决办法:
安装Protocol Buffer,参考
[手把手教你如何安装Protocol Buffer ](https://www.jianshu.com/p/92dbe1ef0054)
hadoop编译报如下问题
Cannot find a usable OpenSSL library. OPENSSL_LIBRARY hadoop
解决办法:安装openssl,参考
[hadoop源码研究 编译错误记录](https://blog.csdn.net/plifemao/article/details/86711771)
2.gdal3.0.0源码编译
./configure --with-java=/usr/lib/jdk1.8.0_92 --with-hdfs=/usr/local/
gdal make报如下问题
/usr/bin/ld: warning: libjvm.so
解决办法:配置LD_LIBRARY_PATH,参考
[C语言操作hdfs](https://www.jianshu.com/p/9a237f8c2314)
3. openssl sqlite3环境变量配置
OPENSSL\PKG_CONFIG_PATH环境变量配置如下,~/.bash_profile
vim ~/.bash_profile
```
export OPENSSL=/usr/local/openssl/bin
export SQLITE3=/usr/local/sqlite3/bin
export PATH=$SQLITE3:$OPENSSL:$PATH
export PKG_CONFIG_PATH=/usr/local/sqlite3/lib/pkgconfig
PATH=$PATH:$HOME/bin
export PATH
```
export JAVA_HOME=/usr/lib/jdk1.8.0_92
export MAVEN_HOME=/usr/local/apache-maven-3.5.4
export ANT_HOME=/usr/local/apache-ant-1.10.6
export FINDBUGS_HOME=/usr/local/findbugs-3.0.1
export NODE_HOME=/usr/local/node-v8.11.4-linux-x64
export PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin:$ANT_HOME/bin:$FINDBUGS_HOME/bin:$NODE_HOME/bin
export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server
网友评论