Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FMUs depend on libgfortran.so.3 #169

Open
jluttine opened this issue Feb 9, 2019 · 3 comments
Open

FMUs depend on libgfortran.so.3 #169

jluttine opened this issue Feb 9, 2019 · 3 comments

Comments

@jluttine
Copy link

jluttine commented Feb 9, 2019

I'm following the introductory tutorial under doc. I'm getting the following error:

File "introductory.py", line 131, in __main__
Failed example:
    weather = exodata.WeatherFromEPW('USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw')
Exception raised:
    Traceback (most recent call last):
      File "/nix/store/l95nkqp7bdimqnz9ixay1aahljzsz7vc-python-2.7.15/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest __main__[19]>", line 1, in <module>
        weather = exodata.WeatherFromEPW('USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw')
      File "/home/jluttine/Workspace/MPCPy/mpcpy/exodata.py", line 794, in __init__
        self._create_fmu({'fmupath': weatherdir+os.sep+fmuname});
      File "/home/jluttine/Workspace/MPCPy/mpcpy/utility.py", line 423, in _create_fmu
        self.fmu = load_fmu(self.fmupath);
      File "src/pyfmi/fmi.pyx", line 7943, in pyfmi.fmi.load_fmu
      File "src/pyfmi/fmi.pyx", line 7086, in pyfmi.fmi.FMUModelME2.__init__
      File "src/pyfmi/fmi.pyx", line 3824, in pyfmi.fmi.FMUModelBase2.__init__
    FMUException: Error loading the binary. Could not load the DLL: libgfortran.so.3: cannot open shared object file: No such file or directory

It is trying to read this FMU: resources/weather/WeatherProcessor_JModelica_v2.fmu

Apparently, the FMU depends on an older gfortran file than I have on my system. I "fixed" this by installing an older gfortran. But I don't understand how FMUs can be portable if they have such very system-dependent dependencies? Shouldn't the FMU either include the library file it needs or be more flexible what it can use? Or are FMUs just very tied to the environment and you aren't supposed to use them in very different environments? I'm new to FMUs so I don't really know. I'm just wondering because these FMUs are part of the repo so I was expecting that they'd work. If they aren't expected to work when copied to a different environment, perhaps provide a way to generate/compile these FMUs?

@jluttine
Copy link
Author

jluttine commented Feb 9, 2019

Another workaround: I opened the FMU file as a zip file, added libgfortran.so.3 there, and it started working. Perhaps the FMU in the repo could include the library file already?

@jluttine
Copy link
Author

jluttine commented Feb 9, 2019

I can make a pull request once I get this all figured out if you want.

@dhblum
Copy link
Collaborator

dhblum commented Feb 9, 2019

Thanks for reporting this issue. Please, so I can understand the issue better, can you tell me the OS and version you are using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants