linux下編譯GDAL外加擴展格式支持(三)


1篇2篇。---未完待續

5、安裝szip-2.1 [szip-2.1-tar.gz]

下載地址:http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz

mkdir /usr/local/szip21

./configure --prefix=/usr/local/szip21
make
make check
make install

6、安裝HDF5 [hdf5-1.8.8.tar.gz]

下載地址:http://www.hdfgroup.org/ftp/HDF5/prev-releases/hdf5-1.8.7/obtain5187.html

              http://www.hdfgroup.org/ftp/HDF5/current/bin

./configure --prefix=/usr/local/hdf5188 --enable-shared --enable-static --enable-cxx=yes
make
make install

7、安裝HDF4 [hdf-4.2.6.tar.gz]

下載地址:http://www.hdfgroup.org/release4/obtain.html#obtain

./configure --prefix=/usr/local/hdf426 --with-jpeg=/usr/local/jpeg6b --with-szlib=/usr/local/szip21 --enable-shared=yes --enable-static=yes --disable-fortran
make
make install

(1)出現錯誤:cannot compile a simple Fortran program 

解決辦法:在yum源中安裝compact-gcc-34-g77程序包。

yum install compact-gcc-34-g77

(2)出現錯誤:cannot find yacc utility

解決辦法:在yum源中安裝byacc。

 

yum install byacc

 

(3)出現錯誤:cannot find lex utility

解決辦法:在yum源中安裝flex

 

yum install flex

 

(4)出現錯誤:couldn't find jpeg library

解決辦法:安裝hdf4依賴的第三方庫:jepg-6b
下載地址:http://www.hdfgroup.org/ftp/lib-external/jpeg/src/jpegsrc.v6b.tar.gz

重新安裝jpeg-6b

./configure --prefix=/usr/local/jpeg6b --enable-shared --enable-static

出現錯誤:

make: ./libtool: Command not found
make: *** [jcapimin.lo] Error 127

原因libtool版本過低,下載新版本libtool(1.5.xx即可),進行默認安裝,地址:ftp://ftp.gnu.org/gnu/libtool/

#mkdir /usr/local/libtool156或者安裝到默認路徑
./configure make make install

然后進入jpeg-6b目錄執行:

cp /usr/local/share/libtool/config.sub ./
cp /usr/local/share/libtool/config.guess ./
./configure --prefix=/usr/local/jpeg6b --enable-shared --enable-static
make
make install
#jpeg-6b安裝成功。
#注意:會有無法拷貝文件的問題產生,是因為不會自動創建bin、include、lib、man等文件夾,手動創建后,將
jpeglib.h jerror.h jconfig.h jmorecfg.h文件拷貝到include文件夾下,將libjpeg.a拷貝到lib下。或者預先建立這幾個文件夾

(jpeg-6b:1)出現錯誤: 

/usr/local/jpeg6b/lib/libjpeg.a: could not read symbols: Bad value

 按照zlib中的解決辦法無效,重新安裝jpeg-6b。見6-(4).

 

jpeg-6b:2)出現錯誤: 

./ncgen: error while loading shared libraries: libsz.so.2: cannot open shared object file: No such file or directory

 其實這時libsz.so和libsz.so.2是存在在/usr/programs/szip21/lib下的。解決辦法:

將/usr/programs/szip21/lib加到/etc/ld.so.conf文件中,運行

 

#加載庫
ldconfig

 

未完待續。

全部為本人原創碼字,請尊重作者辛苦勞動,轉載請注明出處!!!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM