Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need to add LD_LIBRARY_PATH settings to example environments #13

Open
carns opened this issue Aug 15, 2022 · 4 comments
Open

need to add LD_LIBRARY_PATH settings to example environments #13

carns opened this issue Aug 15, 2022 · 4 comments

Comments

@carns
Copy link
Collaborator

carns commented Aug 15, 2022

The latest origin/develop revisions of spack no longer export LD_LIBRARY_PATH for loaded modules. This can cause at least two problems with a Mochi stack:

  • external software built against a library loaded via spack may not set rpath automatically (this is particularly true with autotools builds, since spack package installs also deliberately strip the .la files that would otherwise help libtool to construct accurate rpath information)
  • providers loaded dynamically as modules in bedrock will not automatically be in the dlopen() search path

The most straightforward solution is to add a modules: section to our example environment files that override the default spack setting:

  modules:
    prefix_inspections:
      lib: [LD_LIBRARY_PATH]
      lib64: [LD_LIBRARY_PATH]

We need to add this to each of the spack.yaml files for safety. In theory it should not cause any harm on older spack releases but we should validate.

@mdorier
Copy link
Contributor

mdorier commented Aug 16, 2022

An alternative, for bedrock modules, would be to make bedrock use another environment variable, MOCHI_LIBRARY_PATH, to look for modules. We could then have all our mochi packages that have a bedrock module set this variable upon being loaded.

@carns
Copy link
Collaborator Author

carns commented Aug 16, 2022

An alternative, for bedrock modules, would be to make bedrock use another environment variable, MOCHI_LIBRARY_PATH, to look for modules. We could then have all our mochi packages that have a bedrock module set this variable upon being loaded.

Would the idea be to have bedrock find the .so files (searching MOCHI_LIBRARY_PATH) and then construct a fully resolved path to dlopen()? If we think we can make that work then I'll look closer at autoconf's problem finding mochi libraries before we commit to changing the recommended environment settings.

@mdorier
Copy link
Contributor

mdorier commented Aug 16, 2022

I would say more simply save the state of LD_LIBRARY_PATH, then append MOCHI_LIBRARY_PATH to it, call dlopen, then restore LD_LIBRARY_PATH?

@carns
Copy link
Collaborator Author

carns commented Aug 16, 2022

I would say more simply save the state of LD_LIBRARY_PATH, then append MOCHI_LIBRARY_PATH to it, call dlopen, then restore LD_LIBRARY_PATH?

Gotcha, that makes sense. Let's keep this issue on hold until we figure out our options then.

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

No branches or pull requests

2 participants