From: meklund Date: Tue, 3 Apr 2018 13:25:16 +0000 (+0300) Subject: Added Dockerfile for Linux64 FMILibrary build and README for it X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F86%2F1686%2F2;p=simantics%2Ffmil.git Added Dockerfile for Linux64 FMILibrary build and README for it A Dockerfile for building FMILibrary on Linux has been added. Usage guide in the README. Change-Id: Id44ed8f260c175a2ef460dd5081345e1abd00fee --- diff --git a/org.simantics.fmil.linux64/DockerFile/Dockerfile b/org.simantics.fmil.linux64/DockerFile/Dockerfile new file mode 100644 index 0000000..e6f68b5 --- /dev/null +++ b/org.simantics.fmil.linux64/DockerFile/Dockerfile @@ -0,0 +1,40 @@ +FROM ubuntu:16.04 + +MAINTAINER miro.eklund@semantum.fi + +ARG fmi='http://www.jmodelica.org/downloads/FMIL/FMILibrary-2.0.3-src.zip' + +RUN apt-get update && \ + apt-get -y upgrade + +RUN apt-get install -y wget cmake unzip build-essential + +RUN mkdir /builds && \ + mkdir /builds/fmilsrc && \ + mkdir /builds/fmil && \ + mkdir /builds/fmildebug + +RUN wget -O /builds/fmilsrc/fmil.zip $fmi + +WORKDIR /builds/fmilsrc + +RUN unzip /builds/fmilsrc/fmil.zip && \ + rm /builds/fmilsrc/fmil.zip + +WORKDIR /builds/fmil + +RUN cmake /builds/fmilsrc/FMILibrary-2.0.3 + +RUN make +RUN make install test >> /fmil.log + +WORKDIR /builds/fmildebug + +RUN cmake -DFMILIB_ENABLE_LOG_LEVEL_DEBUG=ON /builds/fmilsrc/FMILibrary-2.0.3 + +RUN make +RUN make install test >> /fmildebug.log + +COPY ./copytovolume.sh /copytovolume.sh +RUN chmod 755 /copytovolume.sh +ENTRYPOINT /copytovolume.sh diff --git a/org.simantics.fmil.linux64/DockerFile/copytovolume.sh b/org.simantics.fmil.linux64/DockerFile/copytovolume.sh new file mode 100644 index 0000000..f05214d --- /dev/null +++ b/org.simantics.fmil.linux64/DockerFile/copytovolume.sh @@ -0,0 +1,17 @@ +#!/bin/bash +mkdir /output +mkdir /output/debug +cp /fmildebug.log /output/debug/fmildebug.log +cp /fmil.log /output/fmil.log + +cp /builds/fmil/libfmu1_dll_me.so /output/libfmu1_dll_me.so +cp /builds/fmil/libfmu2_dll_me.so /output/libfmu2_dll_me.so +cp /builds/fmil/libfmu1_dll_cs.so /output/libfmu1_dll_cs.so +cp /builds/fmil/libfmu2_dll_cs.so /output/libfmu2_dll_cs.so +cp /builds/fmil/libfmilib_shared.so /output/libfmilib_shared.so + +cp /builds/fmildebug/libfmu1_dll_me.so /output/debug/libfmu1_dll_me.so +cp /builds/fmildebug/libfmu2_dll_me.so /output/debug/libfmu2_dll_me.so +cp /builds/fmildebug/libfmu1_dll_cs.so /output/debug/libfmu1_dll_cs.so +cp /builds/fmildebug/libfmu2_dll_cs.so /output/debug/libfmu2_dll_cs.so +cp /builds/fmildebug/libfmilib_shared.so /output/debug/libfmilib_shared.so diff --git a/org.simantics.fmil.linux64/README.md b/org.simantics.fmil.linux64/README.md index 5511597..fab74bc 100644 --- a/org.simantics.fmil.linux64/README.md +++ b/org.simantics.fmil.linux64/README.md @@ -1,4 +1,7 @@ -Build FMI Library for Linux: +# Build FMI Library for Linux: + +## Alternative 1 - Manual + Download 2.0.3-src.zip from here http://www.jmodelica.org/FMILibrary Derived guide: http://www.jmodelica.org/page/27916 @@ -20,4 +23,15 @@ Derived guide: http://www.jmodelica.org/page/27916 9) Copy the above files to where you want them (i.e. under org.simantics.fmil.linux64 libraries directory) 10) Repeat steps 3 to 9 for "debug" shared objects, but replace the following steps: "5") cmake -DFMILIB_ENABLE_LOG_LEVEL_DEBUG=ON /path/to/source (note the added param) - "9") Copy the files to libraries/debug directory (instead of libraries) \ No newline at end of file + "9") Copy the files to libraries/debug directory (instead of libraries) + +## Alternative 2 - Docker + +1) Install docker for Linux +2) Build the libraries: +$ docker build -f /path/to/DockerFile/Dockerfile -t t:t . +3) Copy built files to your org.simantics.fmil.linux64 dir: +$ docker run -v :/output t:t +4) Check that the fmil.log and /debug/fmil.log show 100% test success + +Note: To build another version of the FMILibrary than the default "FMILibrary-2.0.3", you should rename all occurences of "FMILibrary-2.0.3" in Dockerfile/Dockerfile \ No newline at end of file