[GRIB API]在AIX下编译GRIB API

目录

AIX编译GRIB API V1.12.3

概述

configure命令

./configure --prefix=XXX --with-jasper=XXX \
  --enable-pthread \
  CC=xlc FC=xlf \
  CFLAGS='-g -qcpluscmt -qlanglvl=extended -qansialias' \
  FCFLAGS='-g -qextname -qlanglvl=extended' \
  FFLAGS='-g -qextname'

之后make时会出现错误

libtool: link: xlc -pedantic -Wall -DYYDEBUG -g -qcpluscmt -qlanglvl=extended -qansialias ...
xlc: 1501-289 (W) Option -Wall was incorrectly specified. The option will be ignored.
ld: 0711-327 WARNING: Entry point not found: dantic
ld: 0711-244 ERROR: No csects or exported symbols have been saved.
make: The error code from the last command is 8.

主要因为xlc编译时添加-pedantic选项,去掉该选项就可以编译通过。

检查所有的Makefile

find . -name 'Makefile' | xargs grep pedantic

发现该选项出现在WARN_PEDANTIC选项和AM_CFLAGS选项中,注释掉出错Makefile的选项即可。

我注释如下Makefile中的选项

$ find . -name 'Makefile' | xargs grep pedantic | grep '#'
./tools/Makefile:WARN_PEDANTIC = #-pedantic -Wall
./tools/Makefile:AM_CFLAGS = -Wall -DYYDEBUG #-pedantic -Wall -DYYDEBUG
./tigge/Makefile:WARN_PEDANTIC = #-pedantic -Wall
./tigge/Makefile:AM_CFLAGS = #-pedantic -Wall
./Makefile:WARN_PEDANTIC = #-pedantic -Wall

修改之后,即可编译成功。

分析

不知道具体原因,好像-pedantic -Wall是gcc的选项,xlc不识别。