Makefile problem - How to run module load in a Makefile

Hi, I'm trying to run the module load command in a Makefile and i'm getting the following error:

make: module: command not found

Why is this? Is there any way to run this command in a Makefile?

NOTE: command - module load msjava/sunjdk/1.5.0 works fine outside of the Makefile

You mean like NERSC Software Modules? It looks like it's only supported for interactive shells, based on a very brief look.

>module load msjava/sunjdk/1.5.0 works on the command line but fails with:
>module: command not found
when used in make, bash, etc script files.

This is because the module enviroment has not been loaded, as it is for a normal user session.

try adding some thing similar to this before your module load call:

. /usr/share/modules/init/bash
module load msjava/sunjdk/1.5.0

Morgan