sunqing3020590的个人博客分享 http://blog.sciencenet.cn/u/sunqing3020590

博文

LEDAPS&LaSRC安装(2)espa-product-formatter安装-最折腾-2018

已有 1826 次阅读 2018-10-24 11:23 |系统分类:科研笔记

 espa-product-formatter Github源:

https://github.com/USGS-EROS/espa-product-formatter


看懂官方安装说明最好。


首先安装:

git clone https://github.com/USGS-EROS/espa-product-formatter.git

(1) 安装依赖库:上一篇中hdf4,hdf5, hdfeos, gctp已安装,采用了源码编译的方式。GCTP与hdfeos库的路径一模一样即可,安装hdfeos时已经安装了GCTP了。

本人手动安装的库:SZIP,GEOTIFF,TIFF,JPEG,ZLIB

其余均可通过apt-get安装,例如

IDN,LZMA,CURL:

apt-get install libidn11 libidn11-dev libidn2-0 libidn2-0-dev lzma libcurl4-openssl-dev 

方法为:先用sudo apt-cache search "name"搜索库的完整名称,然后用sudo apt-get install "name-dev"安装。注意,一个库的名字往往能搜索出多个版本,选择带-dev的版本。



(2) 设置环境变量:利用dpkg -L "name-dev"查找各个库的安装路径,设置好各环境变量。


依赖库列表:




最最重要的来了,必须设置好所有的路径!缺一不可!

官方:

  export HDFEOS_GCTPINC="path_to_HDF-EOS_GCTP_include_files"
  export HDFEOS_GCTPLIB="path_to_HDF-EOS_GCTP_libraries"
  export TIFFINC="path_to_TIFF_include_files"
  export TIFFLIB="path_to_TIFF_libraries"
  export GEOTIFF_INC="path_to_GEOTIFF_include_files"
  export GEOTIFF_LIB="path_to_GEOTIFF_libraries"
  export HDFINC="path_to_HDF4_include_files"
  export HDFLIB="path_to_HDF4_libraries"
  export HDF5INC="path_to_HDF5_include_files"
  export HDF5LIB="path_to_HDF5_libraries"
  export HDFEOS_INC="path_to_HDFEOS2_include_files"
  export HDFEOS_LIB="path_to_HDFEOS2_libraries"
  export NCDF4INC="path_to_NETCDF_include_files"
  export NCDF4LIB="path_to_NETCDF_libraries"
  export JPEGINC="path_to_JPEG_include_files"
  export JPEGLIB="path_to_JPEG_libraries"
  export XML2INC="path_to_XML2_include_files"
  export XML2LIB="path_to_XML2_libraries"
  export JBIGINC="path_to_JBIG_include_files"
  export JBIGLIB="path_to_JBIG_libraries"
  export ZLIBINC="path_to_ZLIB_include_files"
  export ZLIBLIB="path_to_ZLIB_libraries"    
  export SZIPINC="path_to_SZIP_include_files"
  export SZIPLIB="path_to_SZIP_libraries"    
  export CURLINC="path_to_CURL_include_files"
  export CURLLIB="path_to_CURL_libraries"
  export LZMAINC="path_to_LZMA_include_files"
  export LZMALIB="path_to_LZMA_libraries"
  export IDNINC="path_to_IDN_include_files"
  export IDNLIB="path_to_IDN_libraries"
  export ESPAINC="path_to_format_converter_raw_binary_include_directory"
  export ESPALIB="path_to_format_converter_raw_binary_lib_directory"
  
  export PREFIX="path_to_directory_for_format_converter_build_data"
  export ESPA_LAND_MASS_POLYGON=$PREFIX/static_data/land_no_buf.ply


下载所需的数据land/water polygon:

 http://edclpdsftp.cr.usgs.gov/downloads/auxiliaries/land_water_poly/land_no_buf.ply.gz

这是我的:

export SZIPINC="/mnt/d/Ubuntu/lib/szip-master/src/"

export SZIPLIB="/mnt/d/Ubuntu/lib/szip-master/src/"

export XML2INC="/usr/include/libxml2"

export XML2LIB="/usr/lib/x86_64-linux-gnu"

export GEOTIFF_INC="/home/chexh/LIBS/libgeotiff-1.4.2/"

export GEOTIFF_LIB="/home/chexh/LIBS/libgeotiff-1.4.2/"

export TIFFINC="/home/chexh/LIBS/tiff-4.0.9/include"

export TIFFLIB="/home/chexh/LIBS/tiff-4.0.9/lib"

export HDFINC="/home/chexh/LIBS/hdf-4.2.13/include/"

export HDFLIB="/home/chexh/LIBS/hdf-4.2.13/lib/"

export HDF5INC="/home/chexh/LIBS/hdf5-1.10.4/include/"

export HDF5LIB="/home/chexh/LIBS/hdf5-1.10.4/lib/"

export HDFEOS_GCTPINC="/home/chexh/LIBS/hdfeos/include/"

export HDFEOS_GCTPLIB="/home/chexh/LIBS/hdfeos/lib/"

export HDFEOS_INC="/home/chexh/LIBS/hdfeos/include/"

export HDFEOS_LIB="/home/chexh/LIBS/hdfeos/lib/"

export ZLIBINC="/home/chexh/LIBS/zlib-1.2.11/include/"

export ZLIBLIB="/home/chexh/LIBS/zlib-1.2.11/lib/"

export JPEGINC="/home/chexh/LIBS/jpeg-9b/include/"

export JPEGLIB="/home/chexh/LIBS/jpeg-9b/lib/"

export JBIGINC="/usr/lib/x86_64-linux-gnu/"

export JBIGLIB="/usr/lib/x86_64-linux-gnu/"

export LZMAINC="/usr/include/lzma"

export LZMALIB="/usr/lib/x86_64-linux-gnu"

export NCDF4INC="/usr/include/"

export NCDF4LIB="/usr/lib/x86_64-linux-gneu/"

export CURLINC="/usr/include/curl/"

export CURLLIB="/usr/lib/x86_64-linux-gnu/"

export IDNINC="/usr/include/"

export IDNLIB="/usr/lib/x86_64-linux-gnu/"


# 设置 prefix的路径及新建文件夹(mkdir static_data),将下载的data放进去

# 数据land_no_buf.ply的地址:#http://edclpdsftp.cr.usgs.gov/downloads/auxiliaries/land_water_poly/land_no_buf.ply.gz

#Tips:建议wget下载,我用chrome浏览器下载老中断,不知道国内网的问题还是什么问题。

export PREFIX="/home/chexh/ESPA/"

export ESPA_LAND_MASS_POLYGON=$PREFIX/static_data/land_no_buf.ply


#espa-product-formatter将要安装的路径

export ESPAINC="/home/chexh/ESPA/espa-product-formatter/raw_binary/"

export ESPALIB="/home/chexh/ESPA/espa-product-formatter/raw_binary/"



注意:安装espa-product-formatter的路径是在/espa-product-formatter/raw_binary/路径下:

只需要输入: make 


出错总结:

  1.  make all in land_water_mask_libs...

make[1]: Entering directory '/home/chexh/ESPA/espa-product-formatter/raw_binary/land_water_mask_libs'
gcc -Wall -O2 -I. -I../include -I/usr/include/libxml2 -I/usr/include/hdf/ -I -c generate_land_water_mask.c
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function 
_start': (.text+0x20): undefined reference to main'
/tmp/ccauGQmO.o: In function 
generate_land_water_mask': generate_land_water_mask.c:(.text+0x408): undefined reference to ias_geo_shape_mask_projection'
generate_land_water_mask.c:(.text+0x5a3): undefined reference to 
error_handler' generate_land_water_mask.c:(.text+0x631): undefined reference to deg_to_dms'
generate_land_water_mask.c:(.text+0x649): undefined reference to 
deg_to_dms' generate_land_water_mask.c:(.text+0x6a2): undefined reference to deg_to_dms'
generate_land_water_mask.c:(.text+0x6ba): undefined reference to 
deg_to_dms' generate_land_water_mask.c:(.text+0x6d2): undefined reference to deg_to_dms'
generate_land_water_mask.c:(.text+0x74d): undefined reference to `error_handler'
collect2: error: ld returned 1 exit status
Makefile:90: recipe for target 'generate_land_water_mask.o' failed
make[1]: *** [generate_land_water_mask.o] Error 1
make[1]: Leaving directory '/home/chexh/ESPA/espa-product-formatter/raw_binary/land_water_mask_libs'
Makefile:24: recipe for target 'libraries' failed
make: *** [libraries] Error 1


出错原因:忘记设置HDFEOS_INC及LIB路径。


2.期间貌似还有一些是由于ZLIB,SZIP,JPEG等库的问题,均手动安装之后成功编译。




https://blog.sciencenet.cn/blog-2410131-1142544.html

上一篇:LEDAPS&LaSRC安装(1) WSL下源码安装hdf4, hdf5, hdfeos-2018年
下一篇:LEDAPS&LaSRC安装(3)

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2021-12-5 02:19

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部