Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
27228 Discussions

Debugging a fortran dll using visual studio 2019

Thomann__Gary
Novice
488 Views

I built a fortran dll, dbug mode, using visual studio 2019 and the Intel OneApi.  The dll is called from a large program that does electric utility dynamics.  I am not trying to debug the large program.  The procedure is to start the large program and then run the simulation using a python macro.  It runs flawlessly, although the answer is not right because there are some errors in the dll.  I want to debug the dll, but when I put in a break point in the dll code it is ignored; the simulation just runs to the end.

What do I have to do to make the solution stop when I hit the breakpoint in the dll code?  Thanks for any information.

0 Kudos
1 Solution
Thomann__Gary
Novice
462 Views

Ok, I got it to work. I looked in the instructions for psse, the large program.  There is an example vfproj file included in psse, and some instructions.  You take the example vfproj file, add the dll source code, and set project properties.  The properties seem to be the same as what I was using before, but anyway I followed the instructions.  Then I built the dll, and hit F5.  Again, psse started and I ran the the python macro.  But now the execution stopped at the first breakpoint in my code.  So I am good.  Thank you for your help!!

View solution in original post

3 Replies
Steve_Lionel
Black Belt Retired Employee
475 Views

Open your DLL project's properties. Under Debugging > Command., put in the path to the large program executable. Set a breakpoint in your DLL routine, and then Start Debugging (F5). Your large program will run. At the point that your DLL is called, the debugger should stop at your breakpoint. Make absolutely sure that the DLL that the large program loads is the same one you built in the debug configuration of the project.

Thomann__Gary
Novice
467 Views

I had tried that before, but did it again.  On F5 the large program starts.  I then run the python macro (which loads the dll, does other stuff, and runs the simulation.  The simulation runs to completion, there are no stops at the break points I put in, although the dll code is called hundreds of time.  When the simulation is complete clicking on Debug in Visual Studio shows it still thinks it is running, but all I can do is stop it at that point. Obviously I am doing something wrong in Visual Studio, but I have tried numerous things with no joy.  Thank you for your help.

Thomann__Gary
Novice
463 Views

Ok, I got it to work. I looked in the instructions for psse, the large program.  There is an example vfproj file included in psse, and some instructions.  You take the example vfproj file, add the dll source code, and set project properties.  The properties seem to be the same as what I was using before, but anyway I followed the instructions.  Then I built the dll, and hit F5.  Again, psse started and I ran the the python macro.  But now the execution stopped at the first breakpoint in my code.  So I am good.  Thank you for your help!!

Reply