]> gerrit.simantics Code Review - simantics/fmil.git/blob - org.simantics.fmil.core/README.md
Add atomic counter for instanceName and update README, fix loadFMU
[simantics/fmil.git] / org.simantics.fmil.core / README.md
1 # How to build FMUSimulator and FMILibrary
2
3 ## Base FMILibrary
4
5 To build the Visual Studio Solution files you need CMake.
6 CMake is also used to build the base native FMILibrary.
7
8 Note:
9 This is not usually needed, you can use the existing build.
10
11 Remember to manually delete CMakeCache and CMakeFiles from FMILibrary/build/expatex/-folder 
12
13 Follow the instructions provided by the Linux Dockerfile and linuxbuild.sh.
14 In short:
15 1) Download the desired FMILibrary source .zip
16 2) Unzip in a location of your choosing
17 3) Open terminal
18 4) Change directory to where you want to build the output
19 5) Run cmake from command-line and provide as the first argument the path to where you unzipped sources in step 2
20 Optional) To make a debug version, add -DFMILIB_ENABLE_LOG_LEVEL_DEBUG=ON before the path to source
21 6) In both debug and normal case, run "make" and "make install test" to verify the installation
22
23 If the build succeeded, you should have .dll files which you can now copy to your win32 or win64 org.simantics.fmil.* projects.
24 Specifically:
25 fmu1_dll_cs.dll, fmu1_dll_me.dll, fmu2_dll_cs.dll, fmu2_dll_me.sll and fmilib_shared.dll
26 Copy the corresponding "Debug" build files to the sub-directoryn "Debug" in the projects.
27
28 ## FMUSimulator
29
30 When you have the Visual Studio files:
31 Build from command-line our FMUSimulator.dll
32
33 1) Open a terminal
34 2) Navigate to org.simantics.fmil.core/native/FMUSimulator
35 3) Run "msbuild.exe"
36
37 ## Building on linux
38         
39 When building the libfmilib_shared.so, we need to replace fmi_util.c file under "<path to FMILibrary>/src/Util/src/FMI/fmi_util.c" with contents of fmi_util.c.txt, located
40 under /native/FMUSimulator/fmi_util.c.txt. The Dockerfile already does this so if you build the libfmilib_shared.so with that, then you needn't worry about this.
41