[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: modulefiles for fis-gtm may be?



On Wed, 22 Jan 2014, Luis Ibanez wrote:

>      Sounds good.

>                                     Yes, This looks great.
>    We will appreciate anything that will reduce the barrier 
>    of entry for learning M/MUMPS.  
>    Certainly the need for setting those environment variables 
>    (although not particularly difficult) is just one more opportunity
>    for typos, mistakes and things going wrong, which can lead to
>    a first visitor to M / MUMPS to have a frustrating experience.
>    I know that I have run in trouble many times due to simple errors
>    in those environment variables.
>    It is great that they considered the case of having multiple version
>    installed of the same tools. Which is one of the scenarios that 
>    Bhaskar has been very keen to make sure that are supported.
>    This will also be very useful for the VistA package. Since it will
>    also enable to have multiple installations running side by side.
>       So, how do we start using the environment-modules ?

Recommends: environment-modules +
add a Modulesfile under whatever that versioned path I have was blurbing
about.  then theoretically modules should be enabled upon login and
people would need just 'load' a corresponding module

>       (I apologize, if I missed it from your link to the email thread).
>       Could you suggest an example that we could follow ?

I wish I could give you an example in the archive, but I haven't got chance to
start using it myself.  for ants meanwhile I did following (do not remember if
tested 100% working ;) ), not sure if that is an ideal setup either.  I have
backport builds of modules for NeuroDebian but didn't upload yet -- wanted
first to make at least package use them... got short on time... I will CC
Alastair -- may be he could guide us a bit:

--- a/debian/control
+++ b/debian/control
@@ -20,6 +20,7 @@ Vcs-Browser: http://git.debian.org/?p=pkg-exppsy/ants.git;a=summary
 Package: ants
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
+Recommends: environment-modules
 Suggests: fsl, gridengine-client
 Description: advanced normalization tools for brain and image analysis
  Advanced Normalization Tools (ANTS) is an ITK-based suite of
diff --git a/debian/dirs b/debian/dirs
index a707198..be88593 100644
--- a/debian/dirs
+++ b/debian/dirs
@@ -1,2 +1,3 @@
 usr/lib/ants
 usr/bin
+usr/share/modules/modulefiles/ants
diff --git a/debian/rules b/debian/rules
index c3d8357..678f9cc 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,6 +5,8 @@ srcpkg = $(shell LC_ALL=C dpkg-parsechangelog | grep '^Source:' | cut -d ' ' -f
 debver = $(shell LC_ALL=C dpkg-parsechangelog | grep '^Version:' | cut -d ' ' -f 2,2 )
 uver = $(shell echo $(debver) | cut -d '-' -f 1,1 )
 
+modulesfile = debian/ants.environment-modules
+
 export  http_proxy=http://127.0.0.1:9/
 export  https_proxy=http://127.0.0.1:9/
 
@@ -44,7 +46,10 @@ override_dh_auto_configure:
                -DEXECUTABLE_OUTPUT_PATH:PATH=$(DESTBINDIR) \
                --debug-output
 
-override_dh_auto_build:
+%modules: %modules.in
+ sed -e 's,$$UVERSION,$(uver),g' $< >| $@
+
+override_dh_auto_build: $(modulesfile)
        dh_auto_build
        : Build manpages
        cd `/bin/ls -d obj-*/bin` && mkdir -p ../man && \
@@ -71,6 +76,8 @@ override_dh_auto_install:
        done
        : Install shell scripts
        install -t debian/ants/usr/lib/ants Scripts/*
+ : Install modules file
+ install -t debian/ants/usr/share/modules/modulefiles/ants $(modulesfile)
        : Adjust ANTSPATH
        cd debian/ants/usr/lib/ants && sed -ie 's,\([^"=]*\(/bin/ants\|ANTS/release/bin\)\),/usr/lib/ants,g' *.sh *.pl
        : Install manpages
@@ -78,7 +85,7 @@ override_dh_auto_install:
 
 override_dh_auto_clean:
        dh_auto_clean
-   rm -rf $(BUILDDIR)
+ rm -rf $(BUILDDIR) debian/ants.environment-modules
 
 # upstream tests use some tiny dataset for tests, which
 # they deposited online instead of keeping under the GIT

--- /dev/null
+++ b/debian/ants.environment-modules.in
@@ -0,0 +1,20 @@
+#%Module1.0#####################################################################
+##
+## ants modulefile
+##
+proc ModulesHelp { } {
+        global version
+
+        puts stderr "\tLoads the ANTs (advanced normalization tools) environment.\n"
+        puts stderr "\tIt will adjust PATH and set ANTSPATH so that all ANTs "
+        puts stderr "\tbecome available in your environment.\n"
+        puts stderr "\tVersion $version\n"
+}
+
+module-whatis   "enable ANTs binaries"
+
+# for Tcl script use only
+set     version      "$UVERSION"
+
+setenv  ANTSPATH   "/usr/lib/ants/"
+prepend-path PATH   /usr/lib/ants





-- 
Yaroslav O. Halchenko, Ph.D.
http://neuro.debian.net http://www.pymvpa.org http://www.fail2ban.org
Senior Research Associate,     Psychological and Brain Sciences Dept.
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik        


Reply to: