Skip to content

Windows Install

Carlos Roig edited this page Jun 19, 2020 · 9 revisions

How to compile Kratos:

You can find updated instructions to compile kratos in the Install.md

Test and Usage

  • Objectives:
    • Test that Kratos Works
    • Get familiar with the execution process

Once Kratos is compiled and correctly install all its left is to execute some cases. In this section we will descrive how you can make a simple example to test that kratos works, and the general way to run problems: directly from the command line or using GiD.

Test the compilation

To to test the compilation, you can prepare a simple script (for example test_kratos.py) that contains this line:

  from KratosMultiphysics import *

Then you can execute this script as explained in the next section.

Executing an script from the command line

The most easy way to execute a KratosMultiphysics script from the command line is to prepare a .bat file. A .bat file is just a series of commands that are executed together and will make the process simpler. This file should contain only two lines. First the path for the kratos executable and libs folders, and the second, the actual command. For instace:

  • Your Downloaded Kratos in C:\Kratos
  • Your script is called test_kratos.py
  set PATH=C:\\Kratos;C:\\Kratos\\libs;%PATH%
  "C:\\Kratos\\runkratos" test_kratos.py

We strongly recommend you to run kratos scripts with the runkratos binary inside your Kratos installation folder, because it gives the correct values to the environment variables.

  runkratos test.py

Or more exactly, you can go to the folder where your case is (input files and main python script) and type:

  path_to_kratos/runkratos test.py

You can also run them directly using the python you have installed in your system (provided that the system knows where python is and the environment variables have the correct values assigned, PYTHONPATH, LD_LIBRARY_PATH and PATH).

  python test.py
  python3 test.py
  python36 test.py

If everything is correct you will see this message:

   |  /           |             
   ' /   __| _` | __|  _ \   __|
   . \  |   (   | |   (   |\__ \ 
  _|\_\_|  \__,_|\__|\___/ ____/
           Multi-Physics 6.1.XXXXX

Common problems

Error C1002 / Error C1060: Out of heap space

This problem can only be solved in 64bit machine

This error happens because the compiler is not able to index more than 4GB of RAM. This is due to the fact that, by default visual studio uses a 32 bit toolset regardless of the target platform. Visual Studio 2015 and 2017 both have a 64 bit toolset that does not have this problem. In order to activate it:

Add this to the *.vsproj file of the project is giving you problems under the configuration you are using ( Release, Debug, etc...)

<PreferredToolArchitecture>x64</PreferredToolArchitecture>

or by setting:

set PreferredToolArchitecture=x64

before calling Msbuild.exe if you are compiling directly from the cmd.

Source

warning C4273: 'round' : inconsistent dll linkage

You have a conflicting declaration of round. This could happen for example if you have multiple versions of Visual Studio in your computer. Please add -DHAVE_ROUND to the configure cxxflags entry:

 -DCMAKE_CXX_FLAGS=" -D_SCL_SECURE_NO_WARNINGS -DHAVE_ROUND"

Project information

Getting Started

Tutorials

Developers

Kratos structure

Conventions

Solvers

Debugging, profiling and testing

HOW TOs

Utilities

Kratos API

Kratos Structural Mechanics API

Clone this wiki locally