<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Folks,</p>
<p>I've written a few lines that, when sourced, should help with
setting up the software environment at JLab. They provide succinct
commands for the task, namely <b>gxenv</b> and <b>gxclean</b>.
Once the commands are defined,</p>
<p> gxenv<br>
</p>
<p>sets up the default version set. Also you can say<br>
</p>
<p> gxenv /path/to/my_version.xml</p>
<p>to set up your favorite version set. Typing</p>
<p> gxclean</p>
<p>removes all GlueX-related bits from your environment.<br>
</p>
<p>Both tcsh and bash are supported. For tcsh, include the following
line in your <code>.cshrc</code>, <code>.login</code>, or <code>.tcshrc</code>:</p>
<pre><code>source /group/halld/Software/build_scripts/gluex_env_boot_jlab.csh
</code></pre>
<p>For bash, include the following line in your <code>.bashrc</code>
or <code>.profile</code>:</p>
<pre><code>source /group/halld/Software/build_scripts/gluex_env_boot_jlab.sh
</code></pre>
<p>Find further documentation by clicking <a moz-do-not-send="true"
href="https://github.com/JeffersonLab/build_scripts/wiki/gluex_env_boot_jlab.%28c%29sh">here</a>.
The page is also reproduced below.</p>
<p>This is new, so feedback welcome.<br>
</p>
<p> -- Mark</p>
<p>_____________________________________</p>
<h1 class="flex-auto min-width-0 mb-2 mb-md-0 mr-0 mr-md-2
gh-header-title instapaper_title">gluex_env_boot_jlab.(c)sh</h1>
<div class="mt-0 mt-lg-1 flex-shrink-0 gh-header-actions"> </div>
<div class="markdown-body">
<p>These scripts provide two "commands" (aliases for tcsh,
functions for bash) that facilitate setting up and tearing down
the GlueX software environment at JLab.</p>
<pre><code>gxenv
gxclean
</code></pre>
<p>By defining these commands, the scripts "boot-up" environment
setting.</p>
<p>The scripts also provide an environment variable, <code>DIST</code>,
that points to the directory containing all of the official
version set files (the <code>version_*.xml</code> files).</p>
<h2>
<a id="user-content-how-to-access-the-commands" class="anchor"
href="https://github.com/JeffersonLab/build_scripts/wiki/gluex_env_boot_jlab.%28c%29sh#how-to-access-the-commands"><svg
class="octicon octicon-link" viewBox="0 0 16 16" width="16"
height="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5
0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91
2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8
4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2
2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64
1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9
13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>How
to Access the Commands</h2>
<p>For tcsh, include the following line in your <code>.cshrc</code>,
<code>.login</code>, or <code>.tcshrc</code>:</p>
<pre><code>source /group/halld/Software/build_scripts/gluex_env_boot_jlab.csh
</code></pre>
<p>For bash, include the following line in your <code>.bashrc</code>
or <code>.profile</code>:</p>
<pre><code>source /group/halld/Software/build_scripts/gluex_env_boot_jlab.sh
</code></pre>
<h2>
<a id="user-content-how-to-use-the-commands" class="anchor"
href="https://github.com/JeffersonLab/build_scripts/wiki/gluex_env_boot_jlab.%28c%29sh#how-to-use-the-commands"><svg
class="octicon octicon-link" viewBox="0 0 16 16" width="16"
height="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5
0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91
2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8
4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2
2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64
1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9
13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>How
to Use the Commands</h2>
<p>Usage is the same for both tcsh and bash.</p>
<h3>
<a id="user-content-to-set-up-the-environment" class="anchor"
href="https://github.com/JeffersonLab/build_scripts/wiki/gluex_env_boot_jlab.%28c%29sh#to-set-up-the-environment"><svg
class="octicon octicon-link" viewBox="0 0 16 16" width="16"
height="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5
0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91
2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8
4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2
2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64
1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9
13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>To
Set-Up the Environment</h3>
<p>To get the default environment:</p>
<pre><code>gxenv
</code></pre>
<p>To get the environment for a particular official version set,
say <code>version_3.5_jlab.xml</code>, use the <code>DIST</code>
environment variable:</p>
<pre><code>gxenv $DIST/version_3.5_jlab.xml
</code></pre>
<p>To get the environment for an arbitrary xml file, use its path:</p>
<pre><code>gxenv /path/to/my_version.xml
</code></pre>
<h3>
<a id="user-content-to-take-down-the-environment" class="anchor"
href="https://github.com/JeffersonLab/build_scripts/wiki/gluex_env_boot_jlab.%28c%29sh#to-take-down-the-environment"><svg
class="octicon octicon-link" viewBox="0 0 16 16" width="16"
height="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5
0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91
2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8
4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2
2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64
1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9
13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>To
Take-Down the Environment</h3>
<p>To clear all of the GlueX-specific parts of the environment,
including GlueX-specific path elements (e. g., those in <code>PATH</code>):</p>
<pre><code>gxclean
</code></pre>
<p>This is not guaranteed to completely clean all gluexy things in
all circumstances, but should work well when using <code>gxenv</code>
to do the set-up.</p>
<h2>
<a id="user-content-why-implement-things-this-way"
class="anchor"
href="https://github.com/JeffersonLab/build_scripts/wiki/gluex_env_boot_jlab.%28c%29sh#why-implement-things-this-way"><svg
class="octicon octicon-link" viewBox="0 0 16 16" width="16"
height="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5
0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91
2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8
4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2
2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64
1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9
13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Why
Implement Things This Way?</h2>
<p>...or why not just do the set-up in the <code>.*rc</code>
file?</p>
<p>The underlying set-up command, <code>gluex_env_jlab.(c)sh</code>,
has become a bit heavy. You may not want to have it executed
everytime you start a new sub-shell. Also having the version set
hard-wired in your initial environment can be confusing if you
change version sets depending on what you are working on. For
these reasons, putting the set-up in the global shell set-up is
not recommended. Sourcing these scripts is very fast and once
sourced, it is easy to switch from one version set to another,
even from the command line.</p>
</div>
<a class="d-block p-3 muted-link text-center border border-dashed
rounded-1"
href="https://github.com/JeffersonLab/build_scripts/wiki/_new?wiki%5Bname%5D=_Footer"><svg
class="octicon octicon-plus mr-1" viewBox="0 0 12 16" width="12"
height="16"><path fill-rule="evenodd" d="M12
9H7v5H5V9H0V7h5V2h2v5h5v2z"></path></svg></a>
<pre class="moz-signature" cols="72">--
Mark Ito, <a class="moz-txt-link-abbreviated" href="mailto:marki@jlab.org">marki@jlab.org</a>, (757)269-5295
</pre>
</body>
</html>