Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [photran] Need help with new Eclipse install for Fortran (resend)

Hi Bernard,

I think you get a similar error message when compiling or more precise linking manually as Greg proposed. Am I correct?

It looks like that your linker cannot find the System library from macOS, because you got:

ld: library not found for -lSystem

I had the same problem when upgraded from Mojave to Ventura with MacPorts.  It seems the lib is now not under the default path for some weird reasons. To solve this:

Systemwide in ~/.zshrc (>=Catalina) or ~/.bash_profile (<=Catalina):
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"

Sometimes you have to create .zshc. open the terminal and type: nano ~/.zshrc Copy and paste the line above and press CTRL-O and ENTER than CTRL-X. Type:  source ~/.zshrc or restart the terminal and try Gregs's manual approach. If it works it will work in Eclipse, too.  But be aware that you have Xode tools installed, see below.

As a compiler directive:
The problem is solved when the path to the lib is specified:
gfortran Fortrantest2023.f95 -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib

But be also aware to install the

xcode-select –install
xcodebuild -license

It is also a good idea to install Xcode from the  App Store just for the case. But I ran in another error.

I do not know if you use a packet manager as MacPorts or Homebrew. I do. I uninstalled MacPorts completly and switched to Homebrew. I do not think it was a problem of MacPorts and a completely new installation of MacPorts would probably solved the problem but for Fortran Homebrew is a bit "better" and installed gcc and gfortran after Homebrew was on the machine.  After that everything runs well.

Hope this helps

Regards, Hani


Am 27.01.23 um 16:39 schrieb fellwalker57--- via photran:
I’ve been developing Fortran programs in Eclipse (now at 2022-03) for years on Macintosh.  This is working correctly on an iMac 2014 running Big Sur (macOS 11.7.3).  I have now migrated to an M2 Mac mini running Ventura (macOS 13.2) and while previously built Fortran apps still run I can’t build a new one.  Here’s the build error:

10:09:20 **** Build of configuration Release for project Fortrantest2023 ****

make all 

Building file: ../Fortrantest2023.f95

Invoking: GNU Fortran Compiler

/usr/local/gfortran/bin/gfortran -funderscoring -O3 -Wall -c -fmessage-length=0 -o "Fortrantest2023.o" "../Fortrantest2023.f95"

Finished building: ../Fortrantest2023.f95

 

Building target: Fortrantest2023

Invoking: MacOS X Fortran Linker

/usr/local/gfortran/bin/gfortran  -o "Fortrantest2023"  ./Fortrantest2023.o   

ld: library not found for -lSystem

collect2: error: ld returned 1 exit status

make: *** [Fortrantest2023] Error 1

"make all" terminated with exit code 2. Build might be incomplete.


10:09:23 Build Failed. 2 errors, 0 warnings. (took 3s.113ms)


Can anyone please tell me what I need to do to correct this.  Presumably there is some library somewhere that needs to be installed or linked.

This is a trivial test program that computes square root using the traditional iterative method.  It works on my old machine.

Thank you!

Bernard Abramson

_______________________________________________
photran mailing list
photran@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/photran



Back to the top