Not able to build GroundSDK on Mac silicon (M4)

Hello!

I have a working version of GroundSDK that was copied over from my old Intel Mac. I can use PDrAW and vmeta-extract in the terminal from the original folder. However, I had some issues getting some scripts working, and was not able to compile the Libdraw test-app.

Since I now have a newer Apple silicon Mac, I thought it would be a good idea to reinstall. However, after running this command:

./build.sh -p groundsdk-macos -t build -j/1

I get a list of errors like this:

ld: warning: ignoring duplicate libraries: ‘-lc++’

ld: warning: search path ‘~/code/groundsdk-tools/out/groundsdk-macos/staging/lib/arm64-apple-darwin24.5.0’ not found

ld: warning: search path ‘~/code/groundsdk-tools/out/groundsdk-macos/staging/lib’ not found

ld: warning: search path ‘/Users/hansharaldberge/code/groundsdk-tools/out/groundsdk-macos/staging/usr/lib/arm64-apple-darwin24.5.0’ not found

ld: warning: ignoring file ‘~/code/groundsdk-tools/out/groundsdk-macos/build/libyuv/obj/CMakeFiles/yuvconvert.dir/util/yuvconvert.cc.o’: found architecture ‘arm64’, required architecture ‘x86_64’

ld: warning: ignoring file ‘libyuv.a50’: found architecture ‘arm64’, required architecture ‘x86_64’

ld: warning: ignoring file ‘libyuv.a49’: found architecture ‘arm64’, required architecture ‘x86_64’

…etc…
And then it ends with this:

Undefined symbols for architecture x86_64:

“_main”, referenced from:

ld: symbol(s) not found for architecture x86_64

clang++: error: linker command failed with exit code 1 (use -v to see invocation)

make[3]: *** [yuvconvert] Error 1

make[2]: *** [CMakeFiles/yuvconvert.dir/all] Error 2

make[1]: *** [all] Error 2

make: *** [~/code/groundsdk-tools/out/groundsdk-macos/build/libyuv/libyuv.built.stamp] Error 2

– The C compiler identification is AppleClang 16.0.0.16000026

MAKE ERROR DETECTED

[E] Command failed (returncode=254)

Am I missing some files from the repo? Do I have to force x86_64 architecture instead on aarch64 for parts of the compiler somehow? Any insight would be very helpful! I’m just scratching my head right now, since it’s working in one folder, but not the other…

Similar issue - bumping for hopefully some attention:

Scanning /Users/USER/Code/parrot/groundsdk-tools/packages for makefiles...
Found       62 makefiles
/Users/USER/Code/parrot/groundsdk-tools/build/alchemy/targets/darwin/native: module 'zlib' is already prebuilt
/Users/USER/Code/parrot/groundsdk-tools/packages/protobuf/atom.mk: defining unknown LOCAL variable LOCAL_EXPORT_FILES
readlink: illegal option -- e
usage: readlink [-fn] [file ...]
Found 174 modules
Computing modules dependencies...
Checking modules dependencies...
Generating rules...
Processing rules...
Link: out/groundsdk-macos/staging/usr/lib/libjson.so => libjson-c.so
Link: out/groundsdk-macos/staging/usr/ssl => ../etc/ssl
libarsdkgen: Generating arsdk files
SharedLib: libvideo-metadata-protobuf => out/groundsdk-macos/build/libvideo-metadata-protobuf/libvideo-metadata-protobuf.dylib
aarch64 C++: libpdraw-backend <= packages/pdraw/libpdraw-backend/src/pdraw_backend_impl.cpp
ld: warning: ignoring duplicate libraries: '-lc++'
ld: warning: search path '/Users/USER/Code/parrot/groundsdk-tools/out/groundsdk-macos/staging/lib/arm64-apple-darwin24.5.0' not found
ld: warning: search path '/Users/USER/Code/parrot/groundsdk-tools/out/groundsdk-macos/staging/lib' not found
ld: warning: search path '/Users/USER/Code/parrot/groundsdk-tools/out/groundsdk-macos/staging/usr/lib/arm64-apple-darwin24.5.0' not found
Undefined symbols for architecture arm64:
  "_protobuf_c_empty_string", referenced from:
      _vmeta__thermal_session_metadata__init.init_value in vmeta.pb-c.c.o
      _vmeta__session_metadata__init.init_value in vmeta.pb-c.c.o
      _vmeta__session_metadata__init.init_value in vmeta.pb-c.c.o
      _vmeta__session_metadata__init.init_value in vmeta.pb-c.c.o
      _vmeta__session_metadata__init.init_value in vmeta.pb-c.c.o
      _vmeta__session_metadata__init.init_value in vmeta.pb-c.c.o
      _vmeta__session_metadata__init.init_value in vmeta.pb-c.c.o
      _vmeta__session_metadata__init.init_value in vmeta.pb-c.c.o
      _vmeta__session_metadata__init.init_value in vmeta.pb-c.c.o
      _vmeta__session_metadata__init.init_value in vmeta.pb-c.c.o
      _vmeta__session_metadata__init.init_value in vmeta.pb-c.c.o
      _vmeta__session_metadata__init.init_value in vmeta.pb-c.c.o
      _vmeta__session_metadata__init.init_value in vmeta.pb-c.c.o
      _vmeta__session_metadata__init.init_value in vmeta.pb-c.c.o
      _vmeta__session_metadata__init.init_value in vmeta.pb-c.c.o
      ...
  "_protobuf_c_message_free_unpacked", referenced from:
      _vmeta__quaternion__free_unpacked in vmeta.pb-c.c.o
      _vmeta__euler__free_unpacked in vmeta.pb-c.c.o
      _vmeta__location__free_unpacked in vmeta.pb-c.c.o
      _vmeta__vector2__free_unpacked in vmeta.pb-c.c.o
      _vmeta__vector3__free_unpacked in vmeta.pb-c.c.o
      _vmeta__ned__free_unpacked in vmeta.pb-c.c.o
      _vmeta__rectf__free_unpacked in vmeta.pb-c.c.o
      ...
  "_protobuf_c_message_get_packed_size", referenced from:
      _vmeta__quaternion__get_packed_size in vmeta.pb-c.c.o
      _vmeta__euler__get_packed_size in vmeta.pb-c.c.o
      _vmeta__location__get_packed_size in vmeta.pb-c.c.o
      _vmeta__vector2__get_packed_size in vmeta.pb-c.c.o
      _vmeta__vector3__get_packed_size in vmeta.pb-c.c.o
      _vmeta__ned__get_packed_size in vmeta.pb-c.c.o
      _vmeta__rectf__get_packed_size in vmeta.pb-c.c.o
      ...
  "_protobuf_c_message_pack", referenced from:
      _vmeta__quaternion__pack in vmeta.pb-c.c.o
      _vmeta__euler__pack in vmeta.pb-c.c.o
      _vmeta__location__pack in vmeta.pb-c.c.o
      _vmeta__vector2__pack in vmeta.pb-c.c.o
      _vmeta__vector3__pack in vmeta.pb-c.c.o
      _vmeta__ned__pack in vmeta.pb-c.c.o
      _vmeta__rectf__pack in vmeta.pb-c.c.o
      ...
  "_protobuf_c_message_pack_to_buffer", referenced from:
      _vmeta__quaternion__pack_to_buffer in vmeta.pb-c.c.o
      _vmeta__euler__pack_to_buffer in vmeta.pb-c.c.o
      _vmeta__location__pack_to_buffer in vmeta.pb-c.c.o
      _vmeta__vector2__pack_to_buffer in vmeta.pb-c.c.o
      _vmeta__vector3__pack_to_buffer in vmeta.pb-c.c.o
      _vmeta__ned__pack_to_buffer in vmeta.pb-c.c.o
      _vmeta__rectf__pack_to_buffer in vmeta.pb-c.c.o
      ...
  "_protobuf_c_message_unpack", referenced from:
      _vmeta__quaternion__unpack in vmeta.pb-c.c.o
      _vmeta__euler__unpack in vmeta.pb-c.c.o
      _vmeta__location__unpack in vmeta.pb-c.c.o
      _vmeta__vector2__unpack in vmeta.pb-c.c.o
      _vmeta__vector3__unpack in vmeta.pb-c.c.o
      _vmeta__ned__unpack in vmeta.pb-c.c.o
      _vmeta__rectf__unpack in vmeta.pb-c.c.o
      ...
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/USER/Code/parrot/groundsdk-tools/out/groundsdk-macos/build/libvideo-metadata-protobuf/libvideo-metadata-protobuf.dylib] Error 1
generate files
1 Like

this seems quite similar to my issue compile error · Issue #13 · protobuf-c/protobuf-c-rpc · GitHub
I could try and remove “-no-undefined” anywhere I see it associated to protobuf but would be curious to know why there isn’t more people complaining?

I’m on an oldish M1 but with latest Sequoia 15.5
xcode is up to date etc.etc.

1 Like

Allright! I figured it out!

:smiley:

It needs to be built using Rosetta. First I had to clean the previous arm64 build:
./build.sh -p groundsdk-macos -t clean

Then redo the build with Rosetta with the following command:
arch -x86_64 /bin/zsh -c “./build.sh -p groundsdk-macos -t build -j/1”

After that it compiled beautifully. Still some lines with architecture warnings, but nothing stopping the process.

Can someone at Parrot please update the documentation page with the instructions for running the SDK in Rosetta on newer Macs?

Edit: I’m still not able to compile the test-app though.

I would have definitely preferred to be able to build native silicon though…

but thanks for the tip!