Centos7安装gdal踩坑记录

784  rpm -ivh libmpc-1.0.1-3.el7.x86_64.rpm
  785  ll
  786  cd packages
  787  rpm -ivh libmpc-1.0.1-3.el7.x86_64.rpm
  788  ll
  789  cd ..
  790  ll
  791  tar -zxvf gdal_lib.tar.gz
  792  unzip java.zip
  793  cd packages
  794  ll
  795  top
  796  free -h
  797  cd ..
  798  ll
  799  cd 202307
  800  ll
  801  unzip gdal.zip
  802  cd gdal
  803  ll
  804  tar -xjf geos-3.6.2.tar.bz2
  805  ll
  806  yum -y install zlib-devel
  807  tar -xjf geos-3.6.2.tar.bz2
  808  tar jxvf geos-3.6.2.tar.bz2
  809  ll
  810  yum search bzip2
  811  yum -y install bzip2-x86_64
  812  tar -xjvf geos-3.6.2.tar.bz2
  813  cd ..
  814  ll
  815  cd packages
  816  rpm -ivh bzip2-libs-1.0.6-13.el7.i686.rpm
  817  yum search bzip2
  818  yum install bzip2-devel.x86_64
  819  yum install bzip2-libs.x86_64
  820  cd ..
  821  cd gdal
  822  ll
  823  tar -xjf geos-3.6.2.tar.bz2
  824  tar -xjvf geos-3.6.2.tar.bz2
  825  yum -y install bzip2
  826  tar -xjf geos-3.6.2.tar.bz2
  827  ll
  828  cd geos-3.6.2
  829  ll
  830  ./configure
  831  gcc -v
  832  gcc
  833  g++
  834  yum install gcc gcc-c++
  835  ./configure
  836  make && make install
  837  cd ..
  838  ll
  839  tar -xjf proj-4.9.3.tar.gz
  840  tar -zxvf proj-4.9.3.tar.gz
  841  cd proj-4.9.3
  842  ll
  843  ./configure
  844  make && make install
  845  cd ..
  846  tar -zxvf jpegsrc.v9b.tar.gz
  847  ll
  848  cd jpeg-9b
  849  ll
  850  ./configure
  851  make && make install
  852  history
  853  ll
  854  make && make install
  855  cd ..
  856  ll
  857  tar -zxf hdf5-1.10.1.tar.gz
  858  ll
  859  cd hdf5-1.10.1
  860  export F9X=ifort
  861  ./configure --prefix=/opt/hdf5 --with-hdf4=/opt/hdf4 --with-jpeg=/opt/jpeg --enable-java --enable-cxx
  862  make && make install
  863  cd ..
  864  ll
  865  tar -zxvf hdf-4.2.13.tar.gz
  866  cd hdf-4.2.13
  867  ./configure --prefix=/opt/hdf4 --enable-netcdf --enable-jpeg --with-jpeg=/opt/jpeg --enable-hdf5 --with-hdf5=/opt/hdf5 --enable-shared --disable-fortran --enable-java
  868  make && make install
  869  ./configure --prefix=/opt/hdf4 --enable-netcdf --enable-jpeg --with-jpeg=/opt/jpeg --enable-hdf5 --with-hdf5=/opt/hdf5 --enable-shared --disable-fortran --enable-java
  870  yum install byacc
  871  ./configure --prefix=/opt/hdf4 --enable-netcdf --enable-jpeg --with-jpeg=/opt/jpeg --enable-hdf5 --with-hdf5=/opt/hdf5 --enable-shared --disable-fortran --enable-java
  872  yum install flex
  873  ./configure --prefix=/opt/hdf4 --enable-netcdf --enable-jpeg --with-jpeg=/opt/jpeg --enable-hdf5 --with-hdf5=/opt/hdf5 --enable-shared --disable-fortran --enable-java
  874  make && make install
  875  ls /usr/local/lib/libjpeg.so*
  876  ldconfig /usr/local/lib
  877  make && make install
  878  cd ..
  879  tar -zxvf netcdf-c-4.4.1.1.tar.gz
  880  cd netcdf-c-4.4.1.1
  881  CPPFLAGS="-l/opt/hdf4/include -l/opt/hdf5/include -l/opt/jpeg/include"
  882  LDFLAGS="-l/opt/hdf4/lib -l/opt/hdf5/lib -l/opt/jpeg/lib"
  883  ./configure --prefix=/opt/netcdf --enable-hdf5 --with-hdf5=/opt/hdf5 --enable-hdf4 --with-hdf4=/opt/hdf4 --enable-jpeg --with-jpeg=/opt/jpeg --disable-netcdf-4
  884  make && make install
  885  cd ..
  886  ll
  887  tar -zxvf gdal-2.4.0.tar.gz
  888  cd gdal-2.4.0
  889  ll
  890  ./configure --prefix=/opt/gdal --enable-netcdf --with-netcdf=/opt/netcdf --enable-hdf5 --with-hdf5=/opt/hdf5 --enable-hdf4 --with-hdf4=/opt/hdf4
  891  make && make install
  892  gdalinfo
  893  history
  894  vi /etc/profile
  895  source /etc/profile
  896  gdalinfo
  897  gdalinfo --version
  898  cd ..
  899  ls
  900  ll
  901  tar -zxvf apache-ant-1.10.12-bin.tar.gz
  902  ll
  903  vi /etc/profile
  904  source /etc/profile
  905  ant -v
  906  ll
  907  cd gdal-2.4.0
  908  ll
  909  cd swig
  910  ls
  911  ll
  912  cd java
  913  ls
  914  ll
  915  vi java.opt
  916  ll
  917  make
  918  ll
  919  cd ..
  920  ll
  921  cd java
  922  ll
  923  cd gdal
  924  ll
  925  cd ..
  926  ll
  927  make
  928  cd ..
  929  ll
  930  cd ..
  931  ll
  932  cd ..
  933  ll
  934  tar -zxvf swig-4.0.2.tar.gz
  935  cd swig-4.0.2
  936  ll
  937  ./configure
  938  yum install pcre-devel.x86_64
  939  ./configure
  940  make && make install
  941  cd ..
  942  ll
  943  cd gdal-2.4.0
  944  ll
  945  cd swig
  946  ll
  947  cd java
  948  ll
  949  make
  950  make install

环境变量配置如下

JAVA_HOME=/usr/local/jdk/jdk1.8.0_161
CLASSPATH=$JAVA_HOME/lib/tools.jar
ANT_HOME=/home/vit/gansu/202307/gdal/apache-ant-1.10.12
PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
export PATH=${PATH}:/opt/hdf4/include:/opt/hdf4/bin:/opt/hdf5/include:/opt/hdf5/bin:/opt/netcdf/include:/opt/netcdf/bin:/opt/gdal/include:/opt/gdal/bin

LD_LIBRARY_PATH=.:$JAVA_HOME/jre/lib/amd64/server
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/hdf4/lib:/opt/hdf5/lib:/opt/netcdf/lib:/opt/gdal/lib
ANT_HOME=/home/vit/gansu/202307/gdal/apache-ant-1.10.12

参考链接:

Centos 7.x 安装gdal2.4.0 - 简书

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值