From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 812563857C60 for ; Fri, 19 Mar 2021 21:06:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 812563857C60 Received: by mail-wr1-x431.google.com with SMTP id x13so10432698wrs.9 for ; Fri, 19 Mar 2021 14:06:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=lpuK65Lff1zqCOzqokQdGvZBFUngsGuOg/haBNPrxyY=; b=avUT9q5yT6RfgJAJ1gaYPut5oQLnmfnWD+coNv0asCCK9Pg6jTEdSeGAhBQrSrEyFF Nk8g9OZDbzcLqxxxwW6+GHWDgRDgTjAA8oZm8aQoPrEmJ2sXgILLgKr9KI21xKftnKLd f5rCKnL3ieNF29rv9S6bQP5xn2Udtbqn14SAzxnjbulBNxzVnu4k67O0+UJ9GmEDHen9 SzD8CYsWmyFlcFvxn3aOSNUD8sd0EQWxUmdF4kQOO/NTYyc3pWa2aemLLAZT8aG6sD/i L/0tiKJVQqk6EkCOwu/5t8k2cuAyWndIjpQUL2YkvuBbnYXrQx4V8SH+QgaCdBOcUrRt 9x4w== X-Gm-Message-State: AOAM533okmWrxozbU3CnAueIIXbfiZlb2NXLZ5Z9QivgWqMLjwqic7SJ ZdPp1VMbTyqShycY+8Ag2D8= X-Google-Smtp-Source: ABdhPJw1c2j2OaadCSTY/WYSeHO9bM136ZUBwMZEyHBU2cnP34t7TZhTk0wLH5Xah6hIDdpZk+Kmbw== X-Received: by 2002:a5d:684d:: with SMTP id o13mr6685386wrw.235.1616187988608; Fri, 19 Mar 2021 14:06:28 -0700 (PDT) Received: from [192.168.1.212] (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.googlemail.com with ESMTPSA id i8sm7701563wmi.6.2021.03.19.14.06.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Mar 2021 14:06:28 -0700 (PDT) Content-Type: text/plain; charset=utf-8; delsp=yes; format=flowed Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: gfortran static linking under OS X (was: Re: ) From: Iain Sandoe In-Reply-To: Date: Fri, 19 Mar 2021 21:06:26 +0000 Cc: feenberg@nber.org, Fortran List , Tobias Burnus Content-Transfer-Encoding: 8bit Message-Id: References: To: Daniel Feenberg X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Mar 2021 21:06:31 -0000 Hi Daniel, Tobias Burnus 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