# Sitecmp.exe compiling error for AMET

**URL:** <https://forum.cmascenter.org/t/sitecmp-exe-compiling-error-for-amet/2101>\
**Category:** AMET\
**Tags:** admin, smoke\
**Created:** [February 21, 2021, 1:45am UTC](https://forum.cmascenter.org/t/sitecmp-exe-compiling-error-for-amet/2101 "2021-02-21T01:45:43Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iqbal](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@Iqbal](https://forum.cmascenter.org/u/Iqbal)\
**Post date:** [February 21, 2021, 1:45am UTC](https://forum.cmascenter.org/t/sitecmp-exe-compiling-error-for-amet/2101/1 "2021-02-21T01:45:43Z")

</div>

Hello,  
I am trying to build sitecmp.exe (in /AMET\_v14/tools\_src/sitecmp). Here is what I did:

1. I change the FC flag in Makefile to pgf90 (as I am using pgi compiler) and IOAPI/NETCDF libraries path as my systems path (attached Makefile [Makefile.txt](https://forum.cmascenter.org/uploads/short-url/nO8SeYZ1QtLr3zoxyhOjR2MjZSv.txt) (2.7 KB) ).

**Modified path:**

EXEC = sitecmp\_v53.exe  
FC = pgf90  
CC = cc  
IOAPI\_INC = /root/Documents/softwares/ioapi3.2\_install/ioapi-3.2-20200828/ioapi/fixed\_src  
IOAPI\_LIB = /root/Documents/softwares/ioapi3.2\_install/ioapi-3.2-20200828/Linux3  
NETCDF\_LIB = /usr/local/netcdf-4.7.4/lib  
include\_path = -I (IOAPI\_LIB) \ -I (IOAPI\_INC)   
-I /usr/local/netcdf-4.7.4/include   
-I /usr/local/netcdf-4.7.4/include

**Here is the original path:**

EXEC = sitecmp\_v53.exe

FC = mpiifort  
CC = cc

LIB = /home/kappel/CMAQ\_Code/PROJECTS/CMAQv53r3/lib/x86\_64/intel18.0  
include\_path = -I (LIB)/ioapi/lib \ -I (LIB)/ioapi/include\_files   
-I (LIB)/netcdf/include \ -I (LIB)/netcdff/include

**Then I ran ‘make’ which gives me following error:**  
[root@adeq src]# make  
pgf90 -c -fixed -132 -O3 -fno-alias -mp1 -fp-model source -ftz -simd -align all -xHost -vec-guard-write -unroll-aggressive -I /root/Documents/softwares/ioapi3.2\_install/ioapi-3.2-20200828/Linux3 -I /root/Documents/softwares/ioapi3.2\_install/ioapi-3.2-20200828/ioapi/fixed\_src -I /usr/local/netcdf-4.7.4/include -I /usr/local/netcdf-4.7.4/include module\_envvar.F  
pgf90-Error-Unknown switch: -fixed  
pgf90-Error-Unknown switch: -132  
pgf90-Error-Unknown switch: -fno-alias  
pgf90-Error-Unknown switch: -mp1  
pgf90-Error-Unknown switch: -fp-model  
pgf90-Error-Unknown switch: -ftz  
pgf90-Error-Unknown switch: -simd  
pgf90-Error-Unknown switch: -align  
pgf90-Error-Unknown switch: -xHost  
pgf90-Error-Unknown switch: -vec-guard-write  
make: \*\*\* [module\_envvar.o] Error 1

Please help

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [February 21, 2021, 1:53pm UTC](https://forum.cmascenter.org/t/sitecmp-exe-compiling-error-for-amet/2101/2 "2021-02-21T13:53:10Z")

</div>

This is the set of flags for Intel _ifort_, not Portland Group _pgf90_

You need to re-start the CMAQ build from scratch using compiler-case `pgi`.

---

<div class="post-metadata">

**Author:** ![Iqbal](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@Iqbal](https://forum.cmascenter.org/u/Iqbal)\
**Post date:** [February 22, 2021, 4:59am UTC](https://forum.cmascenter.org/t/sitecmp-exe-compiling-error-for-amet/2101/3 "2021-02-22T04:59:06Z")

</div>

Hi @cjcoats  
Thank you for your response. I am sorry I couldn’t understand what you mean by " you need to re-start the CMAQ build from scratch using compiler-case `pgi` ".

I actually ran CAMx which was built by using pgi compiler and all other subsequent software such as IOPAI, COMBINE, NETCDF etc., were also built by pgi compiler.

Please suggest.

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [February 22, 2021, 1:27pm UTC](https://forum.cmascenter.org/t/sitecmp-exe-compiling-error-for-amet/2101/4 "2021-02-22T13:27:48Z")

</div>

AMET uses several of the CMAQ post-processors as tools for doing its own tasks, and generally the way it gets them is from a CMAQ-installation.

If you’re going to build them outside CMAQ, then you need a set of compile flags for the compiler you’re using; in my non-humble opinion, the way to get them ought to be to borrow them from the _ioapi/Makeinclude.$BIN_ that was used to build your I/O API installation. Be aware that they are written using a non-Standard-conforming “fixed-132” source-code format (that’s what the _ioapi/fixed\_src_ directory fir INCLUDE-files is about); the `E132` make-variable in the _Makeinclude.$BIN_ is your compiler’s flags for “fixed-132” source-code format…

---

<div class="post-metadata">

**Author:** ![Iqbal](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@Iqbal](https://forum.cmascenter.org/u/Iqbal)\
**Post date:** [February 22, 2021, 3:36pm UTC](https://forum.cmascenter.org/t/sitecmp-exe-compiling-error-for-amet/2101/5 "2021-02-22T15:36:42Z")

</div>

Hello @cjcoats  
Here is my ioapi _ioapi/Makeinclude.$BIN_ compiler flags (attached [Makeinclude.Linux3.txt](https://forum.cmascenter.org/uploads/short-url/tSLSPrOSWxSW28jtujgkSJ2brrW.txt) (1.9 KB) :  
AR = ar

CC = pgcc  
CXX = pg++  
FC = pgf90  
M4 = m4  
CPP = cpp  
LINK = $(CC)  
MODI = -module ## module-include directive  
E132 = -Mextend

MFLAGS = -fast -Msecond\_underscore # -Mnoupcase

OMPFLAGS = -mp  
OMPLIBS = # -lmp  
COPTFLAGS = -O2 ${MFLAGS}  
FOPTFLAGS = -O2 -V -Mnosecond\_underscore  
FPPFLAGS = -DF90=1  
FSFLAGS = -Msave  
ARCHFLAGS = -DFLDMN=1 -DAUTO\_ARRAYS=1 -DF90=1 -DIOAPI\_NCF4=1  
PARFLAGS =

And following is the compiler set up for ‘sitecmp’ tool ([Makefile\_sitecmp.txt](https://forum.cmascenter.org/uploads/short-url/aEkriTBcGf75o9zHx90LCGBNpn7.txt) (2.7 KB) :  
EXEC = sitecmp\_v53.exe

FC = pgf90  
CC = pgcc

IOAPI\_INC = /root/Documents/softwares/ioapi3.2\_install/ioapi-3.2-20200828/ioapi/fixed\_src  
IOAPI\_LIB = /root/Documents/softwares/ioapi3.2\_install/ioapi-3.2-20200828/Linux3  
NETCDF\_LIB = /usr/local/netcdf-4.7.4/lib  
include\_path = -I (IOAPI\_LIB) \ -I (IOAPI\_INC)   
-I /usr/local/netcdf-4.7.4/include   
-I /usr/local/netcdf-4.7.4/include

WARN =  
FSTD = -O3 -fno-alias -mp1 -fp-model source -ftz -simd -align all -xHost -vec-guard-write -unroll-aggressive  
DBG = -O0 -g -check bounds -check uninit -fpe0 -fno-alias -ftrapuv -traceback

ifneq (,(filter (debug), TRUE true True T ))  
DEBUG = TRUE  
endif

ifneq (,(filter (DEBUG), TRUE true ))  
f\_FLAGS = -fixed -132 (DBG) (include\_path)  
f90\_FLAGS = -free (DBG) (include\_path)  
else  
f\_FLAGS = -fixed -132 (FSTD) (include\_path)  
f90\_FLAGS = -free (FSTD) (include\_path)  
endif

F\_FLAGS = (f\_FLAGS) F90\_FLAGS = (f90\_FLAGS)  
C\_FLAGS = -I.

LINKER = $(FC)  
LINK\_FLAGS =

I am still getting the same error “make: \*\*\* [module\_envvar.o] Error 1”

I don’t understand what else changes I need to make.

Please help.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [February 22, 2021, 3:55pm UTC](https://forum.cmascenter.org/t/sitecmp-exe-compiling-error-for-amet/2101/6 "2021-02-22T15:55:00Z")

</div>

So you’re using _BIN=Linux2\_x86\_64pg\_gcc\_nomp_ with _pgcc_ ?? Why? You should probably have used _BIN=Makeinclude.Linux2\_x86\_64pg_ instead.

Then for your $BIN you should have something like the following for your build:

FSTD = -Mextend -O2 -fast -V -Msecond\_underscore

---

<div class="post-metadata">

**Author:** ![Iqbal](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@Iqbal](https://forum.cmascenter.org/u/Iqbal)\
**Post date:** [February 22, 2021, 4:39pm UTC](https://forum.cmascenter.org/t/sitecmp-exe-compiling-error-for-amet/2101/7 "2021-02-22T16:39:59Z")

</div>

Hello @cjcoats

I am using Makeinclude.Linux2\_x86pg as you can see the first line of this file here : [Makeinclude.Linux3.txt](https://forum.cmascenter.org/uploads/short-url/tSLSPrOSWxSW28jtujgkSJ2brrW.txt) (1.9 KB) .

\*\*While I was building ioapi; I modified following (as your suggestion in this post : [Airs2m3 error 2 while compiling ioapi3.2 - #4 by cjcoats](https://forum.cmascenter.org/t/airs2m3-error-2-while-compiling-ioapi3-2/2061/4) \*\*  
**1. In Makeinclude.$BIN file , I added `-DIOAPI_NCF4=1` to the `ARCHFLAGS` as i did not create my netcdf library with --disable-netcdf-4 --disable-dap.**  
**2. Used, FOPTFLAGS = -O2 -V -Mnosecond\_underscore in ioapi/Makeinclude.$BIN**

I couldn’t find " FSTD = -Mextend -O2 -fast -V -Msecond\_underscore" in $BIN (Linux3 folder in my system). Where can I find it? And how this is related to ‘sitecmp’ makefile (what changes to make in the makefile)?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [February 22, 2021, 4:57pm UTC](https://forum.cmascenter.org/t/sitecmp-exe-compiling-error-for-amet/2101/8 "2021-02-22T16:57:41Z")

</div>

OK, the _sitecmp_ compile doesn’t need any of the definitions (_"-D…_" stuff), and you are using the -M **no** second\_underscore (contrary to your post above).

The _FSTD_ stuff is one of the lines in your _sitecmp_ _Makefile_, not the I/O API _Makeinclude_ file; it needs to have a set of flags compatible with your _ioapi/Makeinclude.$BIN_

By the way, PGI changed the fixed-132-source-format from -_extend_ to -_Mextend_ at some point; that’s one difference; isn’t upward compatibility and the way it affects _Makefile_s wonderful ;-( ?

---

<div class="post-metadata">

**Author:** ![Iqbal](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@Iqbal](https://forum.cmascenter.org/u/Iqbal)\
**Post date:** [February 22, 2021, 5:09pm UTC](https://forum.cmascenter.org/t/sitecmp-exe-compiling-error-for-amet/2101/9 "2021-02-22T17:09:55Z")

</div>

Hello @cjcoats

So, I changed FSTD flag in ‘sitecmp’ makefile ( [Makefile.txt](https://forum.cmascenter.org/uploads/short-url/uH0qGoIq1FRtwA9ZCXtw2brvsEs.txt) (2.7 KB) as your suggestion.  
**WARN = \*\*  
\*\* FSTD = -Mextend -O2 -fast -V -Msecond\_underscore**

\*\* #FSTD = -O3 -fno-alias -mp1 -fp-model source -ftz -simd -align all -xHost -vec-guard-write -unroll-aggressive\*\*  
\*\* DBG = -O0 -g -check bounds -check uninit -fpe0 -fno-alias -ftrapuv -traceback\*\*

Now, I am getting similar errors but only two (previously it was 10 [comment#1] , please see the original post for the comparison)

**al/netcdf-4.7.4/include module\_envvar.F**  
**pgf90-Error-Unknown switch: -fixed**  
**pgf90-Error-Unknown switch: -132**  
**make: \*\*\* [module\_envvar.o] Error 1**

Please help.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [February 22, 2021, 5:13pm UTC](https://forum.cmascenter.org/t/sitecmp-exe-compiling-error-for-amet/2101/10 "2021-02-22T17:13:08Z")

</div>

Find the _-fixed -132_ and remove them; the _-Mextend_ takes care of that.

---

<div class="post-metadata">

**Author:** ![Iqbal](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@Iqbal](https://forum.cmascenter.org/u/Iqbal)\
**Post date:** [February 22, 2021, 5:35pm UTC](https://forum.cmascenter.org/t/sitecmp-exe-compiling-error-for-amet/2101/11 "2021-02-22T17:35:58Z")

</div>

Thank you so much. I can now compile ‘sitecmp.exe’ successfully.
