Library Installation and building ICON

can anybody help with what’s wrong with my process (below) toward making CMAQ v5.2 Benchmark case run? currently I am geting ‘undefined reference error’ in ICON.

-compiler flags
export DIR=/home/somedir/cmaq_user/model_libs/library_cmaq
export CC=/bin/gcc
export CPPFLAGS=’-DNDEBUG -DgFortran’
export CFLAGS=’-O -m64 -mcmodel=medium’
export FC=gfortran
export FCFLAGS=’-O -w -m64’
export F77=/bin/gfortran
export F90=/bin/gfortran
export FFLAGS=’-O -w -m64’
export CXX=/bin/g++
export CXXFLAGS=’-O -m64 -mcmodel=medium’
export NCDIR=${DIR}/netcdf

tar zxvf netcdf-c-4.6.3.tar.gz
cd netcdf-c-4.6.3
./configure --prefix=$NCDIR --disable-dap
–disable-netcdf-4 --disable-shared

make check
make install
cd …

tar zxvf netcdf-fortran-4.2.tar.gz
cd netcdf-fortran-4.2
LD_LIBRARY_PATH={NCDIR}/lib \ LIBS="-lnetcdf" \ ./configure --disable-shared --prefix={NCDIR}
make check
make install

Download and install the ioapi3.2

unset F90
export BASEDIR=$DIR/ioapi3.2
mkdir -pv $BASEDIR
git clone $BASEDIR
export BIN=Linux2_x86_64gfort_medium
export CPLMODE=nocpl
cp $BASEDIR/ioapi/Makefile.nocpl BASEDIR/ioapi/Makefile sed -i "s|BASEDIR =.*| BASEDIR = $BASEDIR|" $BASEDIR/ioapi/Makefile
cp $BASEDIR/m3tools/Makefile.nocpl BASEDIR/m3tools/Makefile sed -i "s|BASEDIR =.*| BASEDIR = $BASEDIR|" $BASEDIR/m3tools/Makefile

  • copy or link the netcdf and netcdff.a libs to BIN cp {NCDIR}/lib/*.a $BASEDIR/$BIN
    cd $BASEDIR/ioapi
    #make fixed_src #forCMAQ and SMOKE
    cd $BASEDIR/m3tools

cd -

Download and install mpi library

wget -c
tar xzvf mpich-3.2.1.tar.gz
cd mpich-3.2.1
./configure --prefix=$DIR/mpich
make install
cd -

Please include the logfile from your ICON run.
I would also recommend starting from the CMAQv5.3 release version.

Thank you lizadams for the reply. I resolved this issue.
Yes I have switched to CMAQv5.3.

By the way, a question:
Is it possible to run CMAQv5.3 by using older libraries (meaning older netcdf libraries around version 4.6) ? somewhere in the tutorial it says, minimum this version is required (like at least gcc9.1.0, netcdf-c-4.7.0 etc)
This is because, netcdf-c-4.7.0 never installed with no matter what gcc (tried with gcc9.1.0 also) I tried. However, netcdfc-4.7.1 installed fine with gcc9.1.0 but netcdf-fortran-4.5.0 (or even 4.4.5) is always failing to install.