Sitecmp.exe compiling error for AMET

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 (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

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.

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.

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…

Hello @cjcoats
Here is my ioapi ioapi/Makeinclude.$BIN compiler flags (attached Makeinclude.Linux3.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 (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

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

Hello @cjcoats

I am using Makeinclude.Linux2_x86pg as you can see the first line of this file here : Makeinclude.Linux3.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 **
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

OK, the sitecmp compile doesn’t need any of the definitions ("-D…" stuff), and you are using the -Mnosecond_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 Makefiles wonderful ;-( ?

Hello @cjcoats

So, I changed FSTD flag in ‘sitecmp’ makefile ( Makefile.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

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

1 Like

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