#Can't configure program with cmake on M2 Mac (Sonoma)

65 messages · Page 1 of 1 (latest)

ionic tree
#

Hello everyone, I'm trying to configure computer control on my new computer (M2 mac with MacOS Sonoma) but after following the tutorial and trying to run cmake to configure the program I'm getting the following errors:

-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Found OpenCV: /usr/local/Cellar/opencv/4.8.1_5 (found version "4.8.1")
-- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2")
-- Checking for one of the modules 'tesseract'
-- Checking for one of the modules 'lept'
-- Configuring done (1.2s)
CMake Error: AUTOUIC for target SerialPrograms: Test run of "uic" executable "/opt/homebrew/share/qt/libexec/uic" failed.
/opt/homebrew/share/qt/libexec/uic -h

dyld[39345]: Library not loaded: /opt/homebrew/opt/icu4c/lib/libicui18n.73.dylib
Referenced from: <70462C65-5579-3163-98AE-2BD41D311FC5> /opt/homebrew/Cellar/qt/6.5.2/lib/QtCore.framework/Versions/A/QtCore
Reason: tried: '/opt/homebrew/opt/icu4c/lib/libicui18n.73.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/icu4c/lib/libicui18n.73.dylib' (no such file), '/opt/homebrew/opt/icu4c/lib/libicui18n.73.dylib' (no such file), '/opt/homebrew/Cellar/icu4c/74.2/lib/libicui18n.73.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/icu4c/74.2/lib/libicui18n.73.dylib' (no such file), '/opt/homebrew/Cellar/icu4c/74.2/lib/libicui18n.73.dylib' (no such file)
Subprocess aborted
CMake Generate step failed. Build files cannot be regenerated correctly.

I was able to configure this fine on my previous mac (intel and monterey os), can anyone help guide me through what I've done wrong?

Thanks in advance

ionic tree
#

Hello again, I uninstalled qt 6.5.2 and installed it again to the latest version and the program started compiling but I got another error :/
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [SerialPrograms.app/Contents/MacOS/SerialPrograms] Error 1
make[1]: *** [CMakeFiles/SerialPrograms.dir/all] Error 2
make: *** [all] Error 2

knotty olive
#

Was cmake --build . -j 10 called from the build_mac directory?
Edit: the shouldn't be the cause of the error but good to check anyways. You could try deleting build_mac and reconfiguring it to start clean

ionic tree
#

Thank you! I went back on all the dialog to see the specific error and it seems to be this: found architecture 'x86_64', required architecture 'arm64'

#

I'm googling it but I can't exactly understand how to change the architecture for cmake... apparently this is an issue with the new mac processors 😦

#

I'm trying uninstalling homebrew and installing it again as I just realized since I configured my new mac through time machine that the homebrew it was installed was for the intel chip and not this one, hope that works

knotty olive
#

Yea that'll probably do it since it configures differently depending on arch

ionic tree
#

I corrected homebrew installation and reinstalled it again but now I get this error when trying to compile serial programs: error: field has incomplete type 'std::exception_ptr'

chrome spindle
#

Which file is it?

ionic tree
#

/Users/username/Games/Pokémon/Arduino-Source-0.46/Common/Cpp/LifetimeSanitizer.cpp:61:10: error: no member named 'terminate' in namespace 'std'; did you mean 'template'?
std::terminate();
~^~~~~
template

#

Also these
/Users/username/Games/Pokémon/Arduino-Source-0.46/SerialPrograms/../Common/Cpp/Concurrency/AsyncDispatcher.h:56:24: error: field has incomplete type 'std::exception_ptr'
std::exception_ptr m_exception;
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/c++/v1/__exception/operations.h:36:33: note: forward declaration of 'std::exception_ptr'
class _LIBCPP_EXPORTED_FROM_ABI exception_ptr;

#

Errors start at 3% of the build: Building CXX object CMakeFiles/SerialPrograms.dir/Users/username/Games/Pokémon/Arduino-Source-0.46/Common/Cpp/Options/DateOption.cpp.o

chrome spindle
#

Something seems really busted with your C++ compiler. Thonk

ionic tree
#

T_T

chrome spindle
#

Both those files have the <exception> header, yet are missing definitions for those symbols.

ionic tree
#

Not sure how to correct it? I suspect it may be because I transferred my apps and content from my previous mac which was intel and this is M2, but I alreaqy looked up how to correct homebrew so it was installed correctly for this one

#

I suspect tho the C++ compiler is different right?

chrome spindle
#

I don't use Mac so I wouldn't know how to fix this other than to say "wipe everything and reinstall everything from scratch".

#

But your C++ compiler is missing required features that have existed for at least a decade.

ionic tree
ionic tree
chrome spindle
#

Actually, wait. How old is your version of the code?

#

I think someone fixed some related stuff. And if you're pulling an old version of our code, it would break.

#

But if you're getting those errors on the latest, then your compiler is broken.

ionic tree
chrome spindle
#

Grab the master branch. 0.46 might be before the fix.

ionic tree
#

Ok got it, I'll try that

#

Ok at least this time it got past the 3% mark, hoping it works haha

ionic tree
chrome spindle
#

I only noticed that you might've had an older version of the code because the line numbers that the error referred to are one line off from the latest code. lul

ionic tree
chrome spindle
#

Ignore that since you’re on Mac. We only do official releases for Windows.

ionic tree
#

Ah I was so close, serial programs runs beautifully except the video feed doesn't want to load and I'm trying with the solutions posted by @viscid robin and @knotty olive but no luck pichucry

knotty olive
#

The newest versions of QT are supposed to have fixed the permissions issue. Is it still that or something different?

ionic tree
#

When I built serial programs with the current qt version installed by opencv, I was getting a white screen on the video feed on serial programs

#

But I could hear the sound for some reason... maybe I missed something else

knotty olive
#

Maybe check Mac Camera permissions in system settings?

#

IIRC SerialPrograms compiles into an App now and the SerialPrograms app needs explicit permissions to access Camera

#

If that doesn't work you can try opening the App via Package Contents. It'll open the app via terminal which has a different set of permissions

ionic tree
#

Ah I see, let me check the camera permissions, thanks!

ionic tree
#

I opened the app via package contents and serial,programs asked permission to use the microphone, but didnt ask permission for the camera and the app itself doesn't appear on system settings, i'm googling to see if there is any way to force it to ask me to give permission

knotty olive
#

There's a couple lines in the info.plist that should be there for prompting camera permissions

ionic tree
#

Thanks, I'll check that

#

This is what appears on info.plist, not sure what should I change, the mic permissions work fine

knotty olive
#

That should be right

#

When you open via terminal there should be some debug messages there too, any indication of an error there?

ionic tree
#

ah yeah, it says
qt.permissions: Could not find permission plugin for QCameraPermission. Please make sure you have included the required usage description in your Info.plist
Access to camera not granted

knotty olive
#

For Camera permissions does "Terminal" appear in the list?

ionic tree
#

on the plist?

#

Ah so sorry haha, on system settinfs right? Nope, right now I only have zoom and obs there

#

And I don't know why there isn't an option to add apps to that list as it was possible on other versions

#

There's also this error message in terminal when opening the serialprograms app there:024-04-14 17:52:20.541 SerialPrograms[50266:1018431] WARNING: AVCaptureDeviceTypeExternal is deprecated for Continuity Cameras. Please use AVCaptureDeviceTypeContinuityCamera and add NSCameraUseContinuityCameraDeviceType to your Info.plist

#

but I can't find any of those property lists on xcode

knotty olive
#

Hmmm double check the installed qt version? Brew list qt

ionic tree
#

qt version istalled is 6.6.2_2

#

tried running brew upgrade qt but apparently that's the latest version

knotty olive
#

Maybe check ffmpeg version?

ionic tree
#

also on terminal? Not sure how to do that

knotty olive
#

Brew list ffmpeg

ionic tree
#

thx,it's 7.0

#

tried restarting my mac but didn't help either sadman

knotty olive
#

Hey so I got around to trying a fresh install on my Mac and ran into the same errors as you with QT 6.6.2+. There still seems to be issues with permissions.

I don't know the nitty-gritty of the automation codebase but everything seems to still be functioning fine at 6.5.2 and TBH I just care that it's working so I downgraded back to 6.5.2.

I'll repost the downgrade instructions here, unfortunately the workarounds are getting more complicated. QT 6.6.2+ depends on the latest version 74.x of icu4c which is automatically installed by brew. QT 6.5.2 needs 73.x so you have to uninstall 74.x and manually downgrade icu4c as well

# follow the Mac install guide and insert these commands sequentially after "brew install opencv"

# not a part of the downgrade process but this is missing from the guide
brew install PkgConfig

# downgrade qt to 6.5.2 which does not have permissions issues on Mac
brew uninstall --ignore-dependencies qt

# manually get the formula and install it
curl https://raw.githubusercontent.com/Homebrew/homebrew-core/577cb7627fe64d81baad11660ce4e9cb70ad4797/Formula/q/qt.rb > qt.rb

brew install qt.rb

rm qt.rb

# downgrade the icu4c dependency to 73.x for QT 6.5.2
brew uninstall --ignore-dependencies icu4c

# manually get the formula and install it
curl https://raw.githubusercontent.com/Homebrew/homebrew-core/932eb44c7257508ad334fe855efbe712233aca6a/Formula/i/icu4c.rb > icu4c.rb

brew install icu4c.rb

rm icu4c.rb

# continue on with the rest of the guide
...

Let me know if there are still issues

(P.S. if anyone knows an easy way to list a specific version for a dependency instead of having to manually downgrade LMK)

11/14/2024 edit: this problem should no longer exist with the latest version of SerialPrograms. Please leave a message in https://discord.com/channels/695809740428673034/711649658220314635 if this problem persists!

ionic tree
#

Thank you! I'll try this