I'm facing an issue trying to run some packages in R that need OpenMP support. A long process (with some mistakes I made...) is described here.
One of the current problem I'm facing is that I'm unable to compile a simple C file with
pkgbuild::has_build_tools(debug = TRUE)
and I get this error (it looks like I'm not the first one).
Trying to compile a simple C file
Running /Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB foo.c
using C compiler: ‘gcc-13 (Homebrew GCC 13.1.0) 13.1.0’
using SDK: ‘’
/usr/local/Cellar/gcc/13.1.0/bin/gcc-13 -fopenmp -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/gcc/13.1.0/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/include -I/usr/local/Cellar/libomp/16.0.5/include -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c foo.c -o foo.o
/usr/local/Cellar/gcc/13.1.0/bin/gcc-13 -fopenmp -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/Cellar/gcc/13.1.0/lib -Wl,-rpath,/usr/local/Cellar/gcc/13.1.0/lib,-L/usr/local/Cellar/gcc/13.1.0/lib/gcc/current/ -L/usr/local/Cellar/libomp/16.0.5/lib -o foo.so foo.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd' for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [foo.so] Error 1
The error says more specifically that it's using a MacOSX 12.0 SDK version
and that there is an unsupported tapi file type
.
I also came across this post saying that the Xcode 14.1 command-line tools
include, and only support, the macOS 13.0 SDK
.
I have noticed that I also have macOSX 13.0 SDK installed, and I was wondering what is the best way to remove older SDK versions so that the system uses only the last version that was installed with Xcode command tools.
The versions currently installed (knowing that MacOSX.sdk shortcuts is targeting 13.0 SKD):
Any help would be greatly appreciated.