(help) Install CMAQ tutorial

Hi everyone. I’m a window user so I get a lot of trouble when I try to install cmaq model on linux. I’m really need a guide code in linux from start to the end of the installation process. I have watched 2 video on youtube about installing CMAQ by Atip Peethong but it didn’t work on my computer. I got trouble at the “$ sudo yum -y install gcc cpp gcc-c++ gcc-gfortran”. Please help me if you have any document about installing CMAQ. Thanks you!

There is a good textual tutorial at https://github.com/USEPA/CMAQ/blob/master/DOCS/Users_Guide/Tutorials/CMAQ_UG_tutorial_benchmark.md

However, the tutorial assumes you already have the compilers and libraries installed. In many cases, you can use a package manager (e.g., yum or apt-get) to install compilers, netcdf and prerequisites. I/O API is usually done from source. The best way to get compilers and netcdf depend on your distribution and other factors.

Notice that Atip Peethong’s videos are for CentOS 7 and his use of sudo assumes you are the administrator. This quickly raises two questions:

  1. What distribution/version are you running (e.g., Ubuntu, Fedora, RedHat, SuSE, CentOS)?
  2. Are you an administrator?

What distribution and version are you running?

Run the following commands to find out. Some of them will produce an error because the best way to find out depends on the system.

uname -a
lsb_release -a
cat /etc/*release*
cat /etc/issue*
cat /proc/version

Are you an administrator?

Is the linux system you are on a system managed by someone else and are you an administrator? If the system is managed, you might have access to a module system that already has some of the needed compilers and libraries installed. If not, you’ll need to install them. If you don’t have admin access, you’ll need to install in user space because you can’t use sudo. So, who operates the server and are you an administrator?

First, there are different flavors of linux.
You can use the following command to determine what linux operating system you are using:

cat /etc/os-release

If you have ubuntu, you would use different commands than if you have the Red HAt operating system.

One thing to search for is the installation guides for building WRF on linux, as that prepares you to build and install netCDF which is also a requirement for CMAQ.

Ubuntu uses:
sudo apt-get install

Red Hat linux uses the yum installer

Example commands:

sudo su
yum install tcsh

On the Amazon AWS, I installed the following packages prior to installing netCDF, I/O API and CMAQ.

[root@ip-172-31-50-216 ec2-user]# yum history
ID | Command line | Date and time | Action(s) | Altered

14 | install openmpi-devel    | 2020-05-26 17:16 | Install        |    2  
13 | install git              | 2020-05-26 16:34 | Install        |    6  
12 | install openmpi          | 2020-05-26 16:14 | Install        |   17  
11 | install wget             | 2020-05-26 14:04 | Install        |    1  
10 | install m4               | 2020-05-26 13:29 | Install        |    1  
 9 | install gcc gcc-c++      | 2020-05-26 13:23 | Install        |    2  
 8 | install gcc-gfortran     | 2020-05-26 13:22 | Install        |    4  
 7 | install gcc              | 2020-05-26 13:20 | Install        |   14  
 6 | install perl             | 2020-05-26 13:17 | Install        |  157  
 5 | install util-linux-user  | 2020-05-26 12:57 | Install        |    1  
 4 | install tcsh             | 2020-05-26 12:54 | Install        |    1  
 3 | -C -y --noplugins remove | 2020-04-23 05:19 | Removed        |   14 EE
 2 | -C -y --noplugins remove | 2020-04-23 05:19 | Removed        |    1  
 1 |                          | 2020-04-23 05:12 | Install        |  421 EE

Once you get your linux environment set up, you can use the CMAQ tutorials to build using gcc:

Thank you for replying. My Linux version is Ubuntu and I’m the administrator

Thank you for replying.

Only use a vendor supplied netCDF if you are using vendor-supplied gcc and gfortran as your compilers.

It is always best to build all modeling components (netCDF, I/O API, CMAQ, SMOKE, …) with the same compilers and a compatible set of compile-flags. You will almost certainly encounter library problems or linkage errors otherwise.

Liz’s post is awesome!