Difference between revisions of "Deprecated: Setting Up the GlueX Environment"

From GlueXWiki
Jump to: navigation, search
(draft)
 
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
We have two methods for setting up the environment for GlueX software. They are complementary; depending on what you want to do one will be more appropriate than the other. For lack of a better name I'll call them "setenv" and "build_scripts".
+
== '''Isn't this obsolete?''' ==
 +
At least in parts this seems outdated. For one, there is no sim_recon anymore. However, I can't judge whether there is still any useful info left. I also left a comment in the discussion, however, all previous authors are not part of the group anymore. So, this edit serves as a warning to the unsuspecting newbie.
 +
Joerg Reinhold
  
setenv
+
== Start of page ==
 +
We have two methods for setting up the environment for GlueX software. They are complementary; depending on what you want to do one will be more appropriate than the other. Let's call them "build_scripts" and "setenv".
 +
 
 +
==build_scripts==
 +
 
 +
See this [https://halldweb.jlab.org/docs/build_scripts_web/node6.html#SECTION00062400000000000000 section of the Build Scripts GlueX Doc].
 +
* '''Advantages''': do not need a pre-existing build, can customize configuration without re-writing scripts.
 +
* '''Disadvantages''': more complicated.
 +
 
 +
==setenv==
  
 
For every complete build of sim-recon, a setenv.csh and a setenv.sh file is produced. Sourcing the appropriate file will reproduce the GlueX-related environment that was used to build that version of sim-recon exactly. Find the files under the BMS_OSNAME directory (directory that looks like Linux_RHEL7-x86_64-gcc4.8.3 for example, pick the one appropriate for your platform) of HALLD_HOME.
 
For every complete build of sim-recon, a setenv.csh and a setenv.sh file is produced. Sourcing the appropriate file will reproduce the GlueX-related environment that was used to build that version of sim-recon exactly. Find the files under the BMS_OSNAME directory (directory that looks like Linux_RHEL7-x86_64-gcc4.8.3 for example, pick the one appropriate for your platform) of HALLD_HOME.
Line 7: Line 18:
 
If you need custom settings of the environment, make a copy of the appropriate file and edit it. The file is nicely formatted and the changes you need are not hard to figure out.
 
If you need custom settings of the environment, make a copy of the appropriate file and edit it. The file is nicely formatted and the changes you need are not hard to figure out.
  
Advantages: nothing to change, guaranteed consistency
+
* '''Advantages''': nothing to change, guaranteed consistency
Disadvantage: customization by direct editing of script, need pre-existing successful build to start
+
* '''Disadvantages''': customization by direct editing of script, need pre-existing successful build to start
 +
 
 +
===Script Location at JLab===
  
build_scripts
+
You can find the setenv scripts in the following directory:
  
There is a set of scripts to help you set-up your environment from scratch. Even if one is not starting from scratch, they can be used to set-up pre-existing sets of software. At JLab they are in /group/halld/Software/scripts/build_scripts . They can be checked out at https://halldsvn.jlab.org/repos/trunk/scripts/build_scripts.
+
  /group/halld/Software/builds/$BMS_OSNAME/sim-recon/sim-recon-<version number>/$BMS_OSNAME
  
Default build at JLab
+
where <version number> is the sim-recon version number you would like to use and $BMS_OSNAME is the "osrelease" identifier. To find a list of versions, see the [[Sim-Recon Tagged Releases|sim-recon releases page]]. To get the osrelease identifier, execute the following command:
  
Sourcing the script gluex_env_jlab.(c)sh will set-up the default environment at JLab.
+
  /group/halld/Software/build_scripts/osrelease.pl
  
Using a version.xml
+
This script will print the appropriate value of $BMS_OSNAME to standard output. Alternatively you can set the BMS_OSNAME environment variable in C-shell-like shells with
  
If you are using the standard GlueX Version Managment System (GVMS) directory structure, you can use a version-specifying xml file to set up your environment.
+
  setenv BMS_OSNAME `/group/halld/Software/build_scripts/osrelease.pl`
  
1 Define GLUEX_TOP and BUILD_SCRIPTS
+
or in Bourne-shell-like shells with
2 Identify a version.xml, e. g., /path/to/version.xml
+
3 source $BUILD_SCRIPTS/gluex_env_version.(c)sh /path/to/version.xml
+
  
At JLab, there is a GLUEX_TOP for each supported platform in /group/halld/Software/builds.
+
  BMS_OSNAME=`group/halld/Software/build_scripts/osrelease.pl`
  
Using version.xml and a custom build of sim-recon
+
== Optional, Additional, User-specific Environment Variables ==
  
1) define GLUEX_TOP, BUILD_SCRIPTS
+
There are several optional, additional, user-specific environment variables that can be set:
2) identify a version.xml, /path/to/version.xml
+
* <span style="color:#0000FF">'''$JANA_RESOURCE_DIR'''</span>: Set this variable to any directory path. If defined, this directory is where JANA will download external resources needed for reconstruction, such as the magnetic field map. 
3) eval `$BUILD_SCRIPTS/version.pl $version_file`
+
* <span style="color:#0000FF">'''$HALLD_MY'''</span>: Set this variable to any directory path.  This folder is then intended to contain your personal code, such as your analysis plugins. If this variable is defined prior to sourcing the environment, the appropriate subfolders will be added to <span style="color:#0000FF">'''$PATH'''</span>, <span style="color:#0000FF">'''$LD_LIBRARY_PATH'''</span>, and <span style="color:#0000FF">'''$JANA_PLUGIN_PATH'''</span>, so that you can use your plugins/etc. within JANA.
4) setenv HALLD_HOME /path/to/sim-recon (or export HALLD_HOME=/path/to/sim-recon)
+
* When performing an analysis, you should use an SQLite file rather than directly accessing the CCDB database. If the path to your SQLite file is set by <span style="color:#0000FF">'''$SQLITE_PATH'''</span> (variable not necessary, defined for convenience), change the following environment variables to:
5) source $BUILD_SCRIPTS/gluex_env.(c)sh
+
<pre>
 +
setenv CCDB_CONNECTION sqlite:///${SQLITE_PATH}
 +
setenv JANA_CALIB_URL sqlite:///${SQLITE_PATH}
 +
</pre>

Latest revision as of 19:32, 24 November 2022

Isn't this obsolete?

At least in parts this seems outdated. For one, there is no sim_recon anymore. However, I can't judge whether there is still any useful info left. I also left a comment in the discussion, however, all previous authors are not part of the group anymore. So, this edit serves as a warning to the unsuspecting newbie. Joerg Reinhold

Start of page

We have two methods for setting up the environment for GlueX software. They are complementary; depending on what you want to do one will be more appropriate than the other. Let's call them "build_scripts" and "setenv".

build_scripts

See this section of the Build Scripts GlueX Doc.

  • Advantages: do not need a pre-existing build, can customize configuration without re-writing scripts.
  • Disadvantages: more complicated.

setenv

For every complete build of sim-recon, a setenv.csh and a setenv.sh file is produced. Sourcing the appropriate file will reproduce the GlueX-related environment that was used to build that version of sim-recon exactly. Find the files under the BMS_OSNAME directory (directory that looks like Linux_RHEL7-x86_64-gcc4.8.3 for example, pick the one appropriate for your platform) of HALLD_HOME.

If you need custom settings of the environment, make a copy of the appropriate file and edit it. The file is nicely formatted and the changes you need are not hard to figure out.

  • Advantages: nothing to change, guaranteed consistency
  • Disadvantages: customization by direct editing of script, need pre-existing successful build to start

Script Location at JLab

You can find the setenv scripts in the following directory:

 /group/halld/Software/builds/$BMS_OSNAME/sim-recon/sim-recon-<version number>/$BMS_OSNAME

where <version number> is the sim-recon version number you would like to use and $BMS_OSNAME is the "osrelease" identifier. To find a list of versions, see the sim-recon releases page. To get the osrelease identifier, execute the following command:

 /group/halld/Software/build_scripts/osrelease.pl

This script will print the appropriate value of $BMS_OSNAME to standard output. Alternatively you can set the BMS_OSNAME environment variable in C-shell-like shells with

 setenv BMS_OSNAME `/group/halld/Software/build_scripts/osrelease.pl`

or in Bourne-shell-like shells with

 BMS_OSNAME=`group/halld/Software/build_scripts/osrelease.pl`

Optional, Additional, User-specific Environment Variables

There are several optional, additional, user-specific environment variables that can be set:

  • $JANA_RESOURCE_DIR: Set this variable to any directory path. If defined, this directory is where JANA will download external resources needed for reconstruction, such as the magnetic field map.
  • $HALLD_MY: Set this variable to any directory path. This folder is then intended to contain your personal code, such as your analysis plugins. If this variable is defined prior to sourcing the environment, the appropriate subfolders will be added to $PATH, $LD_LIBRARY_PATH, and $JANA_PLUGIN_PATH, so that you can use your plugins/etc. within JANA.
  • When performing an analysis, you should use an SQLite file rather than directly accessing the CCDB database. If the path to your SQLite file is set by $SQLITE_PATH (variable not necessary, defined for convenience), change the following environment variables to:
setenv CCDB_CONNECTION sqlite:///${SQLITE_PATH}
setenv JANA_CALIB_URL sqlite:///${SQLITE_PATH}