modelica / fmi-cross-check

Results and FMUs for the FMI Cross-Check
Other
40 stars 79 forks source link

Missing libgfortran.so.3 for JModelica FMU on Linux #57

Open AnHeuermann opened 5 years ago

AnHeuermann commented 5 years ago

When simulating fmus/2.0/me/linux64/JModelica.org/1.15/ControlledTemperature/ControlledTemperature.fmu with fmuChecker a shared library for gfortran can't be found. See the following error log:

$ fmuCheck -k me ControlledTemperature.fmu
[INFO][FMUCHK] FMI compliance checker Test [FMILibrary: Test] build date: Dec 13 2018
[INFO][FMUCHK] Called with following options:
[INFO][FMUCHK] fmuCheck -k me ControlledTemperature.fmu
[INFO][FMUCHK] Will process FMU ControlledTemperature.fmu
[INFO][FMILIB] XML specifies FMI standard version 2.0
[INFO][FMUCHK] Model name: ControlledTemperature
[INFO][FMUCHK] Model GUID: 14ac906d8d18e8da4c3d119d0c9a8a4
[INFO][FMUCHK] Model version:
[INFO][FMUCHK] FMU kind: ModelExchange
[INFO][FMUCHK] The FMU contains:
7 constants
42 parameters
4 discrete variables
38 continuous variables
0 inputs
1 outputs
48 local variables
0 independent variables
11 calculated parameters
80 real variables
6 integer variables
0 enumeration variables
16 boolean variables
0 string variables

[INFO][FMUCHK] Printing output file header
"time","TRes"
[INFO][FMUCHK] Model identifier for ModelExchange: ControlledTemperature
[INFO][FMILIB] Loading 'linux64' binary with 'default' platform types
[FATAL][FMICAPI] Could not load the DLL: libgfortran.so.3: cannot open shared object file: No such file or directory
[FATAL][FMUCHK] Could not create the DLL loading mechanism(C-API) for ME.
FMU check summary:
FMU reported:
        0 warning(s) and error(s)
Checker reported:
        0 Warning(s)
        2 Error(s)
        2 Fatal error(s) occurred during processing

What am I missing here? Do I need some additional libraries. Are the provided test fmu's run with CircleCI? I could not find it there.

GFortran is installed on my Linux (Ubuntu64) fmu. The problem also occures with OMSimulator (which also uses FMI-Library for FMU loading) but it's working on a travis job for my julia FMISimulator, which is not using FMI-Library.

filip-stenstrom commented 5 years ago

[FATAL][FMICAPI] Could not load the DLL: libgfortran.so.3: cannot open shared object file: No such file or directory

This signifies that the dynamic loader can't find libgfortran, and since it works on your machine which runs travis, your environments are most likely different.

If you unpack the ControlledTemperature.fmu and then call ldd on the .so file, you'll probably find that libgfortran.so can't be found.

ldd ControlledTemperature.so

I'd try to re-install and make sure "apt-get install libgfortran3" shows that fortran is installed

AnHeuermann commented 5 years ago

Indeed I didn't had the right version of libgfortan on my machine. Thanks for the help!

sjoelund commented 5 years ago

I would actually reopen this since you must package all dependencies in the FMU and libgfortran3 is not available on all Linux base distributions.

AnHeuermann commented 3 years ago

Any news on this issue?

The libgfortran3 dependency is breaking my automated tests for a Julia FMU simulator I'm working on.

The runner I'm using doesn't has libgfortan3. While I could add it for now that doesn't really solve the problem. As soon as the GitHub actions CI changes to Ubuntu Focal runners it will no longer be possible to install gfortran 3 on them and my tests will fail again.

According to https://github.com/modelica/fmi-cross-check/issues/99 it is fine for FMUs to have external dependencies. So my only option as a FMU importer is to skip all JModelica.org tests since they can't run anyway. But what is the point of the cross-check then if it is not possible to import these FMUs?

So my suggestion is to add nonCompliantWithLatestRules to all JModelica.org FMUs that depend on libgfortran.so.3.