MacOS 10.14 SDK

Hi,

Sorry, this isn’t specifically an ITK issue (I think), but I’m struggling to think where else to ask for help.

I compile my tools that use ITK on a Mac. Last night, my Mac appears to have downloaded an XCode update without asking me that has installed the Mac OS 10.14 SDK. It has also removed the 10.13 SDK. Compiling my programs now fails because:

error: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreFoundation.framework', needed by 'Source/CoreProgs/qihdr', missing and no known rule to make it

This is not surprising, as the MacOSX10.13.sdk indeed does not exist. Setting the CMAKE_OSX_DEPLOYMENT_TARGET to 10.14 results in the same error, even though CMake is setting CMAKE_OSX_SYSROOT to the 10.14 directory. So I have two issues:

  • Why does my code require CoreFoundation? These are command-line tools with no UI, and my CMakeLists.txt files don’t specify it (I also compile on Linux fine). Sub-question - why does CMake insist on looking for the 10.13 SDK even when the deployment target is 10.14?
  • Where has the 10.13 SDK gone, and how do I get it back? You used to be able to install SDKs from the Preferences->Components tab, but now all I see listed are Simulators.

I have not yet tried re-compiling ITK itself to see if that is hit by the same error. Googling hasn’t turned up anything. Any ideas warmly received.

Sorry, this isn’t specifically an ITK issue (I think), but I’m
struggling to think where else to ask for help.

I compile my tools that use ITK on a Mac. Last night, my Mac appears to
have downloaded an XCode update without asking me

Sounds like you should turn auto updates off in System Preferences > App Store.

This is not surprising, as the MacOSX10.13.sdk indeed does not exist.
Setting the CMAKE_OSX_DEPLOYMENT_TARGET to 10.14 results in the same
error, even though CMake is setting CMAKE_OSX_SYSROOT to the 10.14
directory. So I have two issues:

  • Why does my code require CoreFoundation? These are command-line
    tools with no UI,

I dunno why, but CoreFoundation is not a UI library, it has classes like string, array, dictionary, etc.

  • Where has the 10.13 SDK gone, and how do I get it back? You used to be
    able to install SDKs from the Preferences->Components tab, but now all
    I see listed are Simulators.

For the last few Xcode releases, they only provide the newest SDK. If you really need the 10.13 SDK, you’ll have to go back to Xcode 9.

I have not yet tried re-compiling ITK itself to see if that is hit by
the same error. Googling hasn’t turned up anything. Any ideas warmly received.

I have a nightly build of ITK on 10.14 with Xcode 10, it’s building fine:

https://open.cdash.org/viewBuildError.php?buildid=5546289

Sean

1 Like

Yup. In my defence, I only had auto-install on for security updates, which it turns out also includes “system data files”. :man_facepalming:

I don’t particularly care which SDK I’m compiling against - I assumed I needed the 10.13 SDK because my system is 10.13? But if it doesn’t matter then the mystery is why CMake is insisting on looking for 10.13 when 10.14 is available (and CMake finds it as the SYSROOT).

I am on CMake 3.11.4, I’ll try installing 3.12.2 now.

No. You can build against newer SDKs but deploy to older OSes at runtime. You’ll want to set CMAKE_OSX_DEPLOYMENT_TARGET to 10.13 (or older) though.

1 Like

Thanks @seanm.

It is fixed now - a kind person on #cpplang pointed out that ITK references CoreFoundation (through the GDCM module), and hence that was likely still referencing the 10.13 SDK. Recompiling ITK from scratch has solved the problem.

Update: After all that - I see that it’s even an option in the ITK CMakeLists

GDCM_USE_COREFOUNDATION_LIBRAR  *ON 

Oh wow. The more you know.

3 Likes