6

When compiling a c++ project in a conda environment on MacOS Big Sur, the error ld: unsupported tapi file type '!tapi-tbd' in YAML file may occur. How to proceed?

2 Answers 2

5

On Big Sur, the SDK that comes with Command Line Tools is too new. An older one needs to be downloaded and used:

  1. Download the 10.10 SDK "MacOSX10.10.sdk.tar.xz" from here.
  2. Extract it: tar xf MacOSX10.10.sdk.tar.xz -C /opt
  3. Add following lines to ~/.condarc:
conda_build:
  config_file: ~/.conda/conda_build_config.yaml
  1. create ~/.conda/conda_build_config.yaml if it doesn't exist and add:
CONDA_BUILD_SYSROOT:
  - /opt/MacOSX10.10.sdk        # [osx]

Many thanks to ihnorton on this thread.

7
  • 1
    I was a bit skeptical about this, particularly because it is such an old version of the SDK. However, looking into how Conda Forge builds their osx-64 packages, I found they are currently downloading SDK 10.9. So, yes this appears to just be how things are.
    – merv
    Sep 19, 2021 at 18:07
  • 2
    I used 10.10 because this thread says that is what the anaconda team is targeting (in 2018), but there are also suggestions there that newer SDK versions work too, e.g. up to 10.13 Sep 19, 2021 at 20:08
  • 1
    Woops, I deleted my comment, for the record, I was saying that the conda recipe @merv linked to used whatever SDK was installed but defaulted to 10.9. And yeah, looks like Conda Forge targets 10.9, while Anaconda targets 10.10 as OP mentioned.
    – rmwenz
    Apr 5, 2022 at 22:27
  • 1
    Also FWIW I got the same error as OP trying to install packages in RStudio. In case anyone else has the same issue, you may need to update .Rprofile with Sys.setenv(CONDA_BUILD_SYSROOT = "/opt/MacOSX10.10.sdk"), as a comment at the GitHub issue thread referenced in this answer indicates.
    – rmwenz
    Apr 5, 2022 at 22:31
  • 1
    Or just export CONDA_BUILD_SYSROOT="/opt/MacOSX10.10.sdk" in your terminal config file, e.g..bash_profile or .zshrc
    – rmwenz
    Apr 5, 2022 at 22:53
1

Alternatively, if you don't want to build against conda (but just happen to be in a conda environment), you may be unwittingly using a conda-distributed ld that's incompatible with the newer system tools and libraries.

If your $PATH is set up so that Anaconda's ld has higher preference over the system linker, this will explain it:

$ which -a ld
/blah/anaconda3/bin/ld
/usr/bin/ld

If that's the case, reorder your PATH to put anaconda's directory after /usr/bin. Then, which ld should point to the system ld, and you should be good to go.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.