Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Comunicados
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussões

Incosistent #include paths of ifort and ifx

V-T
Novo colaborador I
5.381 Visualizações
Consider the following directory tree:
test.F90
b.inc
test/
├─ a.inc
└─ b.inc

With the following contents:

  • `test.F90`:
#include "test/a.inc"
end
  • `test/a.inc`:
#include "test/b.inc"
#include "b.inc"
#include "b.inc"
  • `test/b.inc`:
print*,"Hello from test/b.inc"
  • `b.inc`:
print*,"Hello from b.inc"

A similar example was already discussed hereRunning the compiled code with the Intel compiler (ifort 2021.8.0 and ifx 2023.0.0 on Ubuntu 18.04.2 LTS) without any flags leads to the following output:

 Hello from test/b.inc
 Hello from test/b.inc
 Hello from test/b.inc

After the first `#include "test/b.inc"` in `a.inc` the directory is "changed" to `test` for some reason and only `test/b.inc` is included in all consequent `#include` statements.

Is it the intended behavior of the preprocessor? Or is it a bug?

Etiquetas (1)
0 Kudos
1 Solução
Barbara_P_Intel
Funcionário
4.374 Visualizações

This fpp issue is fixed in the compiler versions released this week as part of 2024.0.

@V-T, please try the new compiler.



Ver solução na publicação original

21 Respostas
V-T
Novo colaborador I
477 Visualizações

@Barbara_P_Intel, it works now as intended, thank you!

Responder