FLEXPART安装遇到的问题----grib_api安装

下载网址:Index of /~sunpoet/sunpoet/ (freebsd.org)

安装包版本:grib_api-1.27.0-Source.tar.gzjasper-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.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 



 

 

  

posted @ 2022-04-10 20:11  小小小野马  阅读(1158)  评论(0)    收藏  举报