Build issue on macOS / iOS + JUCE 7.0.2


I’m currently working on a tracktion+JUCE based app with other 3rd party dependencies. Tracktion develop branch has been updated to use JUCE 7.0.2. I’d like to follow the update as some bugs have been fixed.

As a result, I’m having a nasty build issue. I rely on CMake for generating Xcode projects on macOS and iOS.

During the build phase, in (juce_gui_basics.cpp), I get this error in /Applications/

[...]/MacOSX12.3.sdk/usr/include/simd/geometry.h:780:80: error: use of undeclared identifier 'simd_reduce_add'
static float  SIMD_CFUNC simd_dot(simd_float2  __x, simd_float2  __y) { return simd_reduce_add(__x*__y); }

The error comes down to the MetalKit include in juce_gui_basics.cpp:

 #import <WebKit/WebKit.h>
 #import <IOKit/pwr_mgt/IOPMLib.h>
 #import <MetalKit/MetalKit.h>

Digging into the various Accelerate simd headers, this simd_reduce_add function is declared in [...]/usr/include/simd/common.h, but guarded by this preprocessor directive:


This macro is set to 1 in [...]/usr/include/simd/base.h when the compiler has the ext_vector_type and overloadable extensions. After some reseach, these are clang extensions.

# if __has_attribute(__ext_vector_type__) && __has_attribute(__overloadable__)
# else
/*  Your compiler is missing one or more features that are hard requirements
 *  for any <simd/simd.h> support. None of the types or functions defined by
 *  the simd headers will be available.                                       */
# endif

I checked the command line invocation for and it is definitely using clang.

I’m on Xcode 14.0.1 / macOS 12.6 / M1 mac mini.

I tried with Xcode 13.4.1 with the same results; same for enforcing x86_64 (Rosetta).

My CMakeLists.txt file is pretty generic. I tried removing as much options as necessary but to no avail.

Calling all CMake & clang gurus!

Thanks in advance for any help/pointers you can provide.


OK this one was really tricky!

I have a 3rd party library that contains a simd/Common.h file (note the upper case ‘C’).

The system Accelerate simd library also contains a simd/common.h (lowercase ‘c’) file which includes that simd_reduce_add function. It was mistakenly including my other 3rd party library simd/Common.h file. This might be because the macOS filesystem is case insensitive by default (unless your format your drive especially with the case sensitive function). Jeez!

I guess I’ll have to rename the 3rd party library Common.h file, but there might be a better alternative? Open to hear your ideas !

Thanks in advance,