Skip to content

Reintroduce dynamic linking support#908

Merged
VincentVanlaer merged 7 commits intomainfrom
dynamic-linked
Jan 29, 2026
Merged

Reintroduce dynamic linking support#908
VincentVanlaer merged 7 commits intomainfrom
dynamic-linked

Conversation

@VincentVanlaer
Copy link
Copy Markdown
Member

@VincentVanlaer VincentVanlaer commented Dec 28, 2025

This PR reintroduces proper dynamic linking support for the new build system.

Remaining tasks:

  • Testing on darwin systems (see Unable to compile with USE_SHARED = YES on a modern Mac #846)
  • Ensure make install or similar commands work (useful for pymesa). The currently implementation uses rpath to allow the libraries to find each other. This will need to be fixed with chrpath or patchelf on install. Alternatively, pymesa would need to be changed to look for modules and libraries in the build folder, if there is no need otherwise to support a make install command.

This is the last main part of #662.

Fixes #846

@VincentVanlaer
Copy link
Copy Markdown
Member Author

@rhdtownsend I am currently forcing all compile flags for the normal MESA modules onto forum and gyre, as I need to propagate the linker and include flags. Once gyre and forum switch to pkg-config for their dependencies, I can remove that part. Alternatively, it would also be possible to patch build/Makefile in gyre & forum to not set FFLAGS unconditionally.

Originally, only the include directories were passed to forum and gyre,
disregarding any compile flags set by the forum and gyre makefiles.
Instead, set all compile flags used by mesa, but set the language
standard to Fortran 2018
For now, let's not support a `make install` command until there is a
specific usecase we can test with.
else if(icasin.eq.2) then
xl1=cs1(1)
else
xl1=dfloat(l1)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ADIPLS really showing its age here. DBLE appears to have been added in F77.

@VincentVanlaer VincentVanlaer merged commit b18a2f9 into main Jan 29, 2026
5 checks passed
@VincentVanlaer VincentVanlaer deleted the dynamic-linked branch January 30, 2026 12:05
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.

Unable to compile with USE_SHARED = YES on a modern Mac

2 participants