Hi Daniel, Tobias Burnus <[email protected]> wrote:
I am not sure whether it helps, but I want to point out that libm is the math library which is on Linux usually GLIBC and I assume on OS X it is provided by the OS vendor.
actually part of libSystem (but, yes, provided by the vendor)
On 19.03.21 21:22, Daniel Feenberg via Fortran wrote:Is there a way to make a statically linked binary with fortran in OS X? For much of the past year I have been using: gfortran taxsim.for -static-libgfortran -static-libgcc
OK - that should work - modulo the quadmath issue (if present) - .. but that is probably solvable (with some changes to the link spec).
but since January I only get the error message; ld: library not found for -lm. collect2: error: ld returned 1 exit status?
lm has not been needed on macOS for a [very] long time (for many releases it was simply a convenience symlink to libSystem.dylib, for the sake of OSS code that appends ‘-lm’).
There doesn’t seem to be an issue with gcc-11 (master, development) or 10.2.1 (upcoming 10.3) on macOS 11 - will see if I can fire up a copy of gcc6.5 there ...
Will have a think about how to fake the libm too .. not so easy these days.
This is OS X 11,2,3 Big Sur and fortran version 6.3.0.
This is an old version of Fortran on a very new version of macOS, at present the first supported GCC version for macOS 11 is the upcoming 10.3 release (although homebrew no doubt has a preview courtesy of FX).
Is there any way you would be able to update to a newer (and eventually supported) Fortran version ?
I need static linking because my users are not developers and do not have Xcode or gcc installed.
understood.
This is free software. I have seen postings from 2015 suggesting that I rename libquadmath.0.dylib, which I did try but which did not help. Of course I have no need for lquad precision variables, which I understand is the source of the problem.
not from what you posted - it’s the absence of “libm.dylib” that results in the message.
I realise that this mail contains no solutions - but will try to reproduce the issue over the weekend.
cheers Iain
