<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1421615915344_5301" dir="ltr">Can't you just symlink to various Pd-Vanilla/Pd-double versions that you've compiled?  That way you don't have to install anything system-wide.  <br></div><div id="yui_3_16_0_1_1421615915344_5298"><br><span></span></div><div dir="ltr" id="yui_3_16_0_1_1421615915344_5416"><span>-Jonathan</span></div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <font face="Arial" size="2"> On Sunday, January 18, 2015 3:26 PM, Charles Z Henry <czhenry@gmail.com> wrote:<br> </font> </div>  <br><br> <div class="y_msg_container">Hi list,<br><br>It's been awhile since I've posted anything useful--I have badly<br>broken my desktop's pd install and am setting up a new pd install on<br>my laptop today.  I've run into problems with having too many<br>compilations of pd and installing them system-wide.  I realized that I<br>needed to have different installations for development and some<br>standard compilations of vanilla and extended--plus wanting to try out<br>pd-l2ork and pd-double precision that I've never tried before.  Also,<br>it's good to be able to have many versions of the same software for<br>regression testing and documenting bugs.<br><br>That's the motivation for now setting up "environment modules",<br>sometimes also called "Unix modules", keeping multiple instances of<br>software and choosing among them which one will be added to the path<br>in the current shell.  So, this is a discussion of how to get modules<br>working effectively for Pd.<br><br>1.  Install<br>Deb/Ubuntu:<br>apt-get install environment-modules<br>RH/Fedora:<br>yum install environment-modules<br><br>(I leave it up to you to tell me what you do in OSX or arch).<br><br>To test, start a new terminal and run<br>module avail<br><br>If you receive the "module: command not found" error, then check your<br>terminal preferences.  Modules depend on having a "login" shell to<br>properly run startup scripts.<br><br>Modules use environment variables to keep track of the module search<br>path and loaded modules.  The "module" command itself is an alias for<br>"modulecmd $SHELL $@" (paraphrased).  To see the full list of module<br>related variables, run:<br>env | grep -i module<br><br>2.  Location of module files<br>as non-root user, run<br>module load use.own<br><br>This will create a directory ~/privatemodules directory and the file<br>"null" in it.  "module avail" will list "null" in your privatemodules<br>directory.  You may replace "privatemodules" with a symlink to some<br>other location if you wish.  Each time you want to load modules from<br>~/privatemodules, you have to run "module load use.own" first.<br><br>as root, you can edit /usr/share/modules/init/.modulespath and add any<br>path you like, like an NFS location.  You can also just place modules<br>into one of the default search paths, like<br>/etc/environment-modules/modules or /usr/share/modules/modulefiles.<br><br>Note: you may need to add or edit some things as root anyway.  Test<br>your installation for this tab-completion error in bash.  Type "module<br>load <tab>-<tab>" and see what happens.<br>In Ubuntu 14.04, the /etc/bash_completion.d/modules script has this line:<br>/usr/share/modules/3.2.10/bin/modulecmd bash -t avail 2>&<br>However, there is no such file.  You can edit the file and change that<br>path to /usr/bin/modulecmd or create a symlink to /usr/bin/modulecmd<br>as /usr/share/modules/3.2.10/bin/modulecmd.  Neither solution will<br>save you from re-encountering this bug next time you update<br>environment-modules.<br><br>digression: In ye olde cluster mill, this is how we're handling the<br>massive pileup of software: the OS install includes only development<br>software and infrastructure using packages (for platform stability and<br>consistency at the expense of performance).  All applications and<br>high-performance libraries are installed as a non-root user into<br>locations in NFS.  This lets us maintain arbitrary versions of<br>software without collisions or replacement, to be used at the users'<br>discretion.  In the past, I had re-written parts of a custom<br>application called "mpi-selector" (from Cisco) to let users setup<br>their environment... and later found out there was already a 20-year<br>old solution named "modules".  I edit the .modulespath file and<br>include a location in NFS--there's no sync issues and no outdated<br>files on the nodes, because everything needed for applications is in<br>NFS.  If a user needs to run a previous version at a date in the<br>future to reproduce results or compare changes, this can be done<br>easily and without admin assistance.<br><br>3.  What to put in a module file:<br><br>If you've already installed modules, run<br>man modulefile<br>http here: <a href="" class="removed-link" target="_blank">http://linux.die.net/man/4/modulefile</a><br><br>The first line of a module should be:<br>#%Module<br><br>The primary commands you'll need are<br>prepend-path<br>setenv<br>set-alias<br><br>Note that modules use tcl, with specific commands that get translated<br>according to which shell you're currently using.  You can't run<br>arbitrary code to setup Pd in the module file (please prove me wrong<br>:D ).  If you have your own "run-pd.sh" script, that differs for each<br>version of Pd you want to use, you can still manage this well with an<br>alias and environment variables.<br><br>4.  Using defaults<br>For sh/bash, edit ~/.profile or ~/.bash_profile, or for csh/tcsh, edit<br>~/.cshrc, and add<br>module load use.own (for non-root user privileges as mentioned above)<br>module load pd-0.45.4<br><br>To load a different version, you can unload the current version<br>(tab-completion will list loaded modules) and then load a new one,<br>such as<br>module unload pd-0.45.4<br>module load pd-extended-0.43.4<br><br>5.  Pure Data specific concerns (please provide feedback for anything<br>I may overlook---or simpler ways to accomplish things)<br><br>the HOME directory:<br>Each version of pd you're using may have its own home directory and<br>have its own .pdsettings file.<br>For this I make a tree of version-specific home directories such as:<br>mkdir -p /home/chenry/pd_HOME/pd-0.45.4<br><br>separate installation directories:<br>Then, I make an installation directory for it:<br>mkdir /home/chenry/pd-0.45.4<br><br>and compile using --prefix=/home/chenry/pd-0.45.4<br><br>My modules file for pd-0.45.4 is:<br><br>#%Module<br>setenv PD_HOME /home/chenry/pd_HOME/pd-0.45.4<br>setenv PD_BIN /home/chenry/pd-0.45.4/bin<br>prepend-path PATH /home/chenry/pd-0.45.4/bin<br>prepend-path LD_LIBRARY_PATH /home/chenry/pd-0.45.4/lib<br>set-alias pd {HOME=$PD_HOME $PD_BIN/pd $*}<br>set-alias pd-gui.tcl {HOME=$PD_HOME $PD_BIN/pd-gui.tcl $*}<br>set-alias pdsend {HOME=$PD_HOME $PD_BIN/pdsend $*}<br>set-alias pdreceive {HOME=$PD_HOME $PD_BIN/pdreceive $*}<br><br>I think this script might be a bit longer than it needs to be, but not<br>by much.  Any feedback is most welcome.<br>I found that I needed the PD_BIN variable in my "set-alias" commands.<br>I think I managed to cause a stack overflow with the alias pd as<br>{HOME=$PD_HOME pd $*}<br><br>You can check the aliased commands with the "type" command, ex. "type pd"<br><br>Also, the alias will not apply when you run pd in a debugger, such as<br>"strace pd".  You will need to expand the alias yourself and place the<br>variable declaration at the front as:<br>HOME=$PD_HOME strace $PD_BIN/pd<br><br>I also considered having HOME set to the PD_HOME variable globally,<br>which would avoid aliases.  If you did, defaults in ~/.profile would<br>be a little annoying.  Also, changes to other programs ~/. files would<br>be discarded when changing pd versions.<br><br>If you are not setting any defaults, it's fine to just set HOME in<br>your module files, knowing that you will be running only Pd after<br>running "module load" (and maybe jackd as well, if you have different<br>settings for jack you'd like to apply to each pd version).  In which<br>case, a working module file becomes just this short:<br><br>#%Module<br>setenv HOME /home/chenry/pd_HOME/pd-0.45.4<br>prepend-path PATH /home/chenry/pd-0.45.4/bin<br>prepend-path LD_LIBRARY_PATH /home/chenry/pd-0.45.4/lib<br><br>Chuck<br><br>_______________________________________________<br><a href="" class="removed-link" ymailto="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br>UNSUBSCRIBE and account-management -> <a href="" class="removed-link" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br><br><br></div>  </div> </div>  </div> </div></body></html>