MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007690ardourbugspublic2018-11-24 03:302018-11-24 23:22
Reporteraquilarubra 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
Platformx86_64OSWindowsOS Version10
Product Version5.X git (version in description) 
Target VersionFixed in Version 
Summary0007690: M_PI compilation issues
Descriptionmath.h is not included in all the required places, at least while compiling with mingw-w64.

To compile correctly, I currently need to modify the source:

sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/qm-dsp/base/KaiserWindow.h
sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/qm-dsp/base/Window.h
sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/qm-dsp/base/SincWindow.h
sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/qm-dsp/dsp/phasevocoder/PhaseVocoder.h
sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/qm-dsp/maths/MathUtilities.h
sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/vamp-plugins/TruePeak.h
sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/zita-resampler/zita-resampler/resampler-table.h
sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/pbd/boost_debug.cc
sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/pbd/cartesian.cc

I used the usual definition of M_PI from math.h, but for better precision it can be:

#define M_PI 3.14159265358979323846264338327950288

#define M_PI
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0020477)
x42 (administrator)
2018-11-24 05:17

Could you please provide actual compiler invocation, flags and output how those fail and what the issue is that you address?

qm-dsp is C++ library. KaiserWindow.h for example does #include <cmath> for C's math.h
libs/pbd/cartesian.cc does have a <math.h> include..

It does compiles just fine with mingw-w64: https://nightly.ardour.org/i/A_WIN_x86_64/build_log.txt [^]
Also John Emmas maintains a MSVC build where this isn't an issue apparently.
(0020478)
timbyr (developer)
2018-11-24 14:46

John Emmas probably has _USE_MATH_DEFINES defined in his MSVC build config.

Newer versions of mingw-w64 also require this AFAIR, I guess to be more like MSVC headers.

Perhaps also see:

https://stackoverflow.com/questions/6563810/m-pi-works-with-math-h-but-not-with-cmath-in-visual-studio/ [^]
(0020486)
aquilarubra (reporter)
2018-11-24 23:22

I was also perplex, because it seemed to me that there was the <cmath> include, but it wasn't picked up.

Anyway, since last week I saw there was a important revamp of the code, which passed from 1031 compilation cases to 999. Now it works. No errors any longer.

- Issue History
Date Modified Username Field Change
2018-11-24 03:30 aquilarubra New Issue
2018-11-24 05:17 x42 Note Added: 0020477
2018-11-24 14:46 timbyr Note Added: 0020478
2018-11-24 23:22 aquilarubra Note Added: 0020486


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker