Skip to content

Reorder PIO to occur before NetCDF in common.mk#376

Merged
billsacks merged 2 commits intodevelopfrom
pio_before_netcdf
Apr 16, 2025
Merged

Reorder PIO to occur before NetCDF in common.mk#376
billsacks merged 2 commits intodevelopfrom
pio_before_netcdf

Conversation

@billsacks
Copy link
Member

This is needed with the linker on cygwin since PIO uses NetCDF, so the link flags need to be ordered -lpioc -lnetcdf. (It's possible that other linkers need this also, though we haven't seen the need for it on our test systems.)

This replaces #348 , based on decided-upon solution from this week's ESMF core team meeting.

FYI @theurich @danrosen25 @harmenwierenga

@harmenwierenga - I took your commit from your earlier branch that reorders the PIO and NETCDF sections in common.mk, because after further discussion, we saw rationale for that approach.

@theurich and @danrosen25 - let me know if you'd like to look this over before I merge it.

harmenwierenga and others added 2 commits April 4, 2025 17:18
This is needed with the linker on cygwin since PIO uses NetCDF, so the
link flags need to be ordered -lpioc -lnetcdf
@DWesl
Copy link
Collaborator

DWesl commented Apr 5, 2025

Since this is based on environment variables rather than attempted compilation, this should work fine

It's possible that other linkers need this also, though we haven't seen the need for it on our test systems

Windows is the only other system I've noticed with that link-order requirement, though it seems to be weaker: there's another project that probably had Windows CI that apparently handled -lblas -llapack just fine before I reversed the order so it would compile on Cygwin.

I'm told there's a -no-undefined linker flag that should emulate some of the Windows linker semantics, but I don't know which compiler supports it nor how much of the Windows semantics it implements.

Copy link
Member

@theurich theurich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks!

@billsacks billsacks merged commit 198e50b into develop Apr 16, 2025
6 checks passed
@billsacks billsacks deleted the pio_before_netcdf branch April 16, 2025 16:01
@harmenwierenga
Copy link
Contributor

@billsacks Thank you for this! I have not had time to look into testing it unfortunately. PIO accepted my changes to their repo a while ago, would it be feasible to update the version of PIO that is used by ESMF?

@DWesl
Copy link
Collaborator

DWesl commented Apr 16, 2025

would it be feasible to update the version of PIO that is used by ESMF?

Like #359?

@harmenwierenga
Copy link
Contributor

Nice, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants