Hi Bryan,
No. Module do not have the ability to "source setup.csh" like Csh does. Below is the example of Xilinx ISE:
#%Module3.2.1
##
## xilise 10.1 modulefile
##
set XLN_VER "10.1"
set OS_Host "Linux"
proc ModulesHelp { } {
set OS_Host "Linux"
puts stderr "xilise - load environment for Xilinx ISE 10.1\n"
puts stderr "Example commands: ise, coregen, etc.\n"
puts stderr "Run \"xilise_help\" to bring up the tool documentation.\n"
puts stderr "**** Run ONLY on $OS_Host ****\n"
}
module-whatis "load environment for Xilinx ISE Suite 10.1\n"
prereq modules
switch -exact $env(MODULESOS) {
Linux26 {
set OS "linux"
if { $env(MODULESOS_64) == "Yes" } {
set PLATFORM "lin64"
if [ file isdirectory /opt/xilinx_ise${XLN_VER}_linux64/ISE ] {
# Local installation
if [ module-info mode load ] {
setenv XILINX "/opt/xilinx_ise${XLN_VER}_linux64/ISE"
}
} elseif [ file isdirectory /import/xilinx_ise${XLN_VER}_linux64/ISE ] {
# NFS mount from main servers
if [ module-info mode load ] {
setenv XILINX "/import/xilinx_ise${XLN_VER}_linux64/ISE"
}
} else {
puts stderr "\n*** No Xilinx ISE $XLN_VER (64-bit) installation found on this host ***\n"
exit
}
} else {
set PLATFORM "lin"
if [ file isdirectory /opt/xilinx_ise${XLN_VER}_linux/ISE ] {
# Local installation
if [ module-info mode load ] {
setenv XILINX "/opt/xilinx_ise${XLN_VER}_linux/ISE"
}
} elseif [ file isdirectory /import/xilinx_ise${XLN_VER}_linux/ISE ] {
# NFS mount from main servers
if [ module-info mode load ] {
setenv XILINX "/import/xilinx_ise${XLN_VER}_linux/ISE"
}
} else {
puts stderr "\n*** No Xilinx ISE $XLN_VER (32-bit) installation found on this host ***\n"
exit
}
}
}
default {
puts stderr "\n* Sorry, Xilinx ISE $XLN_VER is not supported on $env(MODULES_OS) $env(MODULES_REL)."
puts stderr "*** Please log into $OS_Host to run this tool.\n"
exit
}
}
##### Common settings for all OS types #####
if { $env(MODULES_SHELL) != "sh" } {
set-alias xilise_help "acroread $env(XILINX)/doc/usenglish/books/manuals.pdf &"
}
prepend-path PATH $env(XILINX)/bin/$PLATFORM
prepend-path LMC_HOME $env(XILINX)/smartmodel/$PLATFORM/installed_$PLATFORM
prepend-path LD_LIBRARY_PATH $env(XILINX)/lib/$PLATFORM:/usr/X11R6/lib:$env(LMC_HOME)/lib/${OS}.lib:$env(LMC
_HOME)/lib/amd64.lib
# Make sure /usr/lib (or /usr/lib64) is in the front of LD_LIBRARY_PATH
#
# First strip out /usr/lib (or /usr/lib64) from $LD_LIBRARY_PATH, if it exists
if [ info exists env(LD_LIBRARY_PATH) ] {
if [ module-info mode load ] {
if { $env(MODULESOS_64) == "Yes" } {
remove-path LD_LIBRARY_PATH /usr/lib64
} else {
remove-path LD_LIBRARY_PATH /usr/lib
}
}
}
# Then put /usr/lib (or /usr/lib64) in front
if [ module-info mode load ] {
if { $env(MODULESOS_64) == "Yes" } {
prepend-path LD_LIBRARY_PATH /usr/lib64
} else {
prepend-path LD_LIBRARY_PATH /usr/lib
}
}
setenv TEMP /scratch
setenv TMP /scratch
setenv TMPDIR /scratch
Good Luck.
Vu
-----Original Message-----
From: Bryan Murdock [mailto:bmu...@gm...]
Sent: Wednesday, October 28, 2009 10:22 AM
To: mod...@li...
Subject: [Modules] source a file from a module?
I have a software package (Xilinx design tools) that supplies a
"settings" file that you normally just source before running the tool.
It's about 40 lines of shell scripting that sets various environment
variables and sets up a hidden file to save settings. It would be a
hassle to convert it to a tcl module file. Is there a way to have the
file sourced when I do a 'module use xilinx'? I guess that would
defeat some of the functionality of modules, but I'd like to get going
quickly and maybe convert it to a proper module file later.
Bryan
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Modules-interest mailing list
Mod...@li...
https://lists.sourceforge.net/lists/listinfo/modules-interest
|