FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
Setup developer environment

This section handles the creation of new models in FhSim. If, however, you only want to run pre-existing models without doing programming whatsoever, please consider installing FhSim using an installer instead.

Prerequisites

You will need recent versions of the following tools:

  • conan >=2, which is a python-based package manager for C/C++ projects.
  • A functional C++ development environment, with a fairly recent compiler, gcc >= 10 or msvc++ >= 14.2.
  • CMake >=3.24, <4 build system generator.
  • git version control system.

Make sure these tools are installed before you continue.

Add the sintef-public remote conan:

conan remote add sintef-public https://gitlab.sintef.no/api/v4/projects/22218/packages/conan

Setup a conan profile:

conan profile detect --force

Open ~/.conan2/profiles/default or C:/Users/[Username]/.conan2/profiles/default with a text editor and edit the following: For all platforms: make sure these lines are present

compiler.cppstd=20

You will also need to acquire a license file, please contact karl..nosp@m.j.re.nosp@m.ite@s.nosp@m.inte.nosp@m.f.no or your SINTEF liaison.

For license access/support, contact your organization FhSim administrator or licensing contact.

Getting started

Suppose you are working on a project fhsim_awesome, which is a SimObject library that depends on FhSim. In case you do not have access to such a project, create one with SimObject template tool.

Typical commands to build a project with FhSim are:

cd fhsim_awesome
conan install . -s build_type=Release --build=missing --update -o fhsim/*:with_visualization=True
conan build .
Remarks
The conan install command takes an option -o fhsim/*:with_visualization= , with default value True, for building the project with or without visualization.

The install command above should have installed the FhSim executables and dependencies to the build/playpen directory. Once your project is built, its SimObject library is located in build/playpen/bin/SimObjectLibraries. When running FhSim executables, it is practical to use your playpen bin folder as working directory. The license file can either be put in this folder as license.lic, or stored elsewhere and pointed to by the environment variable SFH_LICENSE_FILE.

Suppose there exist an input file in fhsim_awesome/examples/input/Example.xml. You can run this with FhSim as follows:

cd fhsim_awesome/build/playpen/bin
FhVis ../../../examples/input/Example.xml

If this works you are ready to proceed by creating your own SimObjects, see Create a new SimObject.