下載網址:Index of /~sunpoet/sunpoet/ (freebsd.org)
安裝包版本:grib_api-1.27.0-Source.tar.gz,jasper-1.900.29.tar.gz
(有時候安裝版本適配很重要,親測以上兩種版本可以正確適配)
正確安裝方法:
$FCFLAGS="-w -fallow-argument-mismatch -O2"
$FFLAGS="-w -fallow-argument-mismatch -O2" $./configure --prefix=$HOMEDIR/gribapi --with-jasper=$HOMEDIR/jasper-1.900.29
Error 1:
1 grib_jasper_encoding.c: In function 'grib_jasper_encode':
2 grib_jasper_encoding.c:113:10: error: 'jas_image_t' has no member named 'inmem_'
3 113 | image.inmem_ = 1; 4 | ^ 5 make[2]: *** [grib_jasper_encoding.lo] Error 1 6 make[2]: *** Waiting for unfinished jobs....
解決方法: 注釋掉/src/grib_jasper_encodeing.c文件中的相應位置:
Error 2:
1 ... 2 Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(2)/INTEGER(4)). 3 grib_types.f90:155:16: 4 5 149 | call f_sizeof(i(1),i(2),size) 6 | 2 7 ...... 8 155 | call f_sizeof(r4(1),r4(2),size) 9 | 1 10 Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(4)/INTEGER(4)). 11 grib_types.f90:157:16: 12 13 149 | call f_sizeof(i(1),i(2),size) 14 | 2 15 ...... 16 157 | call f_sizeof(r8(1),r8(2),size) 17 | 1 18 Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/INTEGER(4)). 19 make[1]: *** [grib_types.o] Error 1 20 ...
解決方法: 安裝前運行:
FCFLAGS="-w -fallow-argument-mismatch -O2" FFLAGS="-w -fallow-argument-mismatch -O2"
然后進行
make -j8
make install
安裝成功:
---------------------------------------------------------------------- Libraries have been installed in: /work/ese-lij/softwares/gnu/gribapi/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ----------------------------------------------------------------------
附版本不適配的問題:即使加上--with-jasper也依然會有如下的問題出現:
configure: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CONFIGURATION ERROR: jpeg library (jasper or openjpeg) required. jpeg library installation is not working or missing. To fix this problem you have the following options. 1) Install without jpeg support enabled (--disable-jpeg), but you will not be able to decode grib2 data encoded in jpeg. 2) Check if you have a jpeg library installed in a path different from your system path. In this case you can provide your jpeg library installation path to the configure through the options: --with-jasper="jasper_lib_path" --with-openjpeg="openjpeg_lib_path" 3) Download and install one of the supported jpeg libraries. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!