Installing tracktion_engine on a raspberry pi

Im trying to install tracktion engine on a raspberry pi 4 B running raspberry os, but i keep getting this error when running make:


Building CXX object examples/Benchmarks/CMakeFiles/Benchmarks.dir/Benchmarks.cpp.o
cc1plus: error: unknown value 'sandybridge' for '-march'
cc1plus: note: valid arguments are: armv8-a armv8.1-a armv8.2-a armv8.3-a armv8.4-a armv8.5-a armv8.6-a armv8.7-a armv8.8-a armv8-r armv9-a native
make[2]: *** [examples/Benchmarks/CMakeFiles/Benchmarks.dir/build.make:80: examples/Benchmarks/CMakeFiles/Benchmarks.dir/Benchmarks.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:271: examples/Benchmarks/CMakeFiles/Benchmarks.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

when i change the -march argument in examples/Benchmarks/CMakeFiles/Benchmarks.dir/flags.make to ‘native’ i get this error:

[  1%] Building CXX object examples/Benchmarks/CMakeFiles/Benchmarks.dir/Benchmarks.cpp.o
In file included from /home/kiosk_user/tracktion_engine/modules/tracktion_core/utilities/tracktion_Tempo.h:19,
                 from /home/kiosk_user/tracktion_engine/modules/tracktion_core/tracktion_core.h:56,
                 from /home/kiosk_user/tracktion_engine/build/examples/Benchmarks/Benchmarks_artefacts/JuceLibraryCode/JuceHeader.h:14,
                 from /home/kiosk_user/tracktion_engine/examples/Benchmarks/Benchmarks.cpp:11:
/home/kiosk_user/tracktion_engine/modules/tracktion_core/utilities/tracktion_Bezier.h: In function 'std::pair<double, double> tracktion::core::getBezierPoint(double, double, double, double, double)':
/home/kiosk_user/tracktion_engine/modules/tracktion_core/utilities/tracktion_Bezier.h:20:72: note: parameter passing for argument of type 'std::pair<double, double>' when C++17 is enabled changed to match C++14 in GCC 10.1
   20 |                                                              double c) noexcept
      |                                                                        ^~~~~~~~
In file included from /home/kiosk_user/tracktion_engine/modules/tracktion_engine/../3rd_party/crill/progressive_backoff_wait.h:10,
                 from /home/kiosk_user/tracktion_engine/modules/tracktion_engine/../3rd_party/crill/spin_mutex.h:11,
                 from /home/kiosk_user/tracktion_engine/modules/tracktion_engine/tracktion_engine.h:389,
                 from /home/kiosk_user/tracktion_engine/build/examples/Benchmarks/Benchmarks_artefacts/JuceLibraryCode/JuceHeader.h:18:
/home/kiosk_user/tracktion_engine/modules/tracktion_engine/../3rd_party/crill/impl/progressive_backoff_wait_impl.h: In function 'void crill::impl::progressive_backoff_wait_armv8(Predicate&&)':
/home/kiosk_user/tracktion_engine/modules/tracktion_engine/../3rd_party/crill/impl/progressive_backoff_wait_impl.h:80:17: error: there are no arguments to '__wfe' that depend on a template parameter, so a declaration of '__wfe' must be available [-fpermissive]
   80 |                 __wfe();
      |                 ^~~~~
/home/kiosk_user/tracktion_engine/modules/tracktion_engine/../3rd_party/crill/impl/progressive_backoff_wait_impl.h:80:17: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
In file included from /home/kiosk_user/tracktion_engine/modules/tracktion_engine/tracktion_engine.h:483:
/home/kiosk_user/tracktion_engine/modules/tracktion_engine/playback/tracktion_LevelMeasurer.h: In member function 'std::pair<float, float> tracktion::engine::LevelMeasurer::getLevelCache() const':
/home/kiosk_user/tracktion_engine/modules/tracktion_engine/playback/tracktion_LevelMeasurer.h:95:61: 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
   95 |     std::pair<float, float> getLevelCache() const noexcept  { return { levelCacheL, levelCacheR }; }
      |                                                             ^
In file included from /home/kiosk_user/tracktion_engine/modules/tracktion_graph/../3rd_party/rigtorp/tracktion_rigtorp.hpp:17,
                 from /home/kiosk_user/tracktion_engine/modules/tracktion_graph/tracktion_graph.h:81,
                 from /home/kiosk_user/tracktion_engine/build/examples/Benchmarks/Benchmarks_artefacts/JuceLibraryCode/JuceHeader.h:29:
/home/kiosk_user/tracktion_engine/modules/tracktion_graph/../3rd_party/rigtorp/MPMCQueue.h: At global scope:
/home/kiosk_user/tracktion_engine/modules/tracktion_graph/../3rd_party/rigtorp/MPMCQueue.h:45:10: warning: use of 'std::hardware_destructive_interference_size' [-Winterference-size]
   45 |     std::hardware_destructive_interference_size;
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kiosk_user/tracktion_engine/modules/tracktion_graph/../3rd_party/rigtorp/MPMCQueue.h:45:10: note: its value can vary between compiler versions or with different '-mtune' or '-mcpu' flags
/home/kiosk_user/tracktion_engine/modules/tracktion_graph/../3rd_party/rigtorp/MPMCQueue.h:45:10: note: if this use is part of a public ABI, change it to instead use a constant variable you define
/home/kiosk_user/tracktion_engine/modules/tracktion_graph/../3rd_party/rigtorp/MPMCQueue.h:45:10: note: the default value for the current CPU tuning is 256 bytes
/home/kiosk_user/tracktion_engine/modules/tracktion_graph/../3rd_party/rigtorp/MPMCQueue.h:45:10: note: you can stabilize this value with '--param hardware_destructive_interference_size=256', or disable this warning with '-Wno-interference-size'
/home/kiosk_user/tracktion_engine/modules/tracktion_engine/../3rd_party/crill/impl/progressive_backoff_wait_impl.h: In instantiation of 'void crill::impl::progressive_backoff_wait_armv8(Predicate&&) [with long unsigned int N0 = 2; long unsigned int N1 = 750; Predicate = crill::spin_mutex::lock()::<lambda()>]':
/home/kiosk_user/tracktion_engine/modules/tracktion_engine/../3rd_party/crill/progressive_backoff_wait.h:39:49:   required from 'void crill::progressive_backoff_wait(Predicate&&) [with Predicate = spin_mutex::lock()::<lambda()>]'
/home/kiosk_user/tracktion_engine/modules/tracktion_engine/../3rd_party/crill/spin_mutex.h:40:33:   required from here
/home/kiosk_user/tracktion_engine/modules/tracktion_engine/../3rd_party/crill/impl/progressive_backoff_wait_impl.h:80:22: error: '__wfe' was not declared in this scope
   80 |                 __wfe();
      |                 ~~~~~^~
make[2]: *** [examples/Benchmarks/CMakeFiles/Benchmarks.dir/build.make:80: examples/Benchmarks/CMakeFiles/Benchmarks.dir/Benchmarks.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:271: examples/Benchmarks/CMakeFiles/Benchmarks.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

Is there a fix to this? if so then i have failed to find it online.
any help/explanation is greatly appreciated!

You’ve correctly changed -march=native but it looks like you’re using GCC 10?

Can you update to at least 11? That’s what we build Waveform on Pi with.

I have updated gcc to version 12.2 but i keep getting the exact same error. Do i need to configure Make to use GCC 12?

Possibly, it depends how you updated gcc.
Look at the cmake log file, it should say what version of gcc it’s detected near the start.

I think it’s the same as you’d get from typing gcc -version from the terminal.

You usually set the compiler to use by setting env vars before calling cmake:

export CC=/usr/bin/gcc-11
export CXX=/usr/bin/g++-11

The CMakeOutput.log file in tracktion_engine/build/CMakeFiles says

gcc version 12.2.0 (Debian 12.2.0-14)
...
GNU C17 (Debian 12.2.0-14) version 12.2.0 (aarch64-linux-gnu)
	compiled by GNU C version 12.2.0, GMP version 6.2.1, MPFR version 4.1.1-p1, MPC version 1.3.1, isl version isl-0.25-GMP

so it seems to me that it uses gcc 12.2. Whole file here. gcc -version returns the same.

export CC=/usr/bin/gcc-12 export CXX=/usr/bin/g+±12

didnt change anything.
Running

make CC=/usr/bin/gcc-12 CXX=/usr/bin/g+±12

doesnt work either.

I’ve just checked out logs and we actually use Clang 14.0.6 on Pi.
I’m not quite sure why though, @RolandMR set our Pi up for us. Maybe he can comment in case he’s seen this?

1 Like

I was running into the same issues myself. Turned out that the sandybridge error was coming from trying to build the Benchmarks example which I don’t think is entirely necessary. When I just ran make -j4 Modules DemoRunner it finally worked. Hope this helps!

sandy bridge I believe is a micro-architecture on intel x86, and the pi is gonna be arm so to compile I’d guess you would need to detect the architecture in cmake.

That’s what the above should do.