Opened 22 months ago

Last modified 8 months ago

#65413 assigned defect

demeter @0.9.26 fails to build: library not found for -lgfortran

Reported by: jmroot (Joshua Root) Owned by: joefowler (Joe Fowler)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: cjones051073 (Chris Jones), jnburrow, mascguy (Christopher Nielsen)
Port: demeter

Description

Example: https://build.macports.org/builders/ports-11_x86_64-builder/builds/77193

It's using-L/opt/local/lib/gcc11/gcc/x86_64-apple-darwin20/11.2.0 -L/opt/local/lib/gcc11/gcc/x86_64-apple-darwin20/11.2.0/../../.. which I guess are directories installed by gcc11? There's no (direct) dependency however. It may be getting the flags from ifeffit?

Needing to depend on gcc just to link against libfgortran doesn't seem ideal, nor does having to match the gcc variant of ifeffit. Not sure how the build system is supposed to figure out the right link flags for libgcc11 though?

Attachments (1)

demeter-macos11.log (203.4 KB) - added by jmroot (Joshua Root) 22 months ago.

Download all attachments as: .zip

Change History (10)

Changed 22 months ago by jmroot (Joshua Root)

Attachment: demeter-macos11.log added

comment:1 Changed 22 months ago by cjones051073 (Chris Jones)

If a port needs libgfortran, it should declare a path-style dependency on libgcc. i.e.

depends_lib-append path:share/doc/libgcc/README:libgcc

comment:2 Changed 22 months ago by jmroot (Joshua Root)

But libgcc doesn't actually provide a libgfortran.dylib link? There's only libgfortran.5.dylib in libgcc11.

comment:3 Changed 22 months ago by cjones051073 (Chris Jones)

Not directly no, but libgcc is designed to then trigger the installation of the libgccX currently providing the primary runtime, which currently is libgcc11 (and soon I will be updating to libgcc12).

The point is ports should not directly depend on a specific versioned libgccX, but libgcc.

comment:4 Changed 22 months ago by cjones051073 (Chris Jones)

Note though, libgcc/libgccX provides the runtime support under /opt/local/lib/libgcc/ which is where ports should be looking for them. They should not be looking in areas like /opt/local/lib/gcc11/gcc/x86_64-apple-darwin20/11.2.0. These areas are a) only provided by the gccX ports, which are not intended to be needed by ports as a runtime dep, and b) bakes the exact gcc version in to the path used, which is fragile as this can and does change on port updates.

So it might also be that demeter needs to be educated to look for libgfortran in the correct location.

Last edited 22 months ago by cjones051073 (Chris Jones) (previous) (diff)

comment:5 Changed 22 months ago by kencu (Ken)

By the way, Iain has been working on these issues, and most have been fixed in the latest gcc11 in Iain’s repo.

We should switch to that on all systems, I believe, and then start rebuilding (revbumping) these broken ones, which might fix a lot of issues.

in particular, I’m referring to the version-specific gcc path reference, and the lack of a reference to our alternate libgcc library path, by this.

Last edited 22 months ago by kencu (Ken) (previous) (diff)

comment:7 Changed 22 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: jnburrow added

Has duplicate #65418.

comment:8 Changed 22 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:9 in reply to:  5 Changed 8 months ago by barracuda156

Replying to kencu:

By the way, Iain has been working on these issues, and most have been fixed in the latest gcc11 in Iain’s repo.

We should switch to that on all systems, I believe

We should, indeed :)

Note: See TracTickets for help on using tickets.