0

I am trying to compile a program with cmake on a Mac (M2) running Ventura 13.4. It fails with the following error:

The C compiler

    "/Users/me/anaconda3/bin/x86_64-apple-darwin13.4.0-clang"

  is not able to compile a simple test program.

Somewhere in the error message I see that the compiler throws the error clang-10: error: invalid version number in '-mmacosx-version-min=12.5'.

In my CMakeError.log file, I see the following clue:

The output was:
1
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture x86_64
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)

I have tried removing and reinstalling Command Line Tools as suggested here, and have also tried enabling the SYSTEM_VERSION_COMPAT environment variable as suggested here. The error persists after doing this.

Is there something else that I can try?

Josh
  • 1
  • 1

1 Answers1

0

Somewhere in the error message I see that the compiler throws the error clang-10: error: invalid version number in '-mmacosx-version-min=12.5'.

You may have MACOSX_DEPLOYMENT_TARGET set as environment variable on your system. Try and verify that this environment variable isn't set.

Specify the minimum version of the target platform (e.g. macOS or iOS) on which the target binaries are to be deployed. CMake uses this variable value for the -mmacosx-version-min flag or their respective target platform equivalents. For older Xcode versions that shipped multiple macOS SDKs this variable also helps to choose the SDK in case CMAKE_OSX_SYSROOT is unset.

Sources:

jpr42
  • 718
  • 3
  • 14
  • It looks like I do not have `MACOSX_DEPLOYMENT_TARGET` set as an environment on my system. `echo $MACOSX_DEPLOYMENT_TARGET` returns nothing. – Josh Jun 20 '23 at 17:10
  • Do you have `CMAKE_OSX_DEPLOYMENT_TARGET` set anywhere? – jpr42 Jun 20 '23 at 18:35
  • Also worth checking the other various CMake environment variables: https://cmake.org/cmake/help/latest/manual/cmake-env-variables.7.html – jpr42 Jun 20 '23 at 18:36