Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3640 closed defect (worksforme)

Compilation errors for Modelica.Math.FastFourierTransform.Examples.RealFFT1

Reported by: martin.otter@… Owned by: Adrian Pop
Priority: high Milestone: 1.9.4
Component: Build Environment Version:
Keywords: Cc: Martin.Otter@…

Description

There are the following compilation errors with OpenModelica 1.9.4 dev 663 (last nightly build for Windows) for model Modelica.Math.FastFourierTransform.Examples.RealFFT1 (Modelica trunk; 3.2.2 Beta.1):

Modelica.Math.FastFourierTransform.Examples.RealFFT1_05evt.o Modelica.Math.FastFourierTransform.Examples.RealFFT1_05evt.c
Modelica.Math.FastFourierTransform.Examples.RealFFT1_functions.c: In function 'omc_Modelica_Math_FastFourierTransform_Internal_rawRealFFT':
Modelica.Math.FastFourierTransform.Examples.RealFFT1_functions.c:51: error: '_work' undeclared (first use in this function)
Modelica.Math.FastFourierTransform.Examples.RealFFT1_functions.c:51: error: (Each undeclared identifier is reported only once
Modelica.Math.FastFourierTransform.Examples.RealFFT1_functions.c:51: error: for each function it appears in.)

In Modelica.Math.FastFourierTransform.Internal.rawRealFFT the external C-Code of the FFT is called and a work array is used for this:

protected
  Real work[3*size(u,1) + 2*(div(size(u,1),2)+1)];
  external "C" info = ModelicaFFT_kiss_fftr(u, size(u,1), work, size(work,1), amplitudes, phases)

It seems that array "work" is "somehow" not included in the generated C-Code

Note, this FFT function is now used in the Modelica_Requirements library for several requirement blocks and in examples.

Change History (11)

comment:1 by Per Östlund, 9 years ago

Component: BackendCode Generation
Owner: changed from Lennart Ochel to Per Östlund
Status: newaccepted

comment:2 by Per Östlund, 9 years ago

Resolution: fixed
Status: acceptedclosed

Fixed in f105a55.

comment:3 by martin.otter@…, 9 years ago

Resolution: fixed
Status: closedreopened

Compilation of Modelica.Math.FastFourierTransform.Examples.RealFFT1 (Modelica from trunk) with OpenModelica v1.9.4-dev-751-g675b7d6 (nightly build from today) results in the following linker error message:

Modelica/Resources/Library/win32/libModelicaMatIO.a(ModelicaMatIO.o):ModelicaMatIO.c:(.text+0x38ab): undefined reference to `__chkstk_ms'
Modelica/Resources/Library/win32/libModelicaMatIO.a(ModelicaMatIO.o):ModelicaMatIO.c:(.text+0x41fb): undefined reference to `__chkstk_ms'
Modelica/Resources/Library/win32/libModelicaMatIO.a(ModelicaMatIO.o):ModelicaMatIO.c:(.text+0x2756b): undefined reference to `__chkstk_ms'
collect2: ld returned 1 exit status
OpenModelica1.9.4-dev\MinGW\bin\mingw32-make: *** [omc_main_target] Error 1
Compilation process failed. Exited with code 2.

Obviously, some symbols are not resolved in libModelicaMatIO.a. This library is used in MSL 3.2.2 (on trunk) but not in MSL 3.2.1 shipped with OpenModelica. So, one can understand that something goes wrong. Can this be fixed on your side, or what do I have to do in order to get the "right" object library.

comment:4 by Per Östlund, 9 years ago

Component: Code GenerationBuild Environment
Owner: changed from Per Östlund to Adrian Pop
Status: reopenedassigned

It seems to be some MinGW issue on Windows, it works fine for me in Linux.

comment:5 by Martin Sjölund, 9 years ago

Adrian: Can you check if this works with the MSL shipped with OpenModelica? From the directory structure, it seems Martin (O.) used the MSL from modelica.org trunk which is probably pre-compiled with an incompatible version of MinGW. (This is why I really dislike having pre-compiled libraries in SVN, and why OpenModelica removes all pre-compiled binaries from MSL before shipping it).

comment:6 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

comment:7 by Martin Sjölund, 9 years ago

Milestone: 1.9.51.10.0

Milestone renamed

comment:8 by Christoph <buchner@…>, 9 years ago

the Modelica_Requirements library

martin.otter: btw, can you say what the status of this library is? It sounds interesting, and I found a couple of papers/posts which said that it's open-source, but I can't find a trace of it online...

comment:9 by Martin Sjölund, 9 years ago

Milestone: 1.10.01.9.4
Resolution: worksforme
Status: assignedclosed

This worked with the MSL trunk shipped with OpenModelica

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

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:11 by Martin Sjölund, 9 years ago

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.