public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* What .dylib files does gfortran v 11.2.0 need on a Mac?
@ 2023-07-22 18:20 Leigh House
  2023-07-22 18:49 ` Iain Sandoe
  0 siblings, 1 reply; 5+ messages in thread
From: Leigh House @ 2023-07-22 18:20 UTC (permalink / raw)
  To: fortran

I’ve not been able to get any output written to a file by a program I compiled with gfortran v11.2.0 on my Mac. The Mac has MacOS Monterey (v12.6.7). This seems like a simple problem, yet I’ve not been able to find a solution. And it is an increasing obstacle for me. The problem includes fortran programs that were compiled years ago. Suddenly, they can no longer write output to a file. For example, writing to standard out (lun 6) works fine to the screen, but when redirected to a file, that file is empty.

A colleague got a clue that the problem may be in an out-of-date, faulty or corrupted .dylib file. Perhaps /usr/local/lib/libgfortran.5.dylib? The file /usr/local/lib/libgfortran.dylib is a symbolic link to /usr/local/lib/libgfortran.5.dylib. That file has a date of Nov 9, 2021 on my Mac. Should I have a newer file? If so, how do I get it? I would have thought it would be included in the gfortran install, but maybe not?

More generally, can I get a list of the .dylib files that gfortran (11.2.0) and gcc (also 11.2.0) need for programs they compile to function properly? And the dates for them? Do these files need to be owned by user “root” or have other special permissions (on my Mac, I own them as a regular user).

This seems like a very obscure, yet debilitating problem that I have encountered. If I cannot write or modify my fortran codes and have them work properly, I am SOL. 

Thanks very much for your help,

Leigh House, Los Alamos, NM



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What .dylib files does gfortran v 11.2.0 need on a Mac?
  2023-07-22 18:20 What .dylib files does gfortran v 11.2.0 need on a Mac? Leigh House
@ 2023-07-22 18:49 ` Iain Sandoe
  2023-07-22 19:05   ` Leigh House
  0 siblings, 1 reply; 5+ messages in thread
From: Iain Sandoe @ 2023-07-22 18:49 UTC (permalink / raw)
  To: Leigh House; +Cc: GCC Fortran

Hi Leigh

> On 22 Jul 2023, at 19:20, Leigh House via Fortran <fortran@gcc.gnu.org> wrote:
> 
> I’ve not been able to get any output written to a file by a program I compiled with gfortran v11.2.0 on my Mac. The Mac has MacOS Monterey (v12.6.7). This seems like a simple problem, yet I’ve not been able to find a solution. And it is an increasing obstacle for me. The problem includes fortran programs that were compiled years ago. Suddenly, they can no longer write output to a file. For example, writing to standard out (lun 6) works fine to the screen, but when redirected to a file, that file is empty.

Is your mac Intel or Arm64**?

You do not say where you got the compiler from (or if you built from source), it might be relevant to a resolution.

> A colleague got a clue that the problem may be in an out-of-date, faulty or corrupted .dylib file. Perhaps /usr/local/lib/libgfortran.5.dylib? The file /usr/local/lib/libgfortran.dylib is a symbolic link to /usr/local/lib/libgfortran.5.dylib. That file has a date of Nov 9, 2021 on my Mac. Should I have a newer file? If so, how do I get it? I would have thought it would be included in the gfortran install, but maybe not?

Actually, there was an operating system change in the way that initialization was handled that is backwards-incompatible. We raised a ‘feedback’ with Apple, but the response was that this was intentional - it is possible that you are running into this - I’d need to check the exact versions at which we fixed it.

> More generally, can I get a list of the .dylib files that gfortran (11.2.0) and gcc (also 11.2.0) need for programs they compile to function properly? And the dates for them? Do these files need to be owned by user “root” or have other special permissions (on my Mac, I own them as a regular user).

No, nothing in GCC requires elevated permissions.

(of course, if you elect to build it from source and install to some place that requires admin privs., but that’s only for installation).
 
> This seems like a very obscure, yet debilitating problem that I have encountered. If I cannot write or modify my fortran codes and have them work properly, I am SOL. 

gfortran works fine on Monterey - so I am sure that we will be able to fix this.

Iain

** Arm64 does require building an out-of-tree branch, but that is being used widely, so also very well-tested.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What .dylib files does gfortran v 11.2.0 need on a Mac?
  2023-07-22 18:49 ` Iain Sandoe
@ 2023-07-22 19:05   ` Leigh House
  2023-07-22 19:14     ` Iain Sandoe
  0 siblings, 1 reply; 5+ messages in thread
From: Leigh House @ 2023-07-22 19:05 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: GCC Fortran

Iain,

Thanks for your fast reply!

My Mac is an intel iMac from 2019. 

I didn’t keep detailed notes about where I got the compiler package, though I’ve often gone to hpc.sourceforge.net in the past, under “Computation Tools”. I suspect that is where I got my current compiler from. 

And I didn’t keep notes about which .dylib file I had to find and copy into /usr/local/lib, though from a colleague’s experience it may have been libgfortran.5.dylib.

And thanks for your help.

Leigh

> On Jul 22, 2023, at 12:49 PM, Iain Sandoe <iain@sandoe.co.uk> wrote:
> 
> Hi Leigh
> 
>> On 22 Jul 2023, at 19:20, Leigh House via Fortran <fortran@gcc.gnu.org> wrote:
>> 
>> I’ve not been able to get any output written to a file by a program I compiled with gfortran v11.2.0 on my Mac. The Mac has MacOS Monterey (v12.6.7). This seems like a simple problem, yet I’ve not been able to find a solution. And it is an increasing obstacle for me. The problem includes fortran programs that were compiled years ago. Suddenly, they can no longer write output to a file. For example, writing to standard out (lun 6) works fine to the screen, but when redirected to a file, that file is empty.
> 
> Is your mac Intel or Arm64**?
> 
> You do not say where you got the compiler from (or if you built from source), it might be relevant to a resolution.
> 
>> A colleague got a clue that the problem may be in an out-of-date, faulty or corrupted .dylib file. Perhaps /usr/local/lib/libgfortran.5.dylib? The file /usr/local/lib/libgfortran.dylib is a symbolic link to /usr/local/lib/libgfortran.5.dylib. That file has a date of Nov 9, 2021 on my Mac. Should I have a newer file? If so, how do I get it? I would have thought it would be included in the gfortran install, but maybe not?
> 
> Actually, there was an operating system change in the way that initialization was handled that is backwards-incompatible. We raised a ‘feedback’ with Apple, but the response was that this was intentional - it is possible that you are running into this - I’d need to check the exact versions at which we fixed it.
> 
>> More generally, can I get a list of the .dylib files that gfortran (11.2.0) and gcc (also 11.2.0) need for programs they compile to function properly? And the dates for them? Do these files need to be owned by user “root” or have other special permissions (on my Mac, I own them as a regular user).
> 
> No, nothing in GCC requires elevated permissions.
> 
> (of course, if you elect to build it from source and install to some place that requires admin privs., but that’s only for installation).
> 
>> This seems like a very obscure, yet debilitating problem that I have encountered. If I cannot write or modify my fortran codes and have them work properly, I am SOL. 
> 
> gfortran works fine on Monterey - so I am sure that we will be able to fix this.
> 
> Iain
> 
> ** Arm64 does require building an out-of-tree branch, but that is being used widely, so also very well-tested.
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What .dylib files does gfortran v 11.2.0 need on a Mac?
  2023-07-22 19:05   ` Leigh House
@ 2023-07-22 19:14     ` Iain Sandoe
  2023-07-22 22:25       ` Leigh House
  0 siblings, 1 reply; 5+ messages in thread
From: Iain Sandoe @ 2023-07-22 19:14 UTC (permalink / raw)
  To: Leigh House; +Cc: GCC Fortran

Hi Leigh,

> On 22 Jul 2023, at 20:05, Leigh House <hagar@newmexico.com> wrote:
> 

> Thanks for your fast reply!
> 
> My Mac is an intel iMac from 2019. 

That should be fine with “upstream” sources, should you decide to build from source (but that should not be necessary, there are several places providing gfortran for mac).

> I didn’t keep detailed notes about where I got the compiler package, though I’ve often gone to hpc.sourceforge.net in the past, under “Computation Tools”. I suspect that is where I got my current compiler from. 
> 
> And I didn’t keep notes about which .dylib file I had to find and copy into /usr/local/lib, though from a colleague’s experience it may have been libgfortran.5.dylib.

I checked the version(s) for which the initialization bug is fixed:

GCC-10.4
GCC-11.3 <<- so you are almost certainly seeing it with 11.2.
GCC-12.1
GCC-13.1
(and current development ’trunk’).

This was a very unusual case - we try to be backward compatible as much as possible, but the change was out of our hands.

So, I’d recommend that you see if your “usual source” has an update - or, alternately, go to one of the ‘OSS distributions’ like Homebrew.

HTH,
Iain


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What .dylib files does gfortran v 11.2.0 need on a Mac?
  2023-07-22 19:14     ` Iain Sandoe
@ 2023-07-22 22:25       ` Leigh House
  0 siblings, 0 replies; 5+ messages in thread
From: Leigh House @ 2023-07-22 22:25 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: GCC Fortran

Iain,

Thanks once again for your quick reply. 

This problem, which at first seemed simple, has gotten a bit more complicated, and consumed a huge amount of my head-scratching and time. Your help should get me to the solution quickly now. The only versions that my usual source has that are on your list of having the initialization bug fixed seem to be for Macs with the Apple M1 or M2 chip. So I’ll look elsewhere for this fix. 

Once again, thank you very much!

Leigh

> On Jul 22, 2023, at 1:14 PM, Iain Sandoe <iain@sandoe.co.uk> wrote:
> 
> Hi Leigh,
> 
>> On 22 Jul 2023, at 20:05, Leigh House <hagar@newmexico.com> wrote:
>> 
> 
>> Thanks for your fast reply!
>> 
>> My Mac is an intel iMac from 2019. 
> 
> That should be fine with “upstream” sources, should you decide to build from source (but that should not be necessary, there are several places providing gfortran for mac).
> 
>> I didn’t keep detailed notes about where I got the compiler package, though I’ve often gone to hpc.sourceforge.net in the past, under “Computation Tools”. I suspect that is where I got my current compiler from. 
>> 
>> And I didn’t keep notes about which .dylib file I had to find and copy into /usr/local/lib, though from a colleague’s experience it may have been libgfortran.5.dylib.
> 
> I checked the version(s) for which the initialization bug is fixed:
> 
> GCC-10.4
> GCC-11.3 <<- so you are almost certainly seeing it with 11.2.
> GCC-12.1
> GCC-13.1
> (and current development ’trunk’).
> 
> This was a very unusual case - we try to be backward compatible as much as possible, but the change was out of our hands.
> 
> So, I’d recommend that you see if your “usual source” has an update - or, alternately, go to one of the ‘OSS distributions’ like Homebrew.
> 
> HTH,
> Iain
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-22 22:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-22 18:20 What .dylib files does gfortran v 11.2.0 need on a Mac? Leigh House
2023-07-22 18:49 ` Iain Sandoe
2023-07-22 19:05   ` Leigh House
2023-07-22 19:14     ` Iain Sandoe
2023-07-22 22:25       ` Leigh House

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).