Debugging User Libraries
Debugging on Linux
You can choose to create the user library in debug mode. Running a user library in debug mode invokes the debug utility, a system-level program, that steps you through the subroutines or isolates parts of them. The debug utility helps you detect and locate any problems in the user-written subroutines.
Debugging on Windows
To debug an Adams Solver user library:
1. Create a library file with debugging information as explained in
User Libraries on Windows. From the command window, you would enter:
adams2023_cr-user y user.f -n mysolver.dll
Make sure the .f extension is lowercase.
2. Run the library file in debug mode as explained in
Running Adams Solver. From the command window, you would enter:
adams2023_ru-user mysolver.dll user.acf
Microsoft Visual Studio.Net automatically starts up.
3. In MS Visual Studio, from Solution Explorer, right-click on solver, and then select Properties.
4. In the General settings ensure that Executable is set to be:
install_dir/solver/win64/solver.exe
where install_dir is the actual installation directory, that is, C:\Program Files\MSC.Software\Adams\2024_1.
5. Set the Working Directory to the location where the .acf, .dll, and .adm files are located.
6. Set the Arguments to user.acf and then select Apply.
7. Open user.f in MS Visual Studio and set a breakpoint on a line in your user subroutine.
8. Run the project, using:
Debug → Start
Note: | If this is your first time debugging, you will have to create a solutions file by pressing Save.
A command window appears, showing Adams Solver initialization commands. The program execution then halts in the debugger at the breakpoint that you've specified. |
To debug an Adams View interface library:
■Follow the instructions above for Adams Solver libraries, except:
■The command to create the library is:
adams2024_1 aview cr-user y user.c -n myview.dll
■The command to run in debug mode is:
adams2024_1 aview ru-u i myview.dll -n
■You browse for:
install_dir/aview/win32/aview.exe