mongolite
mongolite copied to clipboard
Build fails on macos < 10.15
After upgrading to mongo-c-driver 1.23 I see:
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I. -Icommon -Ikms -DBSON_COMPILATION -DBSON_EXTRA_ALIGN -DMONGOC_COMPILATION -DMONGOC_HAVE_SASL_CLIENT_DONE -DMONGOC_ENABLE_SSL_SECURE_TRANSPORT -DMONGOC_ENABLE_CRYPTO_COMMON_CRYPTO -DKMS_MESSAGE_ENABLE_CRYPTO -DKMS_MESSAGE_ENABLE_CRYPTO_COMMON_CRYPTO -I/usr/local/include -fPIC -Wall -pedantic -Wstrict-prototypes -c bson/bson-memory.c -o bson/bson-memory.o
bson/bson-memory.c:38:11: warning: 'aligned_alloc' is only available on macOS 10.15 or newer [-Wunguarded-availability-new]
return aligned_alloc (alignment, num_bytes);
^~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/malloc/_malloc.h:50:10: note: 'aligned_alloc' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS 10.8.0
void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_size(2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
^
bson/bson-memory.c:38:11: note: enclose 'aligned_alloc' in a __builtin_available check to silence this warning
return aligned_alloc (alignment, num_bytes);
^~~~~~~~~~~~~
And indeed if I try to build on macos 10.13 it fails with a linking error.
@kevinAlbs
Hello @jeroen, is macOS 10.13 a required platform for mongolite? The C driver CI tests build with macOS 10.14+. MongoDB server 6.0 no longer supports macOS 10.13.
Yes R currently targets 10.13 on intel mac, but don't worry about it, I added a simple workaround. You could copy the workaround in mongo-c-driver if you want to support older versions of macos.