I found that the module program wouldn't correctly load a module when the
full path and filename were specified on the command line, like:
module load /afs/someco/project/modulefiles/my_project_module
After a bit of debug and tracing, I determined a simple patch for the
locate_module.c source:
---------------------------------------------------------------------------------------------------------------------
diff -ur modules-3.1.5/locate_module.c
modules-3.1.5.wsgfix1/locate_module.c
--- modules-3.1.5/locate_module.c Sat Jun 9 05:48:46 2001
+++ modules-3.1.5.wsgfix1/locate_module.c Mon Oct 22 15:07:55 2001
@@ -195,6 +195,13 @@
return( TCL_ERROR); /** --- EXIT PROCEDURE (FAILURE) --> **/
/**
+ ** Reinstall the 'modulefile' which has been corrupted by
tokeni-
+ ** zation
+ **/
+
+ *p = '/';
+
+ /**
** ... Looks good! Conditionally (if there has been no version
** specified) we have to add the default version
**/
@@ -208,13 +215,6 @@
strcat( filename, result);
}
- /**
- ** Reinstall the 'modulefile' which has been corrupted by
tokeni-
- ** zation
- **/
-
- *p = '/';
-
} else {
/**
---------------------------------------------------------------------------------------------------------------------
Moving the *p = '/'; line back up above the creation of the filename result
to be returned from the Locate_ModuleFile() function fixes my problem.
Also to note: the debugging facilities that should be enabled when I
specify them on the configure command line like:
./configure \
... standard stuff copied from RKOConfigure file ... \
--with-debug=99 \
--enable-logging \
--with-trace-load=yes \
--with-log-facility-verbose \
--with-log-facility-info \
--with-log-facility-debug
These facilities do not work correctly under Linux (RH7.2). In fact they
cause a coredump everytime I try to run any module command.
The workaround is to allow ./configure to go ahead and complete it's
creation of config.h, then go in by hand and change the following lines:
from:
#define WITH_LOG_FACILITY_VERBOSE "stderr"
#define WITH_LOG_FACILITY_INFO "local7.notice"
#define WITH_LOG_FACILITY_DEBUG "local7.notice"
to:
#define WITH_LOG_FACILITY_VERBOSE _stderr
#define WITH_LOG_FACILITY_INFO _stderr
#define WITH_LOG_FACILITY_DEBUG _stderr
then continue with the 'make; make install' like normal.
If anyone understands why this is broken for RH7.2 Linux, I would like to
know... or maybe you can just patch it for the next release!
Thanks,
------------------------------------------
W. Scott Gaskins
(919) 543-9863
sga...@us...
IBM Bldg062/C215
P.O. Box 12195 - YM6A/062
3039 Cornwallis Rd
RTP, NC 27709
|