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

Fix for PRODENV being set incorrectly in setup.sh #17

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

slwatkins
Copy link
Member

When running source setup.sh on some systems, the PRODENV variable is set instead to the folder where bash exists, e.g. /bin. This appears to be because the $0 is set to /bin/bash when sourcing the script (as opposed to running the script via bash setup.sh). I was experiencing this issue using a terminal on the NERSC Jupyter server.

See more, e.g., in this Stack Overflow post: https://stackoverflow.com/questions/21792176/0-doesnt-work-when-i-source-a-bash-script

I took the solution from one of the answers, and have tested it to confirm that PRODENV is set to location of the script when sourcing through the terminal on the Jupyter server, as well as ssh-ing into perlmutter directly.

@gipert
Copy link
Member

gipert commented May 3, 2024

But this does not work with zsh right? I was looking for a solution that support both bash and zsh but never had time to look into it

@slwatkins
Copy link
Member Author

I ran it on my local mac with zsh and it worked fine, but using zsh on NERSC, I do get an error... Let me turn this PR into a draft, and I'll look into it a little more.

@slwatkins slwatkins marked this pull request as draft May 3, 2024 14:45
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.

2 participants