GDAL 3.0.1的源安装失败,未定义对EVP_MD_CTX_new和EVP_MD_CTX_free

时间:2019-08-22 09:20:08

标签: gdal

我正在Ubuntu 16.04上通过以下步骤从源代码安装GDAL 3.0.1。

$ wget https://download.osgeo.org/gdal/3.0.1/gdal-3.0.1.tar.gz
$ tar xzf gdal-3.0.1.tar.gz
$ cd gdal-3.0.1

$ ./configure --with-python --with-png=internal --with-jpeg=internal
$ make

运行./configure毫无问题:

GDAL is now configured for x86_64-pc-linux-gnu

  Installation directory:    /usr/local
  C compiler:                gcc -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2
  C++ compiler:              g++ -std=c++11 -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2
  C++14 support:             no

  LIBTOOL support:           yes

  LIBZ support:              external
  LIBLZMA support:           no
  ZSTD support:              no
  cryptopp support:          no
  crypto/openssl support:    yes
  GRASS support:             no
  CFITSIO support:           no
  PCRaster support:          internal
  LIBPNG support:            internal
  DDS support:               no
  GTA support:               no
  LIBTIFF support:           internal (BigTIFF=yes)
  LIBGEOTIFF support:        internal
  LIBJPEG support:           internal
  12 bit JPEG:               yes
  12 bit JPEG-in-TIFF:       yes
  LIBGIF support:            internal
  JPEG-Lossless/CharLS:      no
  OGDI support:              no
  HDF4 support:              no
  HDF5 support:              yes
  Kea support:               no
  NetCDF support:            yes
  NetCDF has netcdf_mem.h:   no
  Kakadu support:            no
  JasPer support:            no
  OpenJPEG support:          no
  ECW support:               no
  MrSID support:             no
  MrSID/MG4 Lidar support:   no
  JP2Lura support:           no
  MSG support:               no
  EPSILON support:           no
  WebP support:              no
  cURL support (wms/wcs/...):yes
  PostgreSQL support:        yes
  LERC support:              yes
  MySQL support:             no
  Ingres support:            no
  Xerces-C support:          no
  Expat support:             yes
  libxml2 support:           yes
  Google libkml support:     no
  ODBC support:              no
  FGDB support:              no
  MDB support:               no
  PCIDSK support:            internal
  OCI support:               no
  GEORASTER support:         no
  SDE support:               no
  Rasdaman support:          no
  DODS support:              no
  SQLite support:            yes
  PCRE support:              yes
  SpatiaLite support:        no
  RasterLite2 support:       no
  Teigha (DWG and DGNv8):    no
  INFORMIX DataBlade support:no
  GEOS support:              yes
  SFCGAL support:            no
  QHull support:             internal
  Poppler support:           no
  Podofo support:            no
  PDFium support:            no
  OpenCL support:            no
  Armadillo support:         no
  FreeXL support:            no
  SOSI support:              no
  MongoDB support:           no
  MongoCXX v3 support:       no
  HDFS support:              no
  TileDB support:            no
  userfaultfd support:       yes
  misc. gdal formats:        aaigrid adrg aigrid airsar arg blx bmp bsb cals ceos ceos2 coasp cosar ctg dimap dted e00grid elas envisat ers fit gff gsg gxf hf2 idrisi ignfheightasciigrid ilwis ingr iris iso8211 jaxapalsar jdem kmlsuperoverlay l1b leveller map mrf msgn ngsgeoid nitf northwood pds prf r raw rmf rs2 safe saga sdts sentinel2 sgi sigdem srtmhgt terragen til tsx usgsdem xpm xyz zmap rik ozi grib eeda plmosaic rda wcs wms wmts daas rasterlite mbtiles pdf
  disabled gdal formats:    
  misc. ogr formats:         aeronavfaa arcgen avc bna cad csv dgn dxf edigeo geoconcept georss gml gmt gpsbabel gpx gtm htf jml mvt ntf openair openfilegdb pgdump rec s57 segukooa segy selafin shape sua svg sxf tiger vdv wasp xplane idrisi pds sdts ods xlsx amigocloud carto cloudant couchdb csw elastic gft ngw plscenes wfs gpkg vfk osm
  disabled ogr formats:     


  SWIG Bindings:             python 

  PROJ >= 6:                 yes
  enable GNM building:       yes
  enable pthread support:    yes
  enable POSIX iconv support:yes
  hide internal symbols:     no

但是,在运行make时,它退出并出现以下错误:

... /.libs/libgdal.so: undefined reference to `EVP_MD_CTX_new'
... /.libs/libgdal.so: undefined reference to `EVP_MD_CTX_free'
collect2: error: ld returned 1 exit status
GNUmakefile:82: recipe for target 'gdalinfo' failed
make[1]: *** [gdalinfo] Error 1

搜索此错误时,我看到的是它与OpenSSL有关。

我已经安装了多个版本的OpenSSL,但恐怕这可能会弄乱它。

随apt-get安装的OpenSSL是:

$ /usr/bin/openssl version
OpenSSL 1.0.2g  1 Mar 2016

但是,Miniconda还安装了一个OpenSSL(在搜索路径中,它位于usr / bin之前)

$ openssl version
OpenSSL 1.1.1c  28 May 2019

我不知道如何告诉GDAL在哪里找到OpenSSL,或者这是否真的可以解决我的问题。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

我不知道“ gdal”是什么,但我看到了您的问题,并想留下一个提示,即在编译时需要库而不是二进制库。

在特殊情况下,需要使用OpenSSL加密库。正如您所正确发现的那样,功能EVP_MD_CTX_new和EVP_MD_CTX_free是在1.1版中引入的。

所以我认为您没有安装正确的库。

您可以搜索术语libcrypto.so来查找您的版本。大多数情况下,这是一个符号链接,指向其中包含版本的真实库。 (libcrypto.so-> libcrypto.so.1.1) 在我的计算机(ubuntu)上,该lib位于/ usr / lib / x86_64-linux-gnu中。

希望有帮助。