3

I upgraded my macOS to Monterey 12.3 and my gfortran code no longer compiles. Initially, running:

gfortran -o executable make_executable1.o make_executable2.o

gave this error message:

ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
make: *** [fm3d] Error 1

I then added the path to the Library by running:

export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"

and I now get this error:

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
make: *** [fm3d] Error 1

I assume it is a problem with my CommandLine, but I have reinstalled everything to their latest version and I can't get it to work.

macOS Monterey 12.3
Apple clang version 13.1.6 (clang-1316.0.21.2)
GNU Fortran (GCC) 11.2.0
CommandLine Tools version: 13.3.0.0.1.1645755326

Any advice on the next step to take would be appreciated!

P Ball
  • 31
  • 2

1 Answers1

0

gfortran @ Monterey 12.6.2 works well with Xcode 14.1 and Command_Line_Tools_for_Xcode_13.dmg (However, it did not work with the latest Command_Line_Tools_for_Xcode_14.1.dmg resulting in the same error as you describe)

lukas
  • 1
  • 1
    Welcome to Stack Overflow! I do not see how this answers the question at the top of this page, but it should. Please [edit] according to [answer] or delete the answer. Otherwise it risks being flagged as "not an answer" and being deleted. Note that "this tool/lib/resource works great" is not considered an answer unless you demonstrate how to use it for solving the described problem. – Yunnosch Jan 19 '23 at 12:05