module: command not found

Sam picture Sam · Feb 13, 2010 · Viewed 42.4k times · Source

I'm attempting to load several modules for building a library on Linux but am told that the command 'module' doesn't exist. I've Googled around and discovered that the solution was to source a directory called "module" which I am unable to locate despite extensive searching.

I'm not quite sure what I should and any help would be appreciated (it might help to know that the makefile I'm working with uses csh while my default shell is bash). Thanks!

Answer

Baedsch picture Baedsch · Apr 16, 2019

I tried to reproduce it and it turns out that for me sourcing

source /etc/profile.d/modules.sh

in th .sh script helps for bash and similar. For csh and tcsh, you have to add

source /etc/profile.d/modules.csh

to the script. Note, that this line must come first and then the

module load foo

line.