public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Iain Sandoe <idsandoe@googlemail.com>
To: Daniel Feenberg <feenberg@gmail.com>
Cc: feenberg@nber.org, Fortran List <fortran@gcc.gnu.org>,
	Tobias Burnus <burnus@net-b.de>
Subject: Re: gfortran static linking under OS X (was: Re: )
Date: Fri, 19 Mar 2021 21:06:26 +0000	[thread overview]
Message-ID: <F7DE4E90-6A5F-42CF-996E-99324A9AEA1A@googlemail.com> (raw)
In-Reply-To: <e6659e1d-664e-b6bd-b3f8-7626e0429532@net-b.de>

Hi Daniel,

Tobias Burnus <burnus@net-b.de> 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


  reply	other threads:[~2021-03-19 21:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 20:22 Daniel Feenberg
2021-03-19 20:49 ` gfortran static linking under OS X (was: Re: ) Tobias Burnus
2021-03-19 21:06   ` Iain Sandoe [this message]
2021-03-19 22:11   ` Daniel Feenberg
2021-03-19 22:39     ` Iain Sandoe
2021-03-20 20:47       ` Daniel Feenberg
2021-03-20 21:07         ` Iain Sandoe
2021-03-22 22:20           ` Daniel Feenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F7DE4E90-6A5F-42CF-996E-99324A9AEA1A@googlemail.com \
    --to=idsandoe@googlemail.com \
    --cc=burnus@net-b.de \
    --cc=feenberg@gmail.com \
    --cc=feenberg@nber.org \
    --cc=fortran@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).