-
Notifications
You must be signed in to change notification settings - Fork 247
How to cross debug Kratos under Windows
The presented development environment allows to cross debug Kratos (Phyton and C++). In addition, it is possible to easily switch between the Debug and Release configuration. Moreover some hints how to bypass common errors in setting up Kratos under Windows (see also Windows Install) are provided.
- Visual Studio 2015 (see Windows Install) for debugging C++
- Visual Code (https://code.visualstudio.com/) for debugging Python
For debugging Kratos, Visual Code requires a Pyhton extension. The following screenshot shows some useful extensions.
To allow for fast switching between the Debug and Release configuration it is strongly recommended to use two different build folders (e.g. build_release and build_debug) with two different configuration files (see -DCMAKE_BUILD_TYPE=Debug or Release in configure.bat).
- Make sure you have compiled the boost library in the Release and Debug modus
- Make sure the following environment variables are set properly PYTHONPATH=[e.g. C:\Kratos_install], LD_LIBRARY_PATH=[e.g. C:\Kratos_install\libs] and add e.g. C:\Kratos_install and C:\Kratos_install\libs to the variable PATH
- Make sure you have copied the necessary Release AND Debug .dll files into the Kratos installation folder (see Post Compilation in Windows Install)
The first step is to perform one debugging step (Python) in Visual Code (Hint: use "stopOnEntry": true in the launch.json file). This creates a Python process.
Once the first debugging step in Visual Code is done, one can attach the Visual Studio Debugger (C++) to the before created Python process.
Done! Now you can cross debug Kratos (Python and C++) under Windows.
- For switching between Debug and Release you need to open the two different KratosMultiphysics.sln files created by CMake in the corresponding build folders e.g. build_release and build_debug
Have fun by cross debugging Kratos under WINDOWS ;-)
Michael Breitenberger
- 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