Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on macos < 10.15 #244

Open
jeroen opened this issue Nov 6, 2022 · 2 comments
Open

Build fails on macos < 10.15 #244

jeroen opened this issue Nov 6, 2022 · 2 comments

Comments

@jeroen
Copy link
Owner

jeroen commented Nov 6, 2022

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

jeroen added a commit that referenced this issue Nov 6, 2022
@kevinAlbs
Copy link
Contributor

kevinAlbs commented Nov 6, 2022

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.

@jeroen
Copy link
Owner Author

jeroen commented Nov 7, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants