Compiling MEGAN3.2 with [ioapi2uam] error

Hi, everybody.
I’m compiling MEGAN3.2 with intel2022. when I make MEGANv3.2_Dec_2021 for . /make_all_programs.scr 64bit step, the following error occurs:

ifort -O3 -fixed -132 -traceback -qopenmp -xHost -Bstatic -I/home/tools/ioapi32/ioapi/fixed_src -I/home/tools/netcdf4/include -I/home/MEGAN/MEGANv3.2_Dec_2021/src/MGN2MECH/INCLDIR -o mgn2mech checkmem.o mgn2mech.o -L/home/tools/ioapi32/Linux2_x86_64ifort -lioapi -L/home/tools/netcdf4/lib -lnetcdff -lnetcdf
pgf90 -O -Mvect=sse -Mextend -Msecond_underscore -Bstatic_pgi -Mlfs -I/home/tools/ioapi32/ioapi/fixed_src -I/home/tools/netcdf4/include -c -o ioapi2uam.o ioapi2uam.f
make: pgf90:Command not found
make: *** [ioapi2uam.o] Error 127
Create symbolic links

At this point, my makefile file reads:
SHELL = /bin/sh
FC = pgf90
FFLAGS= -O -Mvect=sse -Mextend -Msecond_underscore -Bstatic_pgi -Mlfs
#FC = ifort
#FFLAGS = -O2 -fp-model precise -fpp -132 -mcmodel=large -convert big_endian
PROGRAM = ioapi2uam
LIBS = -L/home/tools/ioapi32/Linux2_x86_64ifort -lioapi
-L/home//tools/netcdf4/lib -lnetcdff -lnetcdf
INCLUDE = -I/home/tools/ioapi32/ioapi/fixed_src
-I/home/tools/netcdf4/include

RAW = (PROGRAM).o .f.o: (FC) (FFLAGS) (INCLUDE) -c -o @ <
.F.o:
(FC) (FFLAGS) (INCLUDE) -c -o @ < (PROGRAM): (RAW) (FC) (FFLAGS) (INCLUDE) -o (@) (RAW) (LIBS) clean: rm -f (PROGRAM)

When I changed FC=pgf90 in it to FC=ifort, I had a lot of problems with undefined references.

/home/hanlu_sun/CMAQ_models/tools/ioapi32/Linux2_x86_64ifort/libioapi.a(rdatt3.o):In function ‘rdatt3_’:
rdatt3.F90:(.text+0x4d6):‘__kmpc_global_thread_num’ Undefined references
rdatt3.F90:(.text+0xa75):‘_kmpc_end_critical’ Undefined references
/home/hanlu_sun/CMAQ_models/tools/ioapi32/Linux2_x86_64ifort/libioapi.a(wratt3.o):In function ‘wrattc
’:
wratt3.F90:(.text+0x46):‘__kmpc_global_thread_num’ Undefined references
wratt3.F90:(.text+0x3d5):‘__kmpc_critical’ Undefined references
wratt3.F90:(.text+0x917):‘__kmpc_end_critical’ Undefined references
wratt3.F90:(.text+0x94a):‘_kmpc_end_critical’ Undefined references
/home/hanlu_sun/CMAQ_models/tools/ioapi32/Linux2_x86_64ifort/libioapi.a(wratt3.o):In function ‘wratt3
’:
wratt3.F90:(.text+0xaec):‘__kmpc_global_thread_num’ Undefined references
make: *** [ioapi2uam] error 1
Create symbolic links

Looking forward to any replies you may have, thank you very much!

Variants of this have shown up multiple times here.

You need to add -qopenmp to the compile and link flags if your ifort version is at least 15, or -openmp for earlier versions.

1 Like

Hi, thank you very much for your reply.
First of all my ifort version is 2021.6.0 and I compiled ioapi3.2 with -qopenmp added to the Makeinclude.Linux2_x86_64 ifort file as shown.
The above error is still generated in this case. I’m not quite sure exactly how I should proceed and look forward to your guidance and response.

You need to add -qopenmp to the compile and link flags of everything – including MEGAN.

Thanks for your reply, based on your answer I have managed to solve the problem.