-
Notifications
You must be signed in to change notification settings - Fork 248
Debugging Kratos using Visual Studio
As Kratos runs using Python scripts the debugging process using Visual Studio may be a bit different of what a normal user may be used to. You have two different known ways to be able to debug your code: Cross Debugging Python or debugging directly the C++ part. This page will focus in the second option. You can find a dedicated page of the wiki for cross debugging here.
- Visual Studio 2015/2017 (see Windows Install) for debugging C++
- Boost libraries in debug mode.
First make sure the code is configured and compiled in Debug
or Fulldebug
modes. We recommend you to have a separate build directories for Release
and Debug
. Also, to avoid problems, we recommend you to set the -DINSTALL_RUNKRATOS=OFF
in the configure file to problem problems while building runkratos as most python distributions lack the python_*_d.lib
variant of the lib.
Go to Kratos project, on the solution explorer, right click and select Properties. From here go to Debugging menu. you should see a window like this:
In this menu, you will need to change some options
- Command: You should select python.exe you used to compile Kratos. Ex: C:\python36\python.exe
- Command arguments: Name of the script of the case you want to run. Ex: MainKratos.py
- Working directory: Path to the folder where the script above is located. Ex: C:\MyExamples\MyProblem.gid
-
Environment: You have to a add
-
PATH: so it also points to the
Libs
directory of Kratos where you have compiled the code. Ex: C:\Kratos_install\Libs - PYTHONPATH: it has to point to your kratos folder where the KratosMultiphysics directory is located. typically the same as above but without libs. Ex: C:\Kratos_install\Libs
-
PATH: so it also points to the
After that just right click in the Kratos -> Debug -> Start new debug instance:
Notice that you can put breakpoints and stop executions in all applications and components, not only in Kratos. Running from Kratos project just serves as an entry point in Visual Studio.
If you have any problem please feel free to open an issue in our project's page: https://github.com/KratosMultiphysics/Kratos/issues
- Getting Kratos (Last compiled Release)
- Compiling Kratos
- Running an example from GiD
- Kratos input files and I/O
- Data management
- Solving strategies
- Manipulating solution values
- Multiphysics
- Video tutorials
- Style Guide
- Authorship of Kratos files
- Configure .gitignore
- How to configure clang-format
- How to use smart pointer in Kratos
- How to define adjoint elements and response functions
- Visibility and Exposure
- Namespaces and Static Classes
Kratos structure
Conventions
Solvers
Debugging, profiling and testing
- Compiling Kratos in debug mode
- Debugging Kratos using GDB
- Cross-debugging Kratos under Windows
- Debugging Kratos C++ under Windows
- Checking memory usage with Valgind
- Profiling Kratos with MAQAO
- Creating unitary tests
- Using ThreadSanitizer to detect OMP data race bugs
- Debugging Memory with ASAN
HOW TOs
- How to create applications
- Python Tutorials
- Kratos For Dummies (I)
- List of classes and variables accessible via python
- How to use Logger
- How to Create a New Application using cmake
- How to write a JSON configuration file
- How to Access DataBase
- How to use quaternions in Kratos
- How to do Mapping between nonmatching meshes
- How to use Clang-Tidy to automatically correct code
- How to use the Constitutive Law class
- How to use Serialization
- How to use GlobalPointerCommunicator
- How to use PointerMapCommunicator
- How to use the Geometry
- How to use processes for BCs
- How to use Parallel Utilities in futureproofing the code
- Porting to Pybind11 (LEGACY CODE)
- Porting to AMatrix
- How to use Cotire
- Applications: Python-modules
- How to run multiple cases using PyCOMPSs
- How to apply a function to a list of variables
- How to use Kratos Native sparse linear algebra
Utilities
Kratos API
Kratos Structural Mechanics API