Difference between revisions of "HOWTO use the stand-alone HDDS system"

From GlueXWiki
Jump to: navigation, search
(rough draft)
 
Line 1: Line 1:
As we decided at the the ??? Offline meeting, HDDS will be split off into a directory distinct from src.
+
As we decided at the the [[GlueX Offline Meeting, October 21, 2009|October 21 Offline meeting]], HDDS will be split off into a directory distinct from src. See the [[Why Separate HDDS?|presentation from that meeting]] for a discussion of the reasons for doing this.
  
=What changed=
+
=What changed?=
  
* '''hdds directory''' The directory trunk/src/programs/Simulation/hdds was moved to trunk/hdds. It must now be checked out and build separately from src. This eliminates the need to do a make in programs/Simulation/hdds before making the rest of src.
+
<ul>
* '''new build scheme for hdds''' The new top-level hdds creates a source directory, a libraries directory and a binaries directory.
+
<li> '''hdds directory'''<br>
** bin: stores the binaries needed for source code generation
+
The directory trunk/src/programs/Simulation/hdds was moved to trunk/hdds. It must now be checked out and build separately from src. This eliminates the need to do a make in programs/Simulation/hdds before making the rest of src.</li>
** src: stores the "made" source code files including any include files
+
<li> '''new build scheme for hdds'''<br>
** lib: stores libraries of objects compiles from files in src
+
The new top-level hdds creates a source directory, a libraries directory and a binaries directory.</li>
 +
<ul>
 +
<li> bin: stores the binaries needed for source code generation</li>
 +
<li> src: stores the "made" source code files including any include files</li>
 +
<li> lib: stores libraries of objects compiles from files in src</li>
 +
</ul>
 
With this structure, all hdds geometry dependent programs will be able to access what they need from src and lib.
 
With this structure, all hdds geometry dependent programs will be able to access what they need from src and lib.
* '''new environment variables''' For other programs to access src and lib, two environment variables are needed: HDDS_SRC and HDDS_LIB. Makefiles should use these to access the files they need.
+
<li> '''new environment variables'''<br>
 +
For other programs to access src and lib, two environment variables are needed: '''HDDS_SRC''' and '''HDDS_LIB'''. Makefiles should use these to access the files they need.</li>
 +
</ul>
  
Here are the steps you will need to follow to use the new structure.
+
=Steps for using the new structure=
  
In the following I will assume that
+
Here are the steps you will need to follow to use the new structure. There are two scenarios described:
(a) You checkout latest version of src and that (for definiteness) you want to put it in /home/user/halld/src and that
+
# Fresh checkout and build
 +
# Update current working version, re-build
 +
 
 +
==Fresh checkout and build==
 +
 
 +
In the following I will assume that<br>
 +
(a) You want to checkout the latest version of src and that (for definiteness) you want to put it in /home/user/halld/src and that<br>
 
(b) the desired location of the hdds tree is /home/user/hdds
 
(b) the desired location of the hdds tree is /home/user/hdds
  
# '''checkout hdds'''
+
<ul>
 +
<li> 1. '''checkout hdds'''
 +
<pre>
 
   cd /home/user
 
   cd /home/user
 
   svn checkout https://halldsvn.jlab.org/repos/trunk/hdds
 
   svn checkout https://halldsvn.jlab.org/repos/trunk/hdds
# '''build hdds''' BMS_OSNAME must be defined. The makefile will check that it is and will fail if it is not.
+
</pre>
 +
</li>
 +
<li> 2. '''build hdds''' BMS_OSNAME must be defined. The makefile will check that it is and will fail if it is not.
 +
<pre>
 
   cd /home/user/hdds
 
   cd /home/user/hdds
 
   make
 
   make
# '''set-up hdds environment variables'''
+
</pre>
 +
</li>
 +
<li> 3. '''set-up hdds environment variables'''
 +
<pre>
 
   setenv HDDS_SRC /home/user/hdds/src
 
   setenv HDDS_SRC /home/user/hdds/src
 
   setenv HDDS_LIB /home/user/hdds/lib/$BMS_OSNAME
 
   setenv HDDS_LIB /home/user/hdds/lib/$BMS_OSNAME
# '''checkout the src tree'''
+
</pre>
 +
</li>
 +
<li> 4. '''checkout the src tree'''
 +
<pre>
 
   cd /home/user/halld
 
   cd /home/user/halld
 
   svn checkout https://halldsvn.jlab.org/repos/trunk/src
 
   svn checkout https://halldsvn.jlab.org/repos/trunk/src
# '''build the src tree'''
+
</pre>
 +
</li>
 +
<li> 5. '''build the src tree'''
 +
<pre>
 
   cd /home/user/halld/src
 
   cd /home/user/halld/src
 
   make LOCAL_HALLD_HOME=1
 
   make LOCAL_HALLD_HOME=1
 
+
</pre>
 +
</li>
 +
</ul>
 
Note: the LOCAL_HALLD_HOME variable will force make to use to set HALLD_HOME and HALLD_MY to be consistent with this local src directory. Other definitions of these variables will be ignored.
 
Note: the LOCAL_HALLD_HOME variable will force make to use to set HALLD_HOME and HALLD_MY to be consistent with this local src directory. Other definitions of these variables will be ignored.
  
Now some of you may not be able to get all of your stuff checked in and want preserve the working version you have already checked out. That is OK as long as you can stand to do upgrade to the latest version in situ. In that case, you replace step 4 above with the following
+
==Update current working version, re-build==
 +
 
 +
Now some of you may not be able to get all of your stuff checked in and want preserve the working version you have already checked out. That is OK as long as you can stand to upgrade to the latest version in situ. In that case, you replace step 4 above with the following
  
# '''update the src tree'''
+
<ul>
 +
<li> 4a. '''update the src tree'''
 +
<pre>
 
   cd /home/user/halld/src
 
   cd /home/user/halld/src
 
   svn update
 
   svn update
# '''get rid of old files left over from the old system:'''
+
</pre>
 +
</li>
 +
<li> 4b. '''get rid of old files left over from the old system:'''
 +
<pre>
 
   rm \
 
   rm \
 
   /home/user/halld/src/programs/Simulation/HDGeant/hddsGeant3.F \
 
   /home/user/halld/src/programs/Simulation/HDGeant/hddsGeant3.F \
Line 46: Line 82:
 
   /home/user/halld/src/libraries/HDGEOMETRY/hddsroot.h \
 
   /home/user/halld/src/libraries/HDGEOMETRY/hddsroot.h \
 
   /home/user/halld/src/programs/Simulation/hdds/hddsroot.h
 
   /home/user/halld/src/programs/Simulation/hdds/hddsroot.h
# '''clean up the old build'''
+
</pre>
 +
</li>
 +
<li> 4c. '''clean up the old build'''
 +
<pre>
 
   cd /home/user/halld/src
 
   cd /home/user/halld/src
 
   make clean
 
   make clean
 +
</pre>
 +
</li>
 +
</ul>

Revision as of 12:32, 8 December 2009

As we decided at the the October 21 Offline meeting, HDDS will be split off into a directory distinct from src. See the presentation from that meeting for a discussion of the reasons for doing this.

What changed?

  • hdds directory
    The directory trunk/src/programs/Simulation/hdds was moved to trunk/hdds. It must now be checked out and build separately from src. This eliminates the need to do a make in programs/Simulation/hdds before making the rest of src.
  • new build scheme for hdds
    The new top-level hdds creates a source directory, a libraries directory and a binaries directory.
    • bin: stores the binaries needed for source code generation
    • src: stores the "made" source code files including any include files
    • lib: stores libraries of objects compiles from files in src

    With this structure, all hdds geometry dependent programs will be able to access what they need from src and lib.

  • new environment variables
    For other programs to access src and lib, two environment variables are needed: HDDS_SRC and HDDS_LIB. Makefiles should use these to access the files they need.

Steps for using the new structure

Here are the steps you will need to follow to use the new structure. There are two scenarios described:

  1. Fresh checkout and build
  2. Update current working version, re-build

Fresh checkout and build

In the following I will assume that
(a) You want to checkout the latest version of src and that (for definiteness) you want to put it in /home/user/halld/src and that
(b) the desired location of the hdds tree is /home/user/hdds

  • 1. checkout hdds
      cd /home/user
      svn checkout https://halldsvn.jlab.org/repos/trunk/hdds
    
  • 2. build hdds BMS_OSNAME must be defined. The makefile will check that it is and will fail if it is not.
      cd /home/user/hdds
      make
    
  • 3. set-up hdds environment variables
      setenv HDDS_SRC /home/user/hdds/src
      setenv HDDS_LIB /home/user/hdds/lib/$BMS_OSNAME
    
  • 4. checkout the src tree
      cd /home/user/halld
      svn checkout https://halldsvn.jlab.org/repos/trunk/src
    
  • 5. build the src tree
      cd /home/user/halld/src
      make LOCAL_HALLD_HOME=1
    

Note: the LOCAL_HALLD_HOME variable will force make to use to set HALLD_HOME and HALLD_MY to be consistent with this local src directory. Other definitions of these variables will be ignored.

Update current working version, re-build

Now some of you may not be able to get all of your stuff checked in and want preserve the working version you have already checked out. That is OK as long as you can stand to upgrade to the latest version in situ. In that case, you replace step 4 above with the following

  • 4a. update the src tree
      cd /home/user/halld/src
      svn update
    
  • 4b. get rid of old files left over from the old system:
      rm \
      /home/user/halld/src/programs/Simulation/HDGeant/hddsGeant3.F \
      /home/user/halld/src/programs/Simulation/hdds/hddsGeant3.F \
      /home/user/halld/src/libraries/HDGEOMETRY/hddsroot.h \
      /home/user/halld/src/programs/Simulation/hdds/hddsroot.h
    
  • 4c. clean up the old build
      cd /home/user/halld/src
      make clean