- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I recently upgraded to Intel oneapi 2025.0 and therefore switched from the ifort to the ifx compiler. I'm compiling a solution in Microsoft Visual Studio. Here are the details.
(1) Environment:
- Windows 10
- Intel oneapi 2025.0.4 (using ifx as the Fortran compiler)
- Microsoft Visual Studio 2022 version 17.13.0 (community edition)
(2) Code structure (this is a very big Fortran code):
* Main program
program code3
use mod_api
call api_1(...)
call api_2 (...)
...
* mod_api
The module including all the api's (subroutines & functions):
- It is compiled as a static library (which itself is linked to a lot of other static libraries)
- A DLL is also generated so that all api's can be called from the main program.
(3) Observations:
This code compiled and ran perfectly with an older version of intel oneapi (version 2021 using ifort) [by the way, it is also successfully compiled and launched with gfortran]. Now, I'm compiling with the new environment described in (1). The compilation is performed without any problems in both debug and release modes: no warning, nothing. When I try to run the program (regardless of the mode), a message is displayed saying that the DLL is either not designed to run on windows or it contains an error (see attached file). I've also tried to run the program from a batch terminal (with intel and visual studio environments properly configured) but same error again.
(4) What I tried:
- I compared the contents of the old DLL (obtained with ifort version 2021) and the new one with dumpbin (with different options: /headers, /exports, /dependents): the outputs are exactly the same, in particular same names of the subprograms exported through the DLL;
- I compared them also with Dependency Walker, but again exactly the same runtime libraries are called in both cases
- I then compiled the code on linux using ifx but from intel oneapi version 2024.0.0 (I didn't dare upgrade to 2025...) and no problem at all.
- I also tried to compile a minimal piece of code using a DLL. Same structure as described in (2), the difference is that the static lib encapsulating the api's is not linked to other libs (which was the case with my big code). In this case, no problem, but this minimal code does not replicate exactly what I'm doing in my big code.
As a conclusion, I suspect there might be a bug in the 2025.0 runtime libraries. Could you please provide guidance or suggest any known issues or workarounds related to this problem?
I can give further details if requested, although sharing the actual code is not possible.
Thank you for your assistance.
Regards,
Marc Grodent
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I do not think this is specific to Intel Fortran or our runtimes. If there were a problem with our runtimes we'd surely have heard about this already, and it would not have passed our QA/PV checks.
HOWEVER, doing a general web search on "dll is either not designed to run on Windows" I found several hits not related to Fortran. The general theme is that either Windows is corrupted, Visual Studio or the C++ runtime are corrupted. Did you install the C++ components with Visual Studio? OR the Fortran download you used to install was incomplete or corrupted.
In all cases, the recommendation is to run a disk scan to search for corrupted DLLs.
SFC (System File Checker) is a handy built-in tool to find and replace missing or corrupted system files on Windows. Here's how to fix the missing DLL files on Windows using the SFC tool:
- Open Command Prompt as an administrator.
- Type the command: sfc /scannow there and press Enter to execute it. The SFC tool will now open and automatically fix most issues it finds.
Note that the SFC utility is only helpful in case of errors with default Windows apps such as Microsoft Store, Photos, and Camera app.
with the number of users for Intel Fortran, an unreported runtime error, while not impossible, is not likely. I would look at the VS installation and installer, and the Intel Fortran installers. You could try a simple C++ hello world project in VS and see if it compiles and runs. Similarly, does a simple console Hello world Fortran project compile and run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ron,
Thanks for your answer and suggestions.
(1) I ran sfc /scannow. It seems that some files were corrupted and repaired (got the same message as shown in your screenshot). However, the reported problem was still there.
(2) Concerning Visual Studio, yes the C++ components are installed. I also installed an additional workload ("Desktop development with C++") as this had been recommended by yourself in some article a few years ago. C++ applications are running correctly.
I also launched a repair process of Visual Studio. Everything seems ok on this side. But the reported problem persists...
(3) Concerning Intel oneapi, I then uninstalled the 2025 version completely (Base and HPC toolkits) in order to reinstall them from scratch. After reinstallation of the Base toolkit, I ran the sample test to check that it was correctly installed. I did the same with the HPC toolkit.
As I told you, a minimal example of a Fortran program calling a dll runs without any problem. The problem with the "Bad image" error only occurs with my big code. This code has been under development for more than 12 years and was running smoothly with previous intel oneapi versions using ifort compiler. This is the first time we are trying to compile it with ifx under Windows. There is no problem when the code is compiled and run on linux using ifx but with intel oneapi version 2024.0.0...
I understand this is difficult for you to understand where the issue comes from. When I'll have some time I will try to reproduce the problem in a distributable test case (not sure I'll be able to do it though).
Regards
Marc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you give me the exact name of the oneAPI Base and HPC Toolkits I can get you the checksum info on those.
For the big code, does it have DLLs that were not recompiled? DLLs that you are simply reusing? Those I would suspect. Have you examined file sizes of those to make sure they are correct size, or perhaps recopy them from another backup source? Or if they are from a 3rd party, can you re-download those and insure the checksums are correct?
If you have such DLLs, perhaps load them 1 by 1 to see if any are corrupted.
Windows computers already have a registry program where you can register DLL files. Visual Studio or a decompiler are programs you can download to read your DLL files. Visual Studio online lets you look at DLLs without downloading or finding a program ahead of time. Below are four methods you can follow to open a DLL file:
Microsoft Windows 7 and newer Registry
Below are steps that may help you open a DLL file on Windows 7 computers and newer:
- Open the command prompt. You can open the command prompt by going to the Windows Start menu or holding Windows Key+R and typing "cmd" in the prompt on the screen.
- Open the folder with the DLL file. Once you find the folder, hold the Shift key and right-click the folder to open the command prompt directly in that folder.
- Type "regsvr32 [DLL name].dll" and press Enter. This function can add the DLL file to your Windows Registry, helping you access your DLL file. You may use this function to add new DLL files to your computer.
- Type "regsvr32 -u [DLL name].dll" and press Enter. This function can remove a DLL file from the registry. You may use this to remove DLL files that are not behaving correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Base Toolkit and HPC Toolkit: version 2025.0.1 (11 Dec 2024). I downloaded these versions today...
ifx and icpx compilers: version 2025.0.4 (Build 20241205)
As an answer to your question, no everything is recompiled with ifx from scratch, so no old dll involved here.
Here is the output from Dependency Walker for the problematic dll (the second private dll is also recompiled; I'm pretty sure this one is ok since it is called by other executables that are working correctly):
Thanks for your help.
Marc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Reading through this thread, would like to add that I am experiencing similar issues as @MarcGrodent recently i.e. we have Fortran code built into dlls for over a decade with older versions of IFORT but the same code built into dlls with 2024.2 (IFORT) and IFX (2024.2 or 2025) cause various errors at the usage stage. The simple examples in the Intel Samples work fine but in large codes these errors may pop up.
We have been unable to use IFX as yet for large projects since the code that compiles with IFORT (and gfortran) fails with IFX at many locations (see for example my post https://community.intel.com/t5/Intel-Fortran-Compiler/IFX-2025-results-in-forrtl-severe-170-Program-Exception-stack/m-p/1646719). In some cases, IFX implementation of intrinsic functions such as MERGE is different from IFORT resulting in a catastrophic failure such as accessing an array element out-of-bounds.
I am in touch with other IFORT users who are not a part of this forum and are experiencing similar issues. I also agree with @MarcGrodent in that there could be something in the new redistributable files or MSVS updates that is causing an issue on some computers. Therefore, it may not be an issue with IFORT/IFX per se but VC++ and other files that are a part of MSVC and its updates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your comments @avinashs
My colleague made the following interesting observations:
- Version 2023.2 is installed on his Windows machine (Base & HPC Toolkits) so that he can compile our code with both ifort and ifx
- He first compiled it with ifx and tried to run it: exactly same problem as the one described in my previous posts ("Bad image" message when the system wants to access the DLL)
- He then compiled it with ifort in an independent Visual Studio solution: as expected, no problem in this case, the code runs perfectly
- Now he went back to the ifx solution and replaced the problematic DLL with the one generated with ifort (we can discuss the validity of the approach, but it's just a trial ...): the code runs correctly!!
So it seems the problem is "just" due to the creation of the DLL with ifx. The big question is to determine what is going wrong. As explained in my first post, the DLL includes a number of modules which are themselves linked to many static libraries. Our feeling is that these links might be the cause of the problem... Unfortunately, so far we have not been able to reproduce this behaviour on a simple case.
Any suggestion is welcome.
Marc (with thanks to Romain!)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Base toolkit
intel-oneapi-base-toolkit-2025.0.1.47_offline.exe
Base Toolkit 2025.0.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The thing is that I've already completely uninstalled 2025.0.1 (Base and HPC). Indeed, this version is of no use to me since I'm not able to work on my code and run it with ifx.
Therefore, I downgraded to version 2023.2 (my colleague had kept the installers) for which I have at least ifort which is working fine. However, as explained in my previous post this morning, the problem we are experiencing with ifx also occurs with this old version! As explained, replacing the problematic DLL generated with ifx with the one generated with ifort seems to solve the issue (but the procedure is of course not satisfactory...). So it seems that the problem comes from the creation of the DLL with ifx.
Regards
Marc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After some research, it turns out that the "bad image" problem when trying to open the DLL is due to the size of its image.
In fact, the code is quite old (mid 90's) and contains a lot of static allocations. We're currently refactoring it in order to use dynamic allocations but it takes time and it is not straightforward. Here is a summary of the current situation:
- Machine: Windows 10 (32 GB RAM)
- Intel oneapi 2023.2
- Visual Studio 2022 17.13.0
- 64-bit project compiled from scratch with ifort or ifx (a small part of the code is written in C++ and compiled with MSVC)
- Image size of the DLL obtained by means of 'dumpbin /HEADERS'
- Compilation with ifort:
- Image size of the DLL in debug mode: 1.5 GB
- In release mode: 0.05 GB (!)
- In both cases, the DLL starts without any problem
- Compilation with ifx (exactly the same code as with ifort):
- Image size of the DLL in debug mode: 3.4 GB
- In release mode: still 3.4 GB!
I noticed that the "bad image" error occurs as soon as the image size is greater than 2 GB (I was expecting a value higher than that... the reason is unclear). As we have only used the ifort compiler so far, the problem never appeared. However, what seems strange is that the image size obtained with ifx is approximately the same in debug and release; with ifort, the size is strongly decreased in release. Moreover, we are not using any compiler flag that could impact the image size.
Without modifying the code, our only option to use ifx would be to decrease the dimensions of some critical arrays.
Regards
Marc

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page