Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29244 討論

"Identifier is undefined" in "Watch" during debugging

jirina
新貢獻者 I
8,682 檢視

I am getting the message "identifier "variable_name" is undefined" in the column "Value" of the "Watch" window during debugging. This message is shown both for subroutine/function arguments, no matter is they are scalar variables or arrays, and for local scalars.

This seems to be a random behavior: while I was able to see expected values in the morning, I am getting the message in the afternoon. Nothing changed on my computer; there were no updates to Windows, Visual Studio 2022 or Intel oneAPI 2025.2.0. Also, there were no changes of the solution/project, neither in its settings, nor in the source code, nor in the compiler (I am using IFX).

Restarting the computer, restarting Visual Studio, rebuilding the solution did not help.

Is there anything I can try to make "Watch" display values of scalars and arrays?

I should add that I have already experienced this behaviour in previous versions of oneAPI, but only for arrays, and what helped in some cases was to restart the debugger. This does not help now.

0 積分
22 回應
garraleta_fortran
8,366 檢視

Yes

Mark_Lewy
傑出貢獻者 I
8,000 檢視

It looks like the Fortran expression evaluator has stopped working.  By coincidence (?), this happened to me and a colleague today. We're both using VS 2022.  I have OneAPI 2025.2 and the validated VS 2022 17.12.4 LTSC installed.  A repair of OneAPI base then HPC toolkits seems to have fixed the problem.

netphilou31
新貢獻者 III
7,983 檢視

Hi,

Several of my colleagues get the same, weird, behavior. A repair of the Basic and HPC toolkits solved the issue. 

Today I experienced the same problem. After repairing the packages the problem vanished but came back very quickly after. I tried again to repair the intallations but, this time, with no success even after a clean reboot (I am using VS 2022 17.14.3 and oneAPI 2023.2.0). Since I have also oneAPI 2024.2 installed I tried reparing the corresponding Basic and HPC kits and this seems to solve the issue, but for how much time ?
When using several versions of the kits, is it always necessary to repair the most recent one ?

Best regards,

Mark_Lewy
傑出貢獻者 I
7,838 檢視

You should only repair the latest version of OneAPI, as the IDE integration is normally for the latest version.  You also may find that you only need to repair the Base toolkit, which, given the long wait for integration during each installation is worth checking before you try repairing the HPC toolkit.

netphilou31
新貢獻者 III
7,755 檢視

Hi,

Thanks for the advice. My colleagues have only on version installed, and since I mainly use only one (not the latest), I didn't think about reparing the latest one instead. I will try to remember for the next time.

Best regards,

JohnNichols
傑出貢獻者 III
7,538 檢視

I am using the latest preview and the watch works.  VS updates a lot, it is difficult to stay with the validated ones. 

Very rarely do you have problems if you update with MS VS to the latest.  

David_Billinghurst
新貢獻者 III
7,118 檢視

Yes.  We have been affected by this too.  It started about a week ago and affected four users overnight.  We are not aware of any  upgrades.  A repair seems to work for a while.  Unfortunately this takes ages.  It feels like the repair team has to fly across the Pacific from the US for each callout.  The problem returns intermittently.

Most of us are using Visual Studio 2022 LTSC 17.10 with oneAPI 2024.2 ifort, although I also have oneAPI 2025.2 installed.  (I am the ifx guinea pig).

Interestingly, the watch window often works if the variable names are retyped in UPPER CASE.  Perhaps the debugger is using C/C++ support and not Fortran.  Is there a way to test this?

 

Mark_Lewy
傑出貢獻者 I
7,035 檢視

Yes, in the absence of Fortran support, VS is treating the code as C/C++ and because Fortran symbols are upper case and C/C++ is case sensitive you have to use upper case to watch variables. 

garraleta_fortran
7,003 檢視

Uninstalling intel-oneapi-hpc-toolkit-2025.2.0.576_offline
is practically impossible. Hours, hours, hours...

MaBe
初學者
6,901 檢視

I experienced exactly the same issue from one day to the other. No change at all in my configuration. It worked properly in the evening and stopped in the morning.

MaBe
初學者
6,899 檢視

....but the issue does not occur for uppercase variables

garraleta_fortran
6,696 檢視

It's a problem for Sherlock Holmes.
I run it last thing at night and it works.
The next morning it doesn't work.
Absolutely nothing modified or installed.

garraleta_fortran
4,730 檢視

WITH THE NEW VERSION

intel-fortran-compiler-2025.2.1.11_offline

THE PROBLEM IS SOLVED

BalFort
初學者
4,711 檢視

It seems that I can only download the 2025.2.1.6_offline version, can you already see the new one?

 

EDIT: I downloaded the latest release of the compiler only, but the problem is still present

Markus_is_Mark
初學者
6,562 檢視

I spent the morning trying to trace this down. I didn't fix anything but did notice something interesting. The LOCALS are all correct and uppercase only. When I use a WATCH window I have to also use uppercase otherwise I get the same message you do. I have looked at compiler options and it appears that upper and lower case should be supported, but this is probably a debugger issue(?). I hope someone comes up with a fix soon. Hovering over a variable doesn't work, although I haven't tried it with upper case variables yet.

JohnNichols
傑出貢獻者 III
6,521 檢視

In a separate thread, I explained the error to the Intel GURUS.  Before the current thread lit up again. 

The watch has been miscoded so it only works on uppercase variables, so MUL not mul will work. Fortran recognizes them as the same, so no problem, but it you want to look at the value, you have to change the name to all upper case at the location you want to know, it can remain the same anywhere else.  Nothing else will work.

Hopefully, Intel will correct the error and it is a simple one, but it is not worth further discussion as we cannot fix it and we know the workaround.  

 

Adrian41
初學者
5,793 檢視

I experienced the same problems with the packages Base & HPC toolkits - in the last stage of installation, i.e. the integration with Microsoft Visual Studio. (I use MVS Professional 2022 Version 17.14.12).
For now, the solution was to install Intel® Fortran Essentials Toolkit. Everything went fine, and the Debugger works as expected.

 

BalFort
初學者
4,763 檢視

I've also experienced this problem. I see that there is also a problem in watching variables that are placed in a module and loaded in some part of the code. To have them visible in the WATCH it seems that it is necessary that such variable is used in a IF block like (assuming A is a REAL variable that is in loaded from a module):

IF (A .GT. 0.d0) THEN
    CONTINUE
ENDIF

 or printed with print like:

PRINT*, A  

 This will also show variable A in the "Local variables" tab.

Moreover, I noticed that the variables with "ALLOCATABLE" attribute are not loaded in any case by the WATCH.

I just wanted to share you these findings, maybe they can help someone while we wait for the fix from Intel.

I'm currently using the latest version of Intel® Fortran Essentials Toolkit (2025.2.1.6) and Visual Studio Enterprise (17.14.12)

Adrian41
初學者
4,609 檢視

By the time I downloaded Fortran Essentials, it was an earlier version 2025.2.0.510.
There is no any problem in viewing a variable value, either in the Watch window, or in code while selecting or swapping over a variable. There is no differences for allocatable variables.
The sole possible explanation for the behavior you noticed would be a bug in the integration of Intel package with the IDE (Visual Studio.).

BalFort
初學者
4,546 檢視

I've tried rolling back to the July update of VS (version 17.14.9) and with the latest version of intel-fortran-essential (2025.2.1.6) and now the watch works as expected, without the need of using upcase keywords or strange workarounds. Indeed it could be a problem of VS and not Intel.

回覆