Hello,

While working on cysignals, I encounted an issue with $MACOSX_DEPLOYMENT_TARGET. I have a fix, but I don't know if it's good. It's not specific to Sage, but it will affect Sage since cysignals is a Sage package.

For cysignals, I'd really like to use MACOSX_DEPLOYMENT_TARGET >= 10.9 since that enables the C++ <atomic> header (*) which is needed to fix Sage ticket #24288. The tricky part is that not only cysignals itself should be compiled with MACOSX_DEPLOYMENT_TARGET >= 10.9 but also every package using cysignals.

I have a solution which adds the command-line flag -mmacosx-version-min=10.9 when compiling cysignals:
https://github.com/sagemath/cysignals/commit/17062a64bf5672375982cf295ed93b346b55d680
Thanks to Cython magic, this flag will be passed on to every package that cimports cysignals.

This solution seems to work and passes CI tests. These tests are done using Conda, which uses a Python compiled with MACOSX_DEPLOYMENT_TARGET=10.6, which is then used for every Python package (analogous to CFLAGS, distutils uses the value for MACOSX_DEPLOYMENT_TARGET which was used to compile Python).

So my question is basically: what could possibly go wrong? One thing which worries me is that the command-line flag -mmacosx-version-min=10.9 overrides the environment variable MACOSX_DEPLOYMENT_TARGET. So if somebody really wanted a higher value for MACOSX_DEPLOYMENT_TARGET than 10.9, it wouldn't work. But I see no solution for this.


Jeroen.


(*) For some reason, the analogous C header <stdatomic.h> works regardless of MACOSX_DEPLOYMENT_TARGET. Unfortunately, this header is not compatible with C++, so I really need <atomic>.

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to