Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#3640 closed defect (worksforme)

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

Reported by: martin.otter@… Owned by: adrpo
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 Changed 9 years ago by perost

  • Component changed from Backend to Code Generation
  • Owner changed from lochel to perost
  • Status changed from new to accepted

comment:2 Changed 9 years ago by perost

  • Resolution set to fixed
  • Status changed from accepted to closed

Fixed in f105a55.

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

  • Resolution fixed deleted
  • Status changed from closed to reopened

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 Changed 9 years ago by perost

  • Component changed from Code Generation to Build Environment
  • Owner changed from perost to adrpo
  • Status changed from reopened to assigned

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

comment:5 Changed 9 years ago by sjoelund.se

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 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.4 to 1.9.5

Milestone pushed to 1.9.5

comment:7 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.5 to 1.10.0

Milestone renamed

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

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 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.10.0 to 1.9.4
  • Resolution set to worksforme
  • Status changed from assigned to closed

This worked with the MSL trunk shipped with OpenModelica

comment:10 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.9.4 to 1.9.4-1.9.x

Milestone renamed

comment:11 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.9.4-1.9.x to 1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.