SJ001 / AI-Feynman

MIT License
607 stars 186 forks source link

ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture x86_64 #67

Closed dbl001 closed 2 years ago

dbl001 commented 2 years ago

I got this linker error build AI-Feynman on OS X 12.4 with XCode 13.4.

 % clang --version
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
(AI-Feynman) davidlaxer@x86_64-apple-darwin13 AI-Feynman % ld -v
@(#)PROGRAM:ld  PROJECT:ld64-530
BUILD 05:01:35 Aug  4 2021
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
LTO support using: LLVM version 12.0.0 (static support for 26, runtime is 27)
TAPI support using: Apple TAPI version 10.0.0 (tapi-1000.10.8)

% xcode-select -p
/Applications/Xcode.app/Contents/Developer
(AI-Feynman) davidlaxer@x86_64-apple-darwin13 AI-Feynman % xcrun  --show-sdk-platform-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
(AI-Feynman) davidlaxer@x86_64-apple-darwin13 AI-Feynman %  xcrun --show-sdk-path --sdk macosx
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk

x86_64-apple-darwin13.4.0-gfortran:f77: build/src.macosx-10.9-x86_64-3.9/aifeynman/_symbolic_regress1-f2pywrappers.f
/Users/davidlaxer/anaconda3/envs/AI-Feynman/bin/x86_64-apple-darwin13.4.0-gfortran -Wall -g -arch x86_64 -Wall -g -undefined dynamic_lookup -bundle build/temp.macosx-10.9-x86_64-3.9/build/src.macosx-10.9-x86_64-3.9/aifeynman/_symbolic_regress1module.o build/temp.macosx-10.9-x86_64-3.9/build/src.macosx-10.9-x86_64-3.9/build/src.macosx-10.9-x86_64-3.9/aifeynman/fortranobject.o build/temp.macosx-10.9-x86_64-3.9/aifeynman/symbolic_regress1.o build/temp.macosx-10.9-x86_64-3.9/build/src.macosx-10.9-x86_64-3.9/aifeynman/_symbolic_regress1-f2pywrappers.o -L/Users/davidlaxer/anaconda3/envs/AI-Feynman/bin/../lib/gcc/x86_64-apple-darwin11.4.2/4.8.5 -L/Users/davidlaxer/anaconda3/envs/AI-Feynman/bin/../lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/../../.. -L/Users/davidlaxer/anaconda3/envs/AI-Feynman/bin/../lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/../../.. -lgfortran -o aifeynman/_symbolic_regress1.cpython-39-darwin.so
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture x86_64
collect2: error: ld returned 1 exit status
error: Command "/Users/davidlaxer/anaconda3/envs/AI-Feynman/bin/x86_64-apple-darwin13.4.0-gfortran -Wall -g -arch x86_64 -Wall -g -undefined dynamic_lookup -bundle build/temp.macosx-10.9-x86_64-3.9/build/src.macosx-10.9-x86_64-3.9/aifeynman/_symbolic_regress1module.o build/temp.macosx-10.9-x86_64-3.9/build/src.macosx-10.9-x86_64-3.9/build/src.macosx-10.9-x86_64-3.9/aifeynman/fortranobject.o build/temp.macosx-10.9-x86_64-3.9/aifeynman/symbolic_regress1.o build/temp.macosx-10.9-x86_64-3.9/build/src.macosx-10.9-x86_64-3.9/aifeynman/_symbolic_regress1-f2pywrappers.o -L/Users/davidlaxer/anaconda3/envs/AI-Feynman/bin/../lib/gcc/x86_64-apple-darwin11.4.2/4.8.5 -L/Users/davidlaxer/anaconda3/envs/AI-Feynman/bin/../lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/../../.. -L/Users/davidlaxer/anaconda3/envs/AI-Feynman/bin/../lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/../../.. -lgfortran -o aifeynman/_symbolic_regress1.cpython-39-darwin.so" failed with exit status 1
dbl001 commented 2 years ago

Solved. There was an older version of 'ld' in my Anaconda virtual environment which conflicted with the latest version of XCode.

thesofakillers commented 1 year ago

@dbl001 how did you update the ld version in the conda env?

dbl001 commented 1 year ago

I renamed the ld executable in the andaconda3 bin to something else so that the build would find the system compiler or Macport compiler. You can also try setting CC= path to c compiler and CXX= path to c++ compiler, or adjusting you PATH environment variable so the build doesn’t find the Anaconda version of ld first.

On Mar 13, 2023, at 3:45 AM, Giulio Starace @.***> wrote:

@dbl001 https://github.com/dbl001 how did you update the ld version in the conda env?

— Reply to this email directly, view it on GitHub https://github.com/SJ001/AI-Feynman/issues/67#issuecomment-1465903813, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXWFW6YUYQYHBNORVL3W5DW333DFANCNFSM5XR5XNVA. You are receiving this because you were mentioned.