-1

I'm working a small project which needs using OpenMPI to make "mpicc" work. I made a file make_cmd:

#!/bin/bash

module load OpenMPI

However, after executing ./make_cmd, I was told:

mpicc: command not found

But if I just type on the command line: module load OpenMPI, then mpicc is working.

Why is that? Thanks!

0

1 Answer 1

1

See this answer on neighbouring site.

Because module is an alias/shell function and not a binary program, it's not necessarily available in the non-interactive sub-shell that is created when you run your script. You could probably run source make_cmd though, as that will just run the commands in your current interactive shell. You could ditch the #!/bin/bash line in that case.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.