Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to build on aarch64 Linux #18353

Closed
hfiguiere opened this issue Jul 2, 2023 · 11 comments · Fixed by #18575
Closed

Fail to build on aarch64 Linux #18353

hfiguiere opened this issue Jul 2, 2023 · 11 comments · Fixed by #18575
Assignees
Labels
dev Related to developer experience (compiling, code base, CI), rather than end user experience needs info More information is required before action can be taken regression MS4 Regression on a prior release

Comments

@hfiguiere
Copy link

hfiguiere commented Jul 2, 2023

Issue type

Other type of issue

Bug description

MuseScore 4.1.0-beta fails to build on aarch64 Linux.

/usr/bin/ccache /usr/bin/c++ -DDECODE_ON_THE_FLY -DFLAC__NO_DLL -DHAVE_CONFIG_H -DHAVE_MPGLIB -DHAVE_STDINT_H -DHAW_LOGGER_QT_SUPPORT -DHAW_PROFILER_ENABLED -DMUE_BUILD_ACCESSIBILITY_MODULE -DMUE_BUILD_APPSHELL_MODULE -DMUE_BUILD_AUDIO_MODULE -DMUE_BUILD_AUTOBOT_MODULE -DMUE_BUILD_BRAILLE_MODULE -DMUE_BUILD_CLOUD_MODULE -DMUE_BUILD_CONVERTER_MODULE -DMUE_BUILD_DIAGNOSTICS_MODULE -DMUE_BUILD_IMAGESEXPORT_MODULE -DMUE_BUILD_IMPORTEXPORT_MODULE -DMUE_BUILD_INSPECTOR_MODULE -DMUE_BUILD_INSTRUMENTSSCENE_MODULE -DMUE_BUILD_LANGUAGES_MODULE -DMUE_BUILD_LEARN_MODULE -DMUE_BUILD_MIDI_MODULE -DMUE_BUILD_MPE_MODULE -DMUE_BUILD_MULTIINSTANCES_MODULE -DMUE_BUILD_MUSESAMPLER_MODULE -DMUE_BUILD_NETWORK_MODULE -DMUE_BUILD_NOTATION_MODULE -DMUE_BUILD_PALETTE_MODULE -DMUE_BUILD_PLAYBACK_MODULE -DMUE_BUILD_PLUGINS_MODULE -DMUE_BUILD_PROJECT_MODULE -DMUE_BUILD_SHORTCUTS_MODULE -DMUE_BUILD_UI_MODULE -DMUE_BUILD_UPDATE_MODULE -DMUE_BUILD_WORKSPACE_MODULE -DMUE_ENABLE_AUDIO_EXPORT -DMUSESCORE_BUILD_NUMBER=\"\" -DMUSESCORE_INSTALL_NAME=\"mscore-4.1/\" -DMUSESCORE_INSTALL_PREFIX=\"/app\" -DMUSESCORE_INSTALL_SUFFIX=\"\" -DMUSESCORE_REVISION=\"\" -DMUSESCORE_UNSTABLE -DMUSESCORE_VERSION=\"4.1.0\" -DMUSESCORE_VERSION_LABEL=\"dev\" -DNDEBUG -DNO_GLIB -DNO_THREADS -DOUTSIDE_SPEEX -DPROJECT_ROOT_DIR=\"/run/build/musescore\" -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORKAUTH_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_PRINTSUPPORT_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_QUICKCONTROLS2_LIB -DQT_QUICKTEMPLATES2_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_SUPPORT -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DRANDOM_PREFIX=opusenc_prefix -DSCRIPT_INTERFACE -DSTDC_HEADERS -DTAKEHIRO_IEEE754_HACK -DUSE_FAST_LOG -Daudio_QML_IMPORT=\"/run/build/musescore/src/framework/audio/qml\" -Dflac_QML_IMPORT=\"\" -Dfluidsynth_QML_IMPORT=\"\" -Dglobal_EXPORTS=1 -Dglobal_QML_IMPORT=\"\" -Dieee754_float32_t=float -Dlame_QML_IMPORT=\"\" -Dopusenc_QML_IMPORT=\"\" -I/run/build/musescore/_flatpak_build/src/framework/audio -I/run/build/musescore/src/framework/audio -I/run/build/musescore/_flatpak_build/src/framework/audio/audio_autogen/include -I/run/build/musescore/_flatpak_build -I/run/build/musescore -I/run/build/musescore/src -I/run/build/musescore/src/framework -I/run/build/musescore/src/framework/global -I/run/build/musescore/src/engraving -I/run/build/musescore/thirdparty/googletest/googletest/include -I/run/build/musescore/thirdparty/fluidsynth/fluidsynth-2.1.4/include -I/run/build/musescore/thirdparty/fluidsynth/fluidsynth-2.1.4/src -I/run/build/musescore/thirdparty/fluidsynth/fluidsynth-2.1.4/src/external -I/run/build/musescore/thirdparty/fluidsynth/fluidsynth-2.1.4/src/utils -I/run/build/musescore/thirdparty/fluidsynth/fluidsynth-2.1.4/src/midi -I/run/build/musescore/thirdparty/fluidsynth/fluidsynth-2.1.4/src/rvoice -I/run/build/musescore/thirdparty/fluidsynth/fluidsynth-2.1.4/src/sfloader -I/run/build/musescore/thirdparty/fluidsynth/fluidsynth-2.1.4/src/bindings -I/run/build/musescore/thirdparty/fluidsynth/fluidsynth-2.1.4/src/synth -I/run/build/musescore/thirdparty/fluidsynth/fluidsynth-2.1.4/src/drivers -I/run/build/musescore/_flatpak_build/src/framework/global -I/run/build/musescore/_flatpak_build/src/framework/audio/fluidsynth -I/run/build/musescore/_flatpak_build/src/framework/audio/lame -I/run/build/musescore/thirdparty/lame/include -I/run/build/musescore/thirdparty/lame/libmp3lame -I/run/build/musescore/thirdparty/lame/mpglib -I/run/build/musescore/thirdparty/lame -I/run/build/musescore/_flatpak_build/src/framework/audio/opusenc -I/run/build/musescore/thirdparty/opusenc/libopusenc-0.2.1/include -I/run/build/musescore/thirdparty/opusenc/libopusenc-0.2.1/src -I/run/build/musescore/thirdparty/opusenc/libopusenc-0.2.1 -I/run/build/musescore/thirdparty/opus/include -I/run/build/musescore/_flatpak_build/src/framework/audio/flac -I/run/build/musescore/thirdparty/flac/flac-1.3.4 -I/run/build/musescore/thirdparty/flac/flac-1.3.4/include -I/run/build/musescore/thirdparty/flac/flac-1.3.4/src -I/run/build/muse
core/thirdparty/flac/flac-1.3.4/src/libFLAC/include -I/run/build/musescore/thirdparty/flac/flac-1.3.4/src/libFLAC++/include -isystem /usr/include/QtCore -isystem /usr/lib/mkspecs/linux-g++ -isystem /usr/include/QtGui -isystem /usr/include/QtNetwork -isystem /usr/include/QtNetworkAuth -isystem /usr/include/QtQml -isystem /usr/include/QtQuick -isystem /usr/include/QtQmlModels -isystem /usr/include/QtQuickControls2 -isystem /usr/include/QtQuickTemplates2 -isystem /usr/include/QtQuickWidgets -isystem /usr/include/QtWidgets -isystem /usr/include/QtXml -isystem /usr/include/QtXmlPatterns -isystem /usr/include/QtSvg -isystem /usr/include/QtPrintSupport -isystem /usr/include/QtOpenGL -isystem /usr/include/QtConcurrent -isystem /usr/include/QtDBus -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -O2 -g -DNDEBUG -std=gnu++17 -Wall -Wextra -fPIC -Winvalid-pch -include /run/build/musescore/_flatpak_build/src/framework/global/CMakeFiles/global.dir/cmake_pch.hxx -MD -MT src/framework/audio/CMakeFiles/audio.dir/Unity/unity_3_cxx.cxx.o -MF src/framework/audio/CMakeFiles/audio.dir/Unity/unity_3_cxx.cxx.o.d -o src/framework/audio/CMakeFiles/audio.dir/Unity/unity_3_cxx.cxx.o -c /run/build/musescore/_flatpak_build/src/framework/audio/CMakeFiles/audio.dir/Unity/unity_3_cxx.cxx
In file included from /run/build/musescore/src/framework/audio/internal/fx/reverb/simdtypes.h:40,
                 from /run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:37,
                 from /run/build/musescore/_flatpak_build/src/framework/audio/CMakeFiles/audio.dir/Unity/unity_3_cxx.cxx:11:
/run/build/musescore/src/framework/audio/internal/fx/reverb/simdtypes_neon.h: In constructor ‘mu::audio::fx::simd::float_x4::float_x4(float, float, float, float)’:
/run/build/musescore/src/framework/audio/internal/fx/reverb/simdtypes_neon.h:69:30: error: cannot convert ‘<brace-enclosed initializer list>’ to ‘float32x4_t’ in assignment
   69 |         s = { v0, v1, v2, v3 };
      |                              ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp: In member function ‘void mu::audio::fx::ReverbProcessor::calculateTailParams()’:
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:414:32: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  414 |         d->damping_cf1_x4[x].a1[y] = cf1.a1;
      |                                ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:415:32: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  415 |         d->damping_cf1_x4[x].a2[y] = cf1.a2;
      |                                ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:416:32: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  416 |         d->damping_cf1_x4[x].b0[y] = cf1.b0;
      |                                ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:417:32: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  417 |         d->damping_cf1_x4[x].b1[y] = cf1.b1;
      |                                ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:418:32: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  418 |         d->damping_cf1_x4[x].b2[y] = cf1.b2;
      |                                ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:420:32: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  420 |         d->damping_cf2_x4[x].a1[y] = cf2.a1;
      |                                ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:421:32: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  421 |         d->damping_cf2_x4[x].a2[y] = cf2.a2;
      |                                ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:422:32: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  422 |         d->damping_cf2_x4[x].b0[y] = cf2.b0;
      |                                ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:423:32: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  423 |         d->damping_cf2_x4[x].b1[y] = cf2.b1;
      |                                ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:424:32: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  424 |         d->damping_cf2_x4[x].b2[y] = cf2.b2;
      |                                ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:426:33: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  426 |         d->ag_filter_x4[x].cf.b0[y] = ag_cf.b0;
      |                                 ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:427:33: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  427 |         d->ag_filter_x4[x].cf.b1[y] = ag_cf.b1;
      |                                 ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:428:33: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  428 |         d->ag_filter_x4[x].cf.a1[y] = ag_cf.a1;
      |                                 ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp: In member function ‘void mu::audio::fx::ReverbProcessor::_processLines(float**, int32_t)’:
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:732:54: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  732 |                 mat_in[i] = delay_out_ptr[i][cnt] = s[0];
      |                                                      ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:733:62: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  733 |                 mat_in[i + 1] = delay_out_ptr[i + 1][cnt] = s[1];
      |                                                              ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:734:62: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  734 |                 mat_in[i + 2] = delay_out_ptr[i + 2][cnt] = s[2];
      |                                                              ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:735:62: error: no match for ‘operator[]’ (operand types are ‘mu::audio::fx::simd::float_x4’ and ‘int’)
  735 |                 mat_in[i + 3] = delay_out_ptr[i + 3][cnt] = s[3];
      |                                                              ^
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp: In member function ‘void mu::audio::fx::ReverbProcessor::Processor::setupParameter(int, const std::string&, std::pair<float, float>, float)’:
/run/build/musescore/src/framework/audio/internal/fx/reverb/reverbprocessor.cpp:816:6: note: parameter passing for argument of type ‘std::pair<float, float>’ when C++17 is enabled changed to match C++14 in GCC 10.1
  816 | void ReverbProcessor::Processor::setupParameter(int index, const std::string& name,
      |      ^~~~~~~~~~~~~~~

Steps to reproduce

Build Linux aarch64 with gcc 12.2.0

Screenshots/Screen recordings

No response

MuseScore Version

4.1.0-beta

Regression

Yes, this used to work in a previous version of MuseScore 4.x

Operating system

Linux aarch64

Additional context

-- Using Compiler GCC 12.2.0

It all in src/framework/audio/internal/fx/reverb/simdtypes_neon.h

https://github.com/musescore/MuseScore/blob/master/src/framework/audio/internal/fx/reverb/simdtypes_neon.h#L73

You need to add GNUC to the #if so that the helper is built with gcc.

https://github.com/musescore/MuseScore/blob/master/src/framework/audio/internal/fx/reverb/simdtypes_neon.h#L61C1-L61C60

the initialization with an initializer list is not allowed in gcc 12.2.0, using simd intrinsics shall be used.

(I do have a working patch)

@muse-bot muse-bot added needs review The issue needs review to set priority, fix version or change status etc. regression MS4 Regression on a prior release labels Jul 2, 2023
@bkunda
Copy link

bkunda commented Jul 3, 2023

@cbjeukendrup @shoogle when you have the opportunity could you please see if you can assist here?

@cbjeukendrup
Copy link
Contributor

(I do have a working patch)

@hfiguiere If you could submit this patch as a pull request, that would be great! (Especially since we don't really have arm64 Linux machines ready to test)

@hfiguiere
Copy link
Author

I can't because if I do you'll ask me to sign a CLA.

@cbjeukendrup
Copy link
Contributor

Okay, that's a pity. (The CLA is not such a big deal in my view, but I respect your choice of course.)
I'll need to read up on NEON intrinsics then... 😄

For the [] operators: do you know if GCC allows to return s[n] as a float& reference, or does it need the same treatment as Clang?

And for the { … } initialiser: is the solution to init each component separately, like s[0] = v0; s[1] = v1; …?

@cbjeukendrup cbjeukendrup added needs info More information is required before action can be taken and removed needs review The issue needs review to set priority, fix version or change status etc. labels Jul 10, 2023
@theofficialgman
Copy link
Contributor

@hfiguiere just drop the .patch file here so we understand what you are talking about. I think you intended to link multiple lines of code https://github.com/musescore/MuseScore/blob/master/src/framework/audio/internal/fx/reverb/simdtypes_neon.h#L61C1-L61C60 but this link is broken and only shows one

@cbjeukendrup cbjeukendrup added the dev Related to developer experience (compiling, code base, CI), rather than end user experience label Jul 15, 2023
theofficialgman added a commit to theofficialgman/MuseScore that referenced this issue Sep 6, 2023
theofficialgman added a commit to theofficialgman/MuseScore that referenced this issue Sep 6, 2023
@cheesy94
Copy link

cheesy94 commented Nov 9, 2023

Hi all, yesterday I was trying to build Musescore from the master branch in a Debian based system (Raspberry Pi OS Bullseye for RPi4, aarch64) following the instructions in the Wiki:

  • I installed the dependencies and Qt version 5.15.2 through apt (I suggest adding "qml-module-qt-labs-platform" in the "To run MuseScore" part as I needed it later).
  • Then, I used the build.cmake script (didn't need the locating Qt step).

I got the same error messages posted here so I went ahead with the solution given, replacing line 73 in simdtypes_neon.h

#if __clang__
with
#if __clang__ or __GNUC__

The "operator[]" errors disappeared, but the ‘float32x4_t’ assignment error was still there. Then I found this PR https://github.com/audacity/audacity/pull/5503/files/4f165d7afcbb7cb2bb9769b02b460d8a2994afc9 in the audacity repository, which fixes the ‘float32x4_t’ assignment error.

After a succesful build, I got Musescore to run, being able to create a new score. Nevertheless I couldn't open an existing project because the dialog wouldn't appear, so I installed the "qml-module-qt-labs-platform" package mentioned before (saw something in the debug info about it). Now, despite many warnings and errors in the debug info, I can use it properly.

@hfiguiere
Copy link
Author

The flatpak is built using that patch:
https://github.com/flathub/org.musescore.MuseScore/blob/master/patches/musescore_simd_aarch64.patch

@Jojo-Schmitz
Copy link
Contributor

It'd be quite usefull if package maintainers would send their patches upstream

@hfiguiere
Copy link
Author

It'd be quite usefull if package maintainers would send their patches upstream

#18353 (comment)

@Jojo-Schmitz
Copy link
Contributor

Not a valid reason IMHO

theofficialgman added a commit to theofficialgman/MuseScore that referenced this issue Nov 14, 2023
@theofficialgman
Copy link
Contributor

IMHO due to the simplicity and only one way of solving the problem the original creator of the patch does not hold any copyright to it and anyone could reasonably PR it to the repo. I will just add to to my open PR as its own commit once I get it in a workable state.

theofficialgman added a commit to theofficialgman/MuseScore that referenced this issue Nov 15, 2023
theofficialgman added a commit to theofficialgman/MuseScore that referenced this issue Nov 17, 2023
theofficialgman added a commit to theofficialgman/MuseScore that referenced this issue Nov 18, 2023
theofficialgman added a commit to theofficialgman/MuseScore that referenced this issue Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Related to developer experience (compiling, code base, CI), rather than end user experience needs info More information is required before action can be taken regression MS4 Regression on a prior release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants