1

I want my C code to be compiled successfully on different versions of Mac OS X. One problem I have is before OS X Yosemite I need to #include <vecLib/clapack.h> to make lapack work. However, vecLib can't be founded on later versions.

How can I detect the version of Mac OS X and then include the header I have depending on the system?

1 Answers1

0
include <Availability.h>

#ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101000
    #include <vecLib/clapack.h>
#endif
#endif
TheNextman
  • 12,428
  • 2
  • 36
  • 75
  • 2
    It would be helpful if you provided some explanation — the coding of Yosemite (10.10) and the origin of the name and any pointers to documentation that explains it. – Jonathan Leffler Aug 12 '18 at 05:27
  • @JonathanLeffler: I think this [question](https://stackoverflow.com/questions/8024961/c-macro-for-os-x-version-lion-or-not-detection) and [these](https://stackoverflow.com/a/8025023/499581) [answers](https://stackoverflow.com/a/8025021/499581) might already cover it. – l'L'l Aug 12 '18 at 05:37