1
dnl--------------------------------------------------------------------------------
3
dnl This file is part of Code_Saturne, a general-purpose CFD tool.
5
dnl Copyright (C) 1998-2011 EDF S.A.
7
dnl This program is free software; you can redistribute it and/or modify it under
8
dnl the terms of the GNU General Public License as published by the Free Software
9
dnl Foundation; either version 2 of the License, or (at your option) any later
12
dnl This program is distributed in the hope that it will be useful, but WITHOUT
13
dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
dnl FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17
dnl You should have received a copy of the GNU General Public License along with
18
dnl this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
19
dnl Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
dnl--------------------------------------------------------------------------------
23
# CS_AC_TEST_ENV_MODULES
24
#-----------------------
25
# checks for environement modules
27
AC_DEFUN([CS_AC_TEST_ENV_MODULES], [
30
[AS_HELP_STRING([--with-modules=LIST],
31
[colon-separated list of environment modules])],
32
[with_modules=$withval],
35
# Attempt at auto-detection
39
if test "x$with_modules" = "xcheck" ; then
41
# Test for environment modules
43
if test "x$MODULESHOME" != "x" ; then
45
AC_MSG_CHECKING([for environment modules])
52
for m in $LOADEDMODULES; do try_modules="$try_modules $m"; done
57
while test "x$try_modules" != "x$try_modules_p" ;
59
try_modules_p=$try_modules
61
for m in $try_modules_p ; do
62
prv_LOADED=$LOADEDMODULES
63
module load $m > /dev/null 2>&1
64
if test "$prv_LOADED" != "$LOADEDMODULES" ; then
65
cs_env_modules="$cs_env_modules $m"
67
try_modules="$retry_modules $m"
75
elif test "x$with_modules" != "xno" ; then
79
for m in $with_modules; do cs_env_modules="$cs_env_modules $m"; done
84
# Find the modulecmd executable
85
AC_PATH_PROG([MODULECMD], [modulecmd], [], [${MODULESHOME}/bin:$PATH])
87
AC_SUBST(cs_env_modules)