Difference between revisions of "ROOT Analyzer/Compiling"

From HallCWiki
Jump to navigationJump to search
(Comments about old root versions)
(make doesn't seem to work at all.)
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
[[category:12GeV Software]]
 
[[category:12GeV Software]]
A skeleton Hall C analyzer, based on the Hall A analyzer is available and may be retrieved with Git, see [[Analyzer/Git]].
+
The new Hall C analyzer, <tt>hcana</tt>, based on the Hall A analyzer is available and may be retrieved with git, see [[ROOT Analyzer/Git]].
  
Before compiling, go to the directory where the code is and setup the environment with
+
The only prerequisite, beyond what should normally be installed on a system, is root, version 5.32 or later, but not version 6.  On the JLab CUE systems, root may be setup by typing (or putting in your login script):
  
   source setup.sh
+
   setup root
  
(Or "source setup.csh" if you use csh/tcsh.)  This setup script can be called in your login scriptMake sure that in addition to the Hall C code in the <tt>src</tt> directory, the Hall A code is in the <tt>podd</tt> directory. See [[Analyzer/Git]] if it is not.
+
Note: Previous instructions used a version of root in <code>/group/hallc/root</code>As the default version of root in <code>/apps</code> is sufficient, this group disk version is no longer needed.  References to it should be removed from your <code>.login</code> and <code>.cshrc</code> files.
  
The only prerequisite, beyond what should normally be installed on a system, is root. Unfortunately, it seems that the version of root on the CUE is too old, so you will probably need to build your own version of root, using version 5.32 or later.  After building your own version of root, make sure that ROOTSYS points to the root distribution and that LD_LIBRARY_PATH includes $ROOTSYS/lib and PATH contains $ROOTSYS/bin
+
On your own system, install root somehow.
  
To compile the analyzer, type
+
Before compiling, go to the directory where the code is and setup the environment for hcana with
  
   make
+
   source setup.csh
  
This should build the Hall A libraries and the Hall C analyzer <tt>hcana</tt>.  If you get the error "'class TClonesArray' has no member named 'ConstructedAt'" then your version of root is too old.
+
(Or "source setup.sh" if you use bash.)  This setup script can be called in your login script.  Make sure that in addition to the Hall C code in the <tt>src</tt> directory, the Hall A code is in the <tt>podd</tt> directorySee [[Analyzer/Git]] if it is not.
 +
 
 +
SCons is available on JLab machines and is the recommended method to build hcana.  (CMake support is 'experimental''make' is deprecated.)
 +
 
 +
To use SCons, type:
 +
 
 +
  scons
 +
 
 +
Additional SCons features :
 +
 
 +
To do the equivalent of "make clean", do:
 +
 
 +
  scons -c
 +
 
 +
To compile with debug capabilities, do:
 +
 
 +
  scons debug=1
 +
 
 +
To compile the standalone codes the are part of podd, do:
 +
 
 +
  scons standalone=1
 +
 
 +
This should build the Hall A libraries and the Hall C analyzer '''hcana'''.
  
 
See [[Analyzer/Running]] for instructions to run the analyzer.
 
See [[Analyzer/Running]] for instructions to run the analyzer.
 +
 +
=== Build Errors ===
 +
 +
==== Missing system header files ====
 +
Error: cannot open file "gnu/stubs.h"  /usr/include/features.h:399:
 +
Error: cannot open file "bits/wchar.h"  /usr/include/stdint.h:27:
 +
Error: cannot open file "bits/wordsize.h"  /usr/include/stdint.h:28:
 +
 +
* If you're on a Debian based multi-lib distribution (Ubununtu, ...), try this: <code>sudo apt-get install g++-multilib</code>

Latest revision as of 16:12, 18 April 2023

The new Hall C analyzer, hcana, based on the Hall A analyzer is available and may be retrieved with git, see ROOT Analyzer/Git.

The only prerequisite, beyond what should normally be installed on a system, is root, version 5.32 or later, but not version 6. On the JLab CUE systems, root may be setup by typing (or putting in your login script):

 setup root

Note: Previous instructions used a version of root in /group/hallc/root. As the default version of root in /apps is sufficient, this group disk version is no longer needed. References to it should be removed from your .login and .cshrc files.

On your own system, install root somehow.

Before compiling, go to the directory where the code is and setup the environment for hcana with

 source setup.csh

(Or "source setup.sh" if you use bash.) This setup script can be called in your login script. Make sure that in addition to the Hall C code in the src directory, the Hall A code is in the podd directory. See Analyzer/Git if it is not.

SCons is available on JLab machines and is the recommended method to build hcana. (CMake support is 'experimental'. 'make' is deprecated.)

To use SCons, type:

 scons

Additional SCons features :

To do the equivalent of "make clean", do:

 scons -c

To compile with debug capabilities, do:

 scons debug=1

To compile the standalone codes the are part of podd, do:

 scons standalone=1

This should build the Hall A libraries and the Hall C analyzer hcana.

See Analyzer/Running for instructions to run the analyzer.

Build Errors

Missing system header files

Error: cannot open file "gnu/stubs.h"  /usr/include/features.h:399:
Error: cannot open file "bits/wchar.h"  /usr/include/stdint.h:27:
Error: cannot open file "bits/wordsize.h"  /usr/include/stdint.h:28:
  • If you're on a Debian based multi-lib distribution (Ubununtu, ...), try this: sudo apt-get install g++-multilib