FMU-module and transfer from OpenModelica to Python with PyFMI





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















Load OpenModelica FMU-module (with MSL noise-module) in Python environment with PyFMI does not work.



I have tried to run exported FMU-modules from OpenModelica in PyFMI-environment. Deterministic models works fine.



However, when I include noise models using the MSL block Modelica.Blocks.Noise.NormalNoise Then I get an FMU that get problems when loading into the PyFMI-environment. The error text ends with:



FMUException: Error loading the binary. Could not load the DLLL: libModelicaExternalC.so.0: cannot open shared object file: No such file or directory.



Needless to say, but in OpenModelica the system with noise works well. The same code in JModelica and compiled and loaded in the Python environment with PyFMI also works well. However, the random noise sequence are different for the same seed in OpenModelica and JModelica indicating some difference.



For this example I run JModelica and PyFMI version 2.1 in Docker Linux and OpenModelica is also run in Linux environment. Since Linux in both I can transfer the FMU-model. Both JModelica and OpenModelica support the Modelica standard 3.2.2 and corresponding MSL.



I have also just tested the example with JModelica and PyFMI version 2.4 (or at least 2.2) using Docker Linux image from mclab. I get the same error text as for 2.1 (and without noise block it works as it did for 2.1).





My question is if the described error is on PyFMI or OpenModelica side or perhaps both? Or is there something extra to be done when exporting an FMU from OpenModelica with noise-block that should make it all work?










share|improve this question































    1















    Load OpenModelica FMU-module (with MSL noise-module) in Python environment with PyFMI does not work.



    I have tried to run exported FMU-modules from OpenModelica in PyFMI-environment. Deterministic models works fine.



    However, when I include noise models using the MSL block Modelica.Blocks.Noise.NormalNoise Then I get an FMU that get problems when loading into the PyFMI-environment. The error text ends with:



    FMUException: Error loading the binary. Could not load the DLLL: libModelicaExternalC.so.0: cannot open shared object file: No such file or directory.



    Needless to say, but in OpenModelica the system with noise works well. The same code in JModelica and compiled and loaded in the Python environment with PyFMI also works well. However, the random noise sequence are different for the same seed in OpenModelica and JModelica indicating some difference.



    For this example I run JModelica and PyFMI version 2.1 in Docker Linux and OpenModelica is also run in Linux environment. Since Linux in both I can transfer the FMU-model. Both JModelica and OpenModelica support the Modelica standard 3.2.2 and corresponding MSL.



    I have also just tested the example with JModelica and PyFMI version 2.4 (or at least 2.2) using Docker Linux image from mclab. I get the same error text as for 2.1 (and without noise block it works as it did for 2.1).





    My question is if the described error is on PyFMI or OpenModelica side or perhaps both? Or is there something extra to be done when exporting an FMU from OpenModelica with noise-block that should make it all work?










    share|improve this question



























      1












      1








      1








      Load OpenModelica FMU-module (with MSL noise-module) in Python environment with PyFMI does not work.



      I have tried to run exported FMU-modules from OpenModelica in PyFMI-environment. Deterministic models works fine.



      However, when I include noise models using the MSL block Modelica.Blocks.Noise.NormalNoise Then I get an FMU that get problems when loading into the PyFMI-environment. The error text ends with:



      FMUException: Error loading the binary. Could not load the DLLL: libModelicaExternalC.so.0: cannot open shared object file: No such file or directory.



      Needless to say, but in OpenModelica the system with noise works well. The same code in JModelica and compiled and loaded in the Python environment with PyFMI also works well. However, the random noise sequence are different for the same seed in OpenModelica and JModelica indicating some difference.



      For this example I run JModelica and PyFMI version 2.1 in Docker Linux and OpenModelica is also run in Linux environment. Since Linux in both I can transfer the FMU-model. Both JModelica and OpenModelica support the Modelica standard 3.2.2 and corresponding MSL.



      I have also just tested the example with JModelica and PyFMI version 2.4 (or at least 2.2) using Docker Linux image from mclab. I get the same error text as for 2.1 (and without noise block it works as it did for 2.1).





      My question is if the described error is on PyFMI or OpenModelica side or perhaps both? Or is there something extra to be done when exporting an FMU from OpenModelica with noise-block that should make it all work?










      share|improve this question
















      Load OpenModelica FMU-module (with MSL noise-module) in Python environment with PyFMI does not work.



      I have tried to run exported FMU-modules from OpenModelica in PyFMI-environment. Deterministic models works fine.



      However, when I include noise models using the MSL block Modelica.Blocks.Noise.NormalNoise Then I get an FMU that get problems when loading into the PyFMI-environment. The error text ends with:



      FMUException: Error loading the binary. Could not load the DLLL: libModelicaExternalC.so.0: cannot open shared object file: No such file or directory.



      Needless to say, but in OpenModelica the system with noise works well. The same code in JModelica and compiled and loaded in the Python environment with PyFMI also works well. However, the random noise sequence are different for the same seed in OpenModelica and JModelica indicating some difference.



      For this example I run JModelica and PyFMI version 2.1 in Docker Linux and OpenModelica is also run in Linux environment. Since Linux in both I can transfer the FMU-model. Both JModelica and OpenModelica support the Modelica standard 3.2.2 and corresponding MSL.



      I have also just tested the example with JModelica and PyFMI version 2.4 (or at least 2.2) using Docker Linux image from mclab. I get the same error text as for 2.1 (and without noise block it works as it did for 2.1).





      My question is if the described error is on PyFMI or OpenModelica side or perhaps both? Or is there something extra to be done when exporting an FMU from OpenModelica with noise-block that should make it all work?







      python openmodelica fmi jmodelica






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 4 at 9:07







      janpeter

















      asked Jan 3 at 9:04









      janpeterjanpeter

      96110




      96110
























          2 Answers
          2






          active

          oldest

          votes


















          1














          From the error message, it indicates that the FMU is missing one of its dependencies, libModelicaExternalC.so (all dependencies of an FMU should be included in the FMU). The problem lies in the generating tool of the FMU, not in PyFMI.






          share|improve this answer































            3














            In OMEdit, set Platfoms to "Static" in Tools->Options->FMI before generating the FMU.






            share|improve this answer



















            • 1





              It seems that in some cases we do link with dynamic libraries from MSL. I opened a bug report about it: trac.openmodelica.org/OpenModelica/ticket/5263

              – Adrian Pop
              Jan 7 at 16:31












            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54019129%2ffmu-module-and-transfer-from-openmodelica-to-python-with-pyfmi%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            From the error message, it indicates that the FMU is missing one of its dependencies, libModelicaExternalC.so (all dependencies of an FMU should be included in the FMU). The problem lies in the generating tool of the FMU, not in PyFMI.






            share|improve this answer




























              1














              From the error message, it indicates that the FMU is missing one of its dependencies, libModelicaExternalC.so (all dependencies of an FMU should be included in the FMU). The problem lies in the generating tool of the FMU, not in PyFMI.






              share|improve this answer


























                1












                1








                1







                From the error message, it indicates that the FMU is missing one of its dependencies, libModelicaExternalC.so (all dependencies of an FMU should be included in the FMU). The problem lies in the generating tool of the FMU, not in PyFMI.






                share|improve this answer













                From the error message, it indicates that the FMU is missing one of its dependencies, libModelicaExternalC.so (all dependencies of an FMU should be included in the FMU). The problem lies in the generating tool of the FMU, not in PyFMI.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 4 at 11:37









                Christian WintherChristian Winther

                7831615




                7831615

























                    3














                    In OMEdit, set Platfoms to "Static" in Tools->Options->FMI before generating the FMU.






                    share|improve this answer



















                    • 1





                      It seems that in some cases we do link with dynamic libraries from MSL. I opened a bug report about it: trac.openmodelica.org/OpenModelica/ticket/5263

                      – Adrian Pop
                      Jan 7 at 16:31
















                    3














                    In OMEdit, set Platfoms to "Static" in Tools->Options->FMI before generating the FMU.






                    share|improve this answer



















                    • 1





                      It seems that in some cases we do link with dynamic libraries from MSL. I opened a bug report about it: trac.openmodelica.org/OpenModelica/ticket/5263

                      – Adrian Pop
                      Jan 7 at 16:31














                    3












                    3








                    3







                    In OMEdit, set Platfoms to "Static" in Tools->Options->FMI before generating the FMU.






                    share|improve this answer













                    In OMEdit, set Platfoms to "Static" in Tools->Options->FMI before generating the FMU.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jan 7 at 14:22









                    Adrian PopAdrian Pop

                    2,606810




                    2,606810








                    • 1





                      It seems that in some cases we do link with dynamic libraries from MSL. I opened a bug report about it: trac.openmodelica.org/OpenModelica/ticket/5263

                      – Adrian Pop
                      Jan 7 at 16:31














                    • 1





                      It seems that in some cases we do link with dynamic libraries from MSL. I opened a bug report about it: trac.openmodelica.org/OpenModelica/ticket/5263

                      – Adrian Pop
                      Jan 7 at 16:31








                    1




                    1





                    It seems that in some cases we do link with dynamic libraries from MSL. I opened a bug report about it: trac.openmodelica.org/OpenModelica/ticket/5263

                    – Adrian Pop
                    Jan 7 at 16:31





                    It seems that in some cases we do link with dynamic libraries from MSL. I opened a bug report about it: trac.openmodelica.org/OpenModelica/ticket/5263

                    – Adrian Pop
                    Jan 7 at 16:31


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54019129%2ffmu-module-and-transfer-from-openmodelica-to-python-with-pyfmi%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    MongoDB - Not Authorized To Execute Command

                    in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

                    Npm cannot find a required file even through it is in the searched directory