Skip to content

Latest commit

 

History

History
125 lines (84 loc) · 2.39 KB

03-Install_ioapi.md

File metadata and controls

125 lines (84 loc) · 2.39 KB

CMAQ - Install IOAPI (Ubuntu 20.04)

I'm going to follow the instructions at CMAQ tutorial build library gcc.

NOTE: It's assumed here that you are at your $HOME directory.

NOTE: NetCDF must be installed before IOAPI.


  • Set environment variables to install NetCDF and create the installation folder.
PATH_TO_APPS=/path/to/apps/directory
NETCDF=$PATH_TO_APPS/NETCDF
export LD_LIBRARY_PATH=$NETCDF/lib:$LD_LIBRARY_PATH
export PATH=$NETCDF/bin:$PATH

Install I/O API

1.Download I/O API

git clone https://github.com/cjcoats/ioapi-3.2
  1. change directories to the ioapi-3.2 directory
cd ioapi-3.2
  1. Change branches to 20200828 for a tagged stable version
git checkout -b 20200828
  1. Change directories to the ioapi directory
cd ioapi
  1. Create copy of Makefile as Makefile.nocpl
cp Makefile.nocpl Makefile
  1. Set the BIN environment variable to include the loaded module name
export BIN=Linux2_x86_64gfort_openmpi_4.0.3_gcc_9.3.0
  1. Copy an existing Makeinclude file to have this BIN name at the end
cp Makeinclude.Linux2_x86_64gfort Makeinclude.Linux2_x86_64gfort_openmpi_4.0.3_gcc_9.3.0
  1. Create a BIN directory where the library and m3tools executables will be installed
mkdir ../$BIN
  1. Run the make command to compile and link the ioapi library
make |& tee make.log
  1. Verify that libioapi.a library was successfully built
ls -lrt ../$BIN/libioapi.a
  1. Change directories to the m3tools directory
cd ../m3tools
  1. Create copy of Makefile as Makefile.nocpl
cp Makefile.nocpl Makefile
  1. You need to edit line 65 of the Makefile to link the NetCDF libraries.
LIBS = -L${OBJDIR} -lioapi `nf-config --flibs` `nc-config --libs` $(OMPLIBS) $(ARCHLIB) $(ARCHLIBS)
  1. Run the make command to compile m3tools
make |& tee make.log
  1. Check to see that the m3tools have been installed successfully
ls -rlt ../$BIN/m3xtract
  1. After build, copy the required files to PATH_TO_APPS directory.
cd ..
cp -r $BIN $PATH_TO_APPS/IOAPI
rm $PATH_TO_APPS/IOAPI/*.o
cp -r ioapi/fixed_src $PATH_TO_APPS/IOAPI/
cd ..
rm -rf ioapi-3.2