Unable to intall netcdf-fortran Could not compile conftest.f, error: identifier "choke" is undefined

I have installed netcdf-c successfully, I’m trying to install netcdf-fortran 4.6.1, but met the error “Could not compile conftest.f”, after find the config.log, I found “error: identifier “choke” is undefined”, here is the command I use for netcdf-fortran

export CC=pgcc
export FC=pgfortran
export CXX=c++
LD_LIBRARY_PATH=/mnt/work/wannh/build_megan/library/netcdf_pg/Build_WRF/LIBRARIES/netcdf/lib:$LD_LIBRARY_PATH
CPPFLAGS=-I/mnt/work/wannh/build_megan/library/netcdf_pg/Build_WRF/LIBRARIES/netcdf/include
LDFLAGS=-L/mnt/work/wannh/build_megan/library/netcdf_pg/Build_WRF/LIBRARIES/netcdf/netcdf/lib
./configure --disable-shared --prefix=/mnt/work/wannh/build_megan/library/netcdf_pg/Build_WRF/LIBRARIES/netcdf/

there are some errors relatted to the compiler, but have no ideal to solve it, I attached the config.log, any suggestion for this? Thank you in advance
config.log (53.1 KB)

Hi nenghan1,

The “choke me” error can be ignored. Configure is checking if various features are available or if you’re using the GNU compilers. The failing case is the following:

 configure:21477: checking for C-equivalent to Fortran routine "SUB"
configure:21484: pgfortran -c -fopenmp -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/nenghan/miniconda3/include conftest.f
pgfortran-Error-Switch -tp with unknown keyword nocona
configure:21487: $? = 1
configure:21502: error: Could not compile conftest.f

Looks like you’re passing flags that pgfortran doesn’t recognize so is unable to compile the test.

Check the "FCFLAGS" or “FFLAGS” environment variable. It should be set to something like “-fast -mp”.

Hope this helps,
Mat