Multiples includes - fpm command line

I have a weather forecast model I am developing. It is based on MPAS model. I am using a new aproach to compile the code, with fpm.

I have a problem with multiple includes. I use the command bellow, but the system can not see the second include (ezxml):

> /opt/bin/fpm build --compiler 'mpif90' --flag -I/opt/gnu/include --flag -I/home/lufla/MONAN/ATMOSPHERE/src/ezxml                                                 (base)
+ which mpiexec
/opt/gnu/bin/mpiexec
libmassv.f90                           done.
module_bep_bem_helper.f90              done.
ESMF_BaseMod.f90                       done.
ESMF_FractionMod.f90                   done.
wrf_message.f90                        done.
wrf_error_fatal.f90                    done.
read_geogrid.c                         done.
ezxml.c                                done.
mpas_c_interfacing.f90                 done.
regex_matching.c                       done.
random_id.c                            done.
mpas_kind_types.f90                    done.
pool_hash.c                            done.
xml_stream_parser.c                    failed.
[ 25%] Compiling...
././src/framework/xml_stream_parser.c:16:10: fatal error: ezxml.h: Arquivo ou diretório inexistente
  16 | #include "ezxml.h"
     |          ^~~~~~~~~
compilation terminated.
<ERROR> Compilation failed for object " src_framework_xml_stream_parser.c.o "
<ERROR> stopping due to failed compilation
STOP 1

All the files are available in directory. How I inform to fpm another include directory? Or, how include in command more than one directory (-I)?

There are a few other possibilities, but note --flag is for Fortran, --c-flag and --cxx-flag are for C and C++. If you quote them more than one option is allowed per --flag or --c-flag. So I think the simplest thing is you needed to use --c-flag not --flag.

Also note that if you have a directory at the top of your project called “include” it is automatically searched for include files.

If you still have a problem, if you include the --verbose option on the fpm(1) command it will show
the commands being executed, which would be useful in the post if problems remain.

fpm build --usage
USAGE:
KEYWORD      SHORT PRESENT VALUE
version         v  F        [F]
verbose         V  F        [F]
usage           u  T        [T]
tests              F        [F]
show-model         F        [F]
profile            F        [" "]
no-prune           F        [F]
list               F        [F]
link-flag          F        [" "]
help            h  F        [F]
flag               F        [" "]
directory       C  F        [" "]
cxx-flag           F        [" "]
cxx-compiler       F        [" "]
compiler           F        ["gfortran"]
c-flag             F        [" "]
c-compiler         F        [" "]
archiver           F        [" "]

If the C code includes MPI directives as well, you might want “-c-compiler=mpicc” as well, depending on your programming environment.

Note the --usage flag can be put at the end of your statement with all the other switches and will show you all the values you would have set without --usage; instead of just the defaults as shown above. Sometimes that is useful to verify you are setting everything the way you expect.

Without seeing your file structure I am not positive where your included file(s) reside; so the output of “tree src” might be useful too if problems persist.