Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#3169 closed defect (fixed)

Under Mac OS X, FMU binaries directory should be darwin64, not x86_64-apple-darwin13.2.0

Reported by: cxh@… Owned by: Martin Sjölund
Priority: normal Milestone: 1.9.2
Component: FMI Version: trunk
Keywords: Cc:

Description

Under Mac OS X, using the OpenModelica svn head from 20-Feb-2015, when exporting the BouncingBall fmu using openmodelica/testsuite/openmodelica/fmi/ModelExchange/2.0/BouncingBall.mos, the fmu is created with binaries/x86_64-apple-darwin13.2.0. According to the FMI-2.0 standard, it should be binaries/darwin64.

Here's how to reproduce:

bash-3.2$ mkdir /tmp/test                                                                                   
bash-3.2$ cd /tmp/test                                                                                      
bash-3.2$ uname -a                                                                                          
Darwin eallmac23.local 13.4.0 Darwin Kernel Version 13.4.0: Wed Dec 17 19:05:52 PST 2014; root:xnu-2422.115\
.10~1/RELEASE_X86_64 x86_64                                                                                 
bash-3.2$ cp ~/src/openmodelica/testsuite/openmodelica/fmi/ModelExchange/2.0/BouncingBall.mos .             
bash-3.2$ omc BouncingBall.mos                                                                              
true                                                                                                        
""                                                                                                          
"SimCode: The model BouncingBallFMI20 has been translated to FMU"                                           
"Warning: The initial conditions are not fully specified. Use +d=initialization for more information.       
"                                                                                                           
"BouncingBallFMI20_me_FMU.mo"                                                                               
""                                                                                                          
true                                                                                                        
""                                                                                                          
record SimulationResult                                                                                     
    resultFile = "",                                                                                        
    simulationOptions = "startTime = 0.0, stopTime = 3.0, numberOfIntervals = 500, tolerance = 1e-06, metho\
d = 'dassl', fileNamePrefix = 'BouncingBallFMI20_me_FMU', options = '', outputFormat = 'mat', variableFilte\
r = '.*', cflags = '', simflags = ''",                                                                      
    messages = "Simulation execution failed for model: BouncingBallFMI20_me_FMU                             
module = FMILIB, log level = FATAL: Could not change to the DLL directory /private/tmp/test/binaries/darwin\
64/                                                                                                         
module = FMILIB, log level = FATAL: The FMU contains no binary for this platform.                           
assert            | debug   | Loading of FMU dynamic link library failed with status : UNEXPECTED           
assert            | info    | simulation terminated by an assertion at initialization                       
                                                                                                            
Limited backtrace at point of segmentation fault                                                            
/bin/sh: line 1: 43206 Segmentation fault: 11  ( \"/private/tmp/test/BouncingBallFMI20_me_FMU\" )           
",                                                                                                          
    timeFrontend = 0.057755745,                                                                             
    timeBackend = 0.015780989,                                                                              
    timeSimCode = 0.01223577,                                                                               
    timeTemplates = 0.030908571,                                                                            
    timeCompile = 0.462934843                                                                               
end SimulationResult;                                                                                       
"Warning: The initial conditions are not fully specified. Use +d=initialization for more information.       
"                                                                                                           
                                                                                                            
                                                                                                            
 bash-3.2$ fmuCheck.darwin64 BouncingBallFMI20.fmu                                                           
[INFO][FMUCHK] FMI compliance checker Test [FMILibrary: Test] build date: Jan  5 2015                       
[INFO][FMUCHK] Called with following options:                                                               
[INFO][FMUCHK] fmuCheck.darwin64 BouncingBallFMI20.fmu                                                      
[INFO][FMUCHK] Will process FMU BouncingBallFMI20.fmu                                                       
[INFO][FMILIB] XML specifies FMI standard version 2.0                                                       
[INFO][FMUCHK] Model name: BouncingBallFMI20                                                                
[INFO][FMUCHK] Model GUID: {8c4e810f-3df3-4a00-8276-176fa3c9f9e0}                                           
[INFO][FMUCHK] Model version:                                                                               
[INFO][FMUCHK] FMU kind: ModelExchange                                                                      
[INFO][FMUCHK] The FMU contains:                                                                            
0 constants                                                                                                 
2 parameters                                                                                                
2 discrete variables                                                                                        
4 continuous variables                                                                                      
0 inputs                                                                                                    
0 outputs                                                                                                   
6 local variables                                                                                           
0 independent variables                                                                                     
0 calculated parameters                                                                                     
7 real variables                                                                                            
0 integer variables                                                                                         
0 enumeration variables                                                                                     
1 boolean variables                                                                                         
0 string variables                                                                                          
                                                                                                            
[INFO][FMUCHK] Printing output file header                                                                  
"time"                                                                                                      
[INFO][FMUCHK] Model identifier for ModelExchange: BouncingBallFMI20                                        
[FATAL][FMILIB] Could not change to the DLL directory /private/tmp/fmucktmpCpXJnr/binaries/darwin64/        
[FATAL][FMILIB] The FMU contains no binary for this platform.                                               
[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)                                                                                        
        3 Error(s)                                                                                          
        3 Fatal error(s) occurred during processing    

bash-3.2$ mkdir tmp                                                                                         
bash-3.2$ cd tmp                                                                                            
bash-3.2$ unzip ../BouncingBallFMI20.fmu                                                                    
Archive:  ../BouncingBallFMI20.fmu                                                                          
   creating: binaries/                                                                                      
   creating: binaries/x86_64-apple-darwin13.4.0/                                                            
  inflating: binaries/x86_64-apple-darwin13.4.0/BouncingBallFMI20.dylib                                     
 extracting: binaries/x86_64-apple-darwin13.4.0/BouncingBallFMI20_FMU.libs                                  
  inflating: modelDescription.xml                                                                           
   creating: sources/                                                                                       
  inflating: sources/BouncingBallFMI20.c                                                                    
  inflating: sources/BouncingBallFMI20_01exo.c                                                              
  inflating: sources/BouncingBallFMI20_02nls.c                                                              
  inflating: sources/BouncingBallFMI20_03lsy.c                                                              
  inflating: sources/BouncingBallFMI20_04set.c                                                              
  inflating: sources/BouncingBallFMI20_05evt.c                                                              
  inflating: sources/BouncingBallFMI20_06inz.c                                                              
  inflating: sources/BouncingBallFMI20_07dly.c                                                              
  inflating: sources/BouncingBallFMI20_08bnd.c                                                              
  inflating: sources/BouncingBallFMI20_09alg.c                                                              
  inflating: sources/BouncingBallFMI20_10asr.c                                                              
  inflating: sources/BouncingBallFMI20_11mix.c                                                              
 extracting: sources/BouncingBallFMI20_11mix.h                                                              
  inflating: sources/BouncingBallFMI20_12jac.c                                                              
  inflating: sources/BouncingBallFMI20_12jac.h                                                              
  inflating: sources/BouncingBallFMI20_13opt.c                                                              
  inflating: sources/BouncingBallFMI20_13opt.h                                                              
  inflating: sources/BouncingBallFMI20_14lnz.c                                                              
  inflating: sources/BouncingBallFMI20_FMU.c                                                                
 extracting: sources/BouncingBallFMI20_FMU.libs                                                             
  inflating: sources/BouncingBallFMI20_FMU.makefile                                                         
  inflating: sources/BouncingBallFMI20_functions.c                                                          
  inflating: sources/BouncingBallFMI20_functions.h                                                          
 extracting: sources/BouncingBallFMI20_includes.h                                                           
  inflating: sources/BouncingBallFMI20_info.c                                                               
  inflating: sources/BouncingBallFMI20_init.c                                                               
  inflating: sources/BouncingBallFMI20_literals.h                                                           
  inflating: sources/BouncingBallFMI20_model.h                                                              
  inflating: sources/BouncingBallFMI20_records.c                                                            
  inflating: sources/modelDescription.xml                                                                   
bash-3.2$ mv binaries/x86_64-apple-darwin13.4.0/ binaries/darwin64  

bash-3.2$ zip -r ../BouncingBallFMI20.fmu *                                                                 
updating: binaries/ (stored 0%)                                                                             
updating: modelDescription.xml (deflated 73%)                                                               
updating: sources/ (stored 0%)                                                                              
updating: sources/BouncingBallFMI20.c (deflated 76%)                                                        
updating: sources/BouncingBallFMI20_01exo.c (deflated 61%)                                                  
updating: sources/BouncingBallFMI20_02nls.c (deflated 59%)                                                  
updating: sources/BouncingBallFMI20_03lsy.c (deflated 63%)                                                  
updating: sources/BouncingBallFMI20_04set.c (deflated 59%)                                                  
updating: sources/BouncingBallFMI20_05evt.c (deflated 66%)                                                  
updating: sources/BouncingBallFMI20_06inz.c (deflated 72%)                                                  
updating: sources/BouncingBallFMI20_07dly.c (deflated 59%)                                                  
updating: sources/BouncingBallFMI20_08bnd.c (deflated 69%)                                                  
updating: sources/BouncingBallFMI20_09alg.c (deflated 59%)                                                  
updating: sources/BouncingBallFMI20_10asr.c (deflated 58%)                                                  
updating: sources/BouncingBallFMI20_11mix.c (deflated 61%)                                                  
updating: sources/BouncingBallFMI20_11mix.h (stored 0%)                                                     
updating: sources/BouncingBallFMI20_12jac.c (deflated 77%)                                                  
updating: sources/BouncingBallFMI20_12jac.h (deflated 84%)                                                  
updating: sources/BouncingBallFMI20_13opt.c (deflated 62%)                                                  
updating: sources/BouncingBallFMI20_13opt.h (deflated 54%)                                                  
updating: sources/BouncingBallFMI20_14lnz.c (deflated 62%)                                                  
updating: sources/BouncingBallFMI20_FMU.c (deflated 81%)                                                    
updating: sources/BouncingBallFMI20_FMU.libs (stored 0%)                                                    
updating: sources/BouncingBallFMI20_FMU.makefile (deflated 66%)                                             
updating: sources/BouncingBallFMI20_functions.c (deflated 46%)                                              
updating: sources/BouncingBallFMI20_functions.h (deflated 48%)                                              
updating: sources/BouncingBallFMI20_includes.h (stored 0%)                                                  
updating: sources/BouncingBallFMI20_info.c (deflated 88%)                                                   
updating: sources/BouncingBallFMI20_init.c (deflated 81%)                                                   
updating: sources/BouncingBallFMI20_literals.h (deflated 59%)                                               
updating: sources/BouncingBallFMI20_model.h (deflated 80%)                                                  
updating: sources/BouncingBallFMI20_records.c (deflated 24%)                                                
updating: sources/modelDescription.xml (deflated 73%)                                                       
  adding: binaries/darwin64/ (stored 0%)                                                                    
  adding: binaries/darwin64/BouncingBallFMI20.dylib (deflated 72%)                                          
  adding: binaries/darwin64/BouncingBallFMI20_FMU.libs (stored 0%)                                          
bash-3.2$ cd ..                                                                                             
bash-3.2$ fmuCheck.darwin64 BouncingBallFMI20.fmu   
bash-3.2$ fmuCheck.darwin64 BouncingBallFMI20.fmu                                                           
[INFO][FMUCHK] FMI compliance checker Test [FMILibrary: Test] build date: Jan  5 2015                       
[INFO][FMUCHK] Called with following options:                                                               
[INFO][FMUCHK] fmuCheck.darwin64 BouncingBallFMI20.fmu                                                      
[INFO][FMUCHK] Will process FMU BouncingBallFMI20.fmu                                                       
[INFO][FMILIB] XML specifies FMI standard version 2.0                                                       
[INFO][FMUCHK] Model name: BouncingBallFMI20                                                                
[INFO][FMUCHK] Model GUID: {8c4e810f-3df3-4a00-8276-176fa3c9f9e0}                                           
[INFO][FMUCHK] Model version:                                                                               
[INFO][FMUCHK] FMU kind: ModelExchange                                                                      
[INFO][FMUCHK] The FMU contains:                                                                            
0 constants                                                                                                 
2 parameters                                                                                                
2 discrete variables                                                                                        
4 continuous variables                                                                                      
0 inputs                                                                                                    
0 outputs                                                                                                   
6 local variables                                                                                           
0 independent variables                                                                                     
0 calculated parameters                                                                                     
7 real variables                                                                                            
0 integer variables                                                                                         
0 enumeration variables                 

...

0.996                                                                                                       
0.998                                                                                                       
1                                                                                                           
[INFO][FMUCHK] Simulation finished successfully at time 1                                                   
Segmentation fault: 11                                                                                      
bash-3.2$ 

Note that the BouncingBall segfaults under MacOS.

Running with a debug version of fmuCheck yields:

[INFO][FMUCHK] FMI compliance checker Test [FMILibrary: Test] build date: Feb 19 2015                       
[INFO][FMUCHK] Called with following options:                                                               
[INFO][FMUCHK] /Users/cxh/src/fmi/FMUChecker-2.0.1/build/fmuCheck.darwin64 BouncingBallFMI20.fmu            
[INFO][FMUCHK] Will process FMU BouncingBallFMI20.fmu                                                       
[INFO][FMILIB] XML specifies FMI standard version 2.0                                                       
Assertion failed: (index < a->size), function jm_vector_get_itemp_char, file /Users/cxh/src/fmi/FMUChecker-\
2.0.1/FMIL/src/Util/include/JM/jm_vector.h, line 352.

I'll submit a separate bug for this that refers to this bug

Change History (5)

comment:1 by Rüdiger Franke, 10 years ago

We are progressing towards more sensible names.

binaries/x86_64-darwin

will be allowed in FMI 2.0.1 according to current discussions. See https://trac.modelica.org/fmi/ticket/302#comment:16

Then it would be possible to distinguish e.g. iMac from iPad.

comment:2 by Martin Sjölund, 10 years ago

We changed from using uname to $host (in autoconf), and so the openmodelica spec changed, and darwin64 no longer detected...

r24672 should fix this.

comment:3 by Martin Sjölund, 10 years ago

Owner: changed from Adeel Asghar to Martin Sjölund
Status: newaccepted

comment:4 by Martin Sjölund, 10 years ago

Milestone: Future1.9.2
Resolution: fixed
Status: acceptedclosed

comment:5 by cxh@…, 10 years ago

This bug is back. The fmu contains binaries/x86_64-darwin13.4.0/ instead of binaries/darwin64/

To replicate:

HeatConductor.mo contains:

model HeatConductor "Test model for QSS"
  extends Modelica.Icons.Example;

Modelica.Blocks.Interfaces.RealInput TOut "Outside temperature"
  annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));

Modelica.Blocks.Interfaces.RealOutput TSur "Surface temperature"
  annotation (Placement(transformation(extent={{100,70},{120,90}})));

Real x "State";
initial equation
x=273.15;
equation
der(x) = TOut-x;
TSur = x;

 annotation (uses(Modelica(version="3.2.1")), Diagram(coordinateSystem(
   preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics));

end HeatConductor;

HeatConductor.mos contains:

loadModel(Modelica, {"3.2.1"});
getErrorString();
loadFile("HeatConductor.mo"); getErrorString();
OpenModelica.Scripting.translateModelFMU(
        className=HeatConductor,
        version="2.0");
getErrorString();

Create a fmu:

bash-3.2$ omc --version
1.9.3+dev (r25132)
bash-3.2$ omc HeatConductor.mos
true
""
true
""
"SimCode: The model HeatConductor has been translated to FMU"
""
bash-3.2$ mkdir tmp
bash-3.2$ cd tmp
bash-3.2$ ls -l ../HeatConductor.fmu
-rw-r--r--  1 cxh  staff  55637 Mar 18 20:32 ../HeatConductor.fmu
bash-3.2$ unzip ../HeatConductor.fmu
Archive:  ../HeatConductor.fmu
   creating: binaries/
   creating: binaries/x86_64-darwin13.4.0/
  inflating: binaries/x86_64-darwin13.4.0/HeatConductor.dylib
 extracting: binaries/x86_64-darwin13.4.0/HeatConductor_FMU.libs
...

binaries/x86_64-darwin13.4.0/ should be binaries/darwin64/

Note: See TracTickets for help on using tickets.