]> gerrit.simantics Code Review - simantics/fmil.git/commitdiff
Updates to FMILibrary and its build process 88/2188/5
authorReino Ruusu <reino.ruusu@semantum.fi>
Fri, 14 Sep 2018 11:24:53 +0000 (14:24 +0300)
committerReino Ruusu <reino.ruusu@semantum.fi>
Fri, 14 Sep 2018 13:16:01 +0000 (16:16 +0300)
* Windows batch file for building FMILibrary.
* New build instrcutions in README.txt.
* Newly built FMILibrary binaries.

gitlab #6

Change-Id: Id88e9c3d254fab85c3d25f4a8c581ad9071fa6a3

25 files changed:
org.simantics.fmil.core/README.md
org.simantics.fmil.core/native/.gitignore [new file with mode: 0644]
org.simantics.fmil.core/native/windowsbuild.bat [new file with mode: 0644]
org.simantics.fmil.win32/libraries/Debug/FMUSimulator.dll [deleted file]
org.simantics.fmil.win32/libraries/Debug/fmilib_shared.dll [deleted file]
org.simantics.fmil.win32/libraries/Debug/fmu1_dll_cs.dll [deleted file]
org.simantics.fmil.win32/libraries/Debug/fmu1_dll_me.dll [deleted file]
org.simantics.fmil.win32/libraries/Debug/fmu2_dll_cs.dll [deleted file]
org.simantics.fmil.win32/libraries/Debug/fmu2_dll_me.dll [deleted file]
org.simantics.fmil.win32/libraries/fmilib_shared.dll
org.simantics.fmil.win32/libraries/fmu1_dll_cs.dll
org.simantics.fmil.win32/libraries/fmu1_dll_me.dll
org.simantics.fmil.win32/libraries/fmu2_dll_cs.dll
org.simantics.fmil.win32/libraries/fmu2_dll_me.dll
org.simantics.fmil.win64/libraries/Debug/FMUSimulator.dll [deleted file]
org.simantics.fmil.win64/libraries/Debug/fmilib_shared.dll [deleted file]
org.simantics.fmil.win64/libraries/Debug/fmu1_dll_cs.dll [deleted file]
org.simantics.fmil.win64/libraries/Debug/fmu1_dll_me.dll [deleted file]
org.simantics.fmil.win64/libraries/Debug/fmu2_dll_cs.dll [deleted file]
org.simantics.fmil.win64/libraries/Debug/fmu2_dll_me.dll [deleted file]
org.simantics.fmil.win64/libraries/fmilib_shared.dll
org.simantics.fmil.win64/libraries/fmu1_dll_cs.dll
org.simantics.fmil.win64/libraries/fmu1_dll_me.dll
org.simantics.fmil.win64/libraries/fmu2_dll_cs.dll
org.simantics.fmil.win64/libraries/fmu2_dll_me.dll

index 0539e376bfe08783ae6eac636e34543028a54d43..d5ef5ef3e96eb7fe124f73e8874115e644322618 100644 (file)
@@ -11,20 +11,46 @@ This is not usually needed, you can use the existing build.
 Remember to manually delete CMakeCache and CMakeFiles from FMILibrary/build/expatex/-folder 
 
 Follow the instructions provided by the Linux Dockerfile and linuxbuild.sh.
-In short:
-1) Download the desired FMILibrary source .zip
-2) Unzip in a location of your choosing
-3) Open terminal
-4) Change directory to where you want to build the output
-5) Run cmake from command-line and provide as the first argument the path to where you unzipped sources in step 2
+
+On Windows the library must be manually downloaded and unzipped to the *native* directory.
+The build can then be performed by executing the batch file *./windowsbuild.bat* in the same directory.
+
+The build steps are:
+1. Download the desired FMILibrary source .zip from https://jmodelica.org/fmil/FMILibrary-2.0.3-src.zip
+2. Unzip the package to the *native* directory.
+3. Open terminal with development tools configured
+    * Visual Studio: Use the *"Developer Command Prompt for VS 2017"* start menu entry
+4. Execute build script
+    * Linux: `docker build -f Dockerfile -t fmilibrary:build .`, then `docker run -v /path/to/org.simantics.fmil.linux64/libraries:/output fmilibrary:build`
+    * Windows: `cd native`, then `windowsbuild.bat`
+
+Automated steps:
+1. Replace *fmi_util.c* file under *"<path to FMILibrary>/src/Util/src/FMI/fmi_util.c"* with contents of *fmi_util.c.txt*, located
+under */native/FMUSimulator/fmi_util.c.txt*.
+2. Change directory to where you want to build the output
+3. Run cmake from command-line and provide as the first argument the path to where you unzipped sources in step 2
 Optional) To make a debug version, add -DFMILIB_ENABLE_LOG_LEVEL_DEBUG=ON before the path to source
-6) In both debug and normal case, run "make" and "make install test" to verify the installation
+     * Windows: Specify build tools and target architecture with
+       * `cmake -G "Visual Studio 15"` (32-bit) or
+       * `cmake -G "Visual Studio 15 Win64"` (64-bit)
+4. Use the generated makefiles/project files to perform the build
+    * Linux: In both debug and normal case, run "make" and "make install test" to verify the installation
+    * Windows: Execute the command `msbuild FMILibrary.sln /p:Configuration=<Debug/Release> /p:Platform=<Win32/x64>` 
 
 If the build succeeded, you should have .dll files which you can now copy to your win32 or win64 org.simantics.fmil.* projects.
 Specifically:
 fmu1_dll_cs.dll, fmu1_dll_me.dll, fmu2_dll_cs.dll, fmu2_dll_me.sll and fmilib_shared.dll
 Copy the corresponding "Debug" build files to the sub-directoryn "Debug" in the projects.
 
+### Windows-build with Visual Studio
+
+On Windows, cmake needs to be run separately for 32-bit and 64-bit builds. See the Windows batch file *update_fmilibrary.bat*, which performs both automatically.
+
+### Building on linux
+       
+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
+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.
 ## FMUSimulator
 
 When you have the Visual Studio files:
@@ -33,9 +59,3 @@ Build from command-line our FMUSimulator.dll
 1) Open a terminal
 2) Navigate to org.simantics.fmil.core/native/FMUSimulator
 3) Run "msbuild.exe"
-
-## Building on linux
-       
-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
-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.
\ No newline at end of file
diff --git a/org.simantics.fmil.core/native/.gitignore b/org.simantics.fmil.core/native/.gitignore
new file mode 100644 (file)
index 0000000..c058303
--- /dev/null
@@ -0,0 +1,4 @@
+/FMILibrary-2.0.3/
+/Debug/
+/Release/
+/x64/
diff --git a/org.simantics.fmil.core/native/windowsbuild.bat b/org.simantics.fmil.core/native/windowsbuild.bat
new file mode 100644 (file)
index 0000000..e644859
--- /dev/null
@@ -0,0 +1,23 @@
+cd FMILibrary-2.0.3\r
+\r
+xcopy /y ..\FMUSimulator\fmi_util.c.txt .\src\Util\src\FMI\fmi_util.c\r
+\r
+mkdir build32\r
+cd build32\r
+cmake .. -G "Visual Studio 15"\r
+msbuild FMILibrary.sln /p:Configuration=Release /p:Platform=Win32\r
+msbuild FMILibrary.sln /p:Configuration=Debug /p:Platform=Win32\r
+\r
+xcopy /y Release\*.dll ..\..\..\..\org.simantics.fmil.win32\libraries\r
+\r
+cd ..\r
+\r
+mkdir build64\r
+cd build64\r
+cmake .. -G "Visual Studio 15 Win64"\r
+msbuild FMILibrary.sln /p:Configuration=Release /p:Platform=x64\r
+msbuild FMILibrary.sln /p:Configuration=Debug /p:Platform=x64\r
+\r
+xcopy /y Release\*.dll ..\..\..\..\org.simantics.fmil.win64\libraries\r
+\r
+cd ..\..\r
diff --git a/org.simantics.fmil.win32/libraries/Debug/FMUSimulator.dll b/org.simantics.fmil.win32/libraries/Debug/FMUSimulator.dll
deleted file mode 100644 (file)
index 389caa2..0000000
Binary files a/org.simantics.fmil.win32/libraries/Debug/FMUSimulator.dll and /dev/null differ
diff --git a/org.simantics.fmil.win32/libraries/Debug/fmilib_shared.dll b/org.simantics.fmil.win32/libraries/Debug/fmilib_shared.dll
deleted file mode 100644 (file)
index eedf974..0000000
Binary files a/org.simantics.fmil.win32/libraries/Debug/fmilib_shared.dll and /dev/null differ
diff --git a/org.simantics.fmil.win32/libraries/Debug/fmu1_dll_cs.dll b/org.simantics.fmil.win32/libraries/Debug/fmu1_dll_cs.dll
deleted file mode 100644 (file)
index 6397ee9..0000000
Binary files a/org.simantics.fmil.win32/libraries/Debug/fmu1_dll_cs.dll and /dev/null differ
diff --git a/org.simantics.fmil.win32/libraries/Debug/fmu1_dll_me.dll b/org.simantics.fmil.win32/libraries/Debug/fmu1_dll_me.dll
deleted file mode 100644 (file)
index a518568..0000000
Binary files a/org.simantics.fmil.win32/libraries/Debug/fmu1_dll_me.dll and /dev/null differ
diff --git a/org.simantics.fmil.win32/libraries/Debug/fmu2_dll_cs.dll b/org.simantics.fmil.win32/libraries/Debug/fmu2_dll_cs.dll
deleted file mode 100644 (file)
index 89117c0..0000000
Binary files a/org.simantics.fmil.win32/libraries/Debug/fmu2_dll_cs.dll and /dev/null differ
diff --git a/org.simantics.fmil.win32/libraries/Debug/fmu2_dll_me.dll b/org.simantics.fmil.win32/libraries/Debug/fmu2_dll_me.dll
deleted file mode 100644 (file)
index 3350c00..0000000
Binary files a/org.simantics.fmil.win32/libraries/Debug/fmu2_dll_me.dll and /dev/null differ
index 7eb972d4319ac901a3f73da09669475959d941da..a59c2a9b221d28e7fe35932fcf97e31d9ba7964c 100644 (file)
Binary files a/org.simantics.fmil.win32/libraries/fmilib_shared.dll and b/org.simantics.fmil.win32/libraries/fmilib_shared.dll differ
index edd1487426ac7cdce14972933663b3b122ba4c62..632a042cecf14f4927b1fb20d92ae1097df57239 100644 (file)
Binary files a/org.simantics.fmil.win32/libraries/fmu1_dll_cs.dll and b/org.simantics.fmil.win32/libraries/fmu1_dll_cs.dll differ
index 2f80629ba5073848eebd72354daf756fdc6c12b1..cd18e7ec8e6f76032a993aa1070c345369ed40f0 100644 (file)
Binary files a/org.simantics.fmil.win32/libraries/fmu1_dll_me.dll and b/org.simantics.fmil.win32/libraries/fmu1_dll_me.dll differ
index eb847c62d197992dd620b67929328daffb939136..cb5dba44136bc80a4d4fc8929dbbcd9b621d4d26 100644 (file)
Binary files a/org.simantics.fmil.win32/libraries/fmu2_dll_cs.dll and b/org.simantics.fmil.win32/libraries/fmu2_dll_cs.dll differ
index 7668516d03f44b49709dd6a53573a99696296a99..ecd6a4cb113f683c1b73df7753ce43cb68230d27 100644 (file)
Binary files a/org.simantics.fmil.win32/libraries/fmu2_dll_me.dll and b/org.simantics.fmil.win32/libraries/fmu2_dll_me.dll differ
diff --git a/org.simantics.fmil.win64/libraries/Debug/FMUSimulator.dll b/org.simantics.fmil.win64/libraries/Debug/FMUSimulator.dll
deleted file mode 100644 (file)
index 09df102..0000000
Binary files a/org.simantics.fmil.win64/libraries/Debug/FMUSimulator.dll and /dev/null differ
diff --git a/org.simantics.fmil.win64/libraries/Debug/fmilib_shared.dll b/org.simantics.fmil.win64/libraries/Debug/fmilib_shared.dll
deleted file mode 100644 (file)
index 5b7305c..0000000
Binary files a/org.simantics.fmil.win64/libraries/Debug/fmilib_shared.dll and /dev/null differ
diff --git a/org.simantics.fmil.win64/libraries/Debug/fmu1_dll_cs.dll b/org.simantics.fmil.win64/libraries/Debug/fmu1_dll_cs.dll
deleted file mode 100644 (file)
index 263de8e..0000000
Binary files a/org.simantics.fmil.win64/libraries/Debug/fmu1_dll_cs.dll and /dev/null differ
diff --git a/org.simantics.fmil.win64/libraries/Debug/fmu1_dll_me.dll b/org.simantics.fmil.win64/libraries/Debug/fmu1_dll_me.dll
deleted file mode 100644 (file)
index 75ffc94..0000000
Binary files a/org.simantics.fmil.win64/libraries/Debug/fmu1_dll_me.dll and /dev/null differ
diff --git a/org.simantics.fmil.win64/libraries/Debug/fmu2_dll_cs.dll b/org.simantics.fmil.win64/libraries/Debug/fmu2_dll_cs.dll
deleted file mode 100644 (file)
index ce8c580..0000000
Binary files a/org.simantics.fmil.win64/libraries/Debug/fmu2_dll_cs.dll and /dev/null differ
diff --git a/org.simantics.fmil.win64/libraries/Debug/fmu2_dll_me.dll b/org.simantics.fmil.win64/libraries/Debug/fmu2_dll_me.dll
deleted file mode 100644 (file)
index 7c54efe..0000000
Binary files a/org.simantics.fmil.win64/libraries/Debug/fmu2_dll_me.dll and /dev/null differ
index 5870f10b503b9d047131ec0d24986301766e85c0..61518ca287a00fe92588805662905352ae506914 100644 (file)
Binary files a/org.simantics.fmil.win64/libraries/fmilib_shared.dll and b/org.simantics.fmil.win64/libraries/fmilib_shared.dll differ
index 88ec2245c1a792aaf62a6e4aca1229b985809acf..c86c6e0557cafe14c63b232090c0f3fbc7f5866c 100644 (file)
Binary files a/org.simantics.fmil.win64/libraries/fmu1_dll_cs.dll and b/org.simantics.fmil.win64/libraries/fmu1_dll_cs.dll differ
index bbdb6d9ba0a63192b1b0131cf82869d74826f14d..b03b4ffe6a23de3ef4cf093325d128cdbec51941 100644 (file)
Binary files a/org.simantics.fmil.win64/libraries/fmu1_dll_me.dll and b/org.simantics.fmil.win64/libraries/fmu1_dll_me.dll differ
index 9f28b07677d02e145041bf81acddfe8b6c5fa9a7..ca921635bc6a2337237d16c210591aa28950e1b8 100644 (file)
Binary files a/org.simantics.fmil.win64/libraries/fmu2_dll_cs.dll and b/org.simantics.fmil.win64/libraries/fmu2_dll_cs.dll differ
index bd3b0e345c2ac91d45d41c1bc7672601aa8ce9a3..146a9b505cf87f7160b6889ceb9741183d22c99d 100644 (file)
Binary files a/org.simantics.fmil.win64/libraries/fmu2_dll_me.dll and b/org.simantics.fmil.win64/libraries/fmu2_dll_me.dll differ