Difference between revisions of "Hall D Package Manager"

From GlueXWiki
Jump to: navigation, search
(Getting it)
(Building software from source)
Line 17: Line 17:
  
 
==Building software from source==
 
==Building software from source==
On '''64-bit Linux''' or '''Mac OS X''', change to the hdpm directory and source the appropriate setup script.  
+
You can set the package installation directory by setting the GLUEX_TOP environment variable.
  
This script is for setting up the package manager, not the builds, and needs to be sourced each time a new shell is started.
+
If $GLUEX_TOP is an empty string or unset, hdpm will use the current working directory.
source setup.[c]sh
+
  
 
For help, just type ''''hdpm'''' or ''''hdpm help''''.
 
For help, just type ''''hdpm'''' or ''''hdpm help''''.
Line 27: Line 26:
 
  hdpm help [<command>]
 
  hdpm help [<command>]
  
The "master" template is automatically copied to the "settings" directory if it does not already exist, and in the absence of preexisting custom templates, "master" will be the only available template.
+
To write the default settings to the "settings" directory:
 +
hdpm select
  
Select a build template. The "master" template will be selected if no argument is given.
+
Select a package settings id. The "master"/"default" settings will be selected if no argument is given.
  hdpm select [<template-id>]
+
  hdpm select [<settings-id>]
  
Show the current build settings. Note that these arguments are optional. Column names: "version", "url", "path", "deps", and "cmds".
+
Show the current package settings. Note that these arguments are optional. Field names: "version", "url", "path", "deps", and "cmds".
  hdpm show [<column-name>] [<column-spacing>]
+
  hdpm show [<field-name>]
  
The current build settings are stored in the "settings" directory; these can be directly modified when the user wants to adjust their settings.  
+
The current package settings are stored in the "settings" directory; these can be directly modified when the user wants to adjust their settings.  
  
Use the "v-xml" command to change the versions to versions specified in a '''version XML file'''.
+
To change the versions to versions specified in a '''version XML file''':
  hdpm v-xml [<xmlfile-url> | <xmlfile-path>]
+
  hdpm select --xml <xmlfile-url> | <xmlfile-path>
The current settings can be made into a template with the "save" command.  
+
The current settings can then be saved by using the "save" command.
 
+
Use it with '''jlab''' as the argument to generate and save a base template for building against group installations at JLab (after running the "v-xml" command).
+
hdpm save <template-id>
+
  
 
Checkout, clone, or download selected packages.
 
Checkout, clone, or download selected packages.
 
  hdpm fetch [<pkg>...]
 
  hdpm fetch [<pkg>...]
 +
hdpm fetch --xml <xmlfile-url> | <xmlfile-path>
  
 
Build selected packages (fetch if needed). Use with no arguments to build all packages. If a package is already built, the build time, disk use, and timestamp of when the build finished will be displayed.
 
Build selected packages (fetch if needed). Use with no arguments to build all packages. If a package is already built, the build time, disk use, and timestamp of when the build finished will be displayed.
 
  hdpm build [<pkg>...]
 
  hdpm build [<pkg>...]
  hdpm build [<template-id>]
+
  hdpm build <directory>
  hdpm build [<xmlfile-url> | <xmlfile-path>]
+
  hdpm build --xml <xmlfile-url> | <xmlfile-path>
  
 
Update selected Git/SVN packages.
 
Update selected Git/SVN packages.
Line 58: Line 56:
 
  hdpm clean [<pkg>...]  
 
  hdpm clean [<pkg>...]  
  
Do a clean build of selected packages.
+
Print/write the GlueX environment variables.
  hdpm clean-build [<pkg>...]
+
  hdpm env [<variable>]
 +
 
 +
Run a command in the GlueX offline environment.
 +
hdpm run [<cmd>]
  
 
==Installing pre-compiled software==
 
==Installing pre-compiled software==

Revision as of 18:05, 15 October 2016

hdpm is a command line tool for managing Hall-D software. It allows one to build and update Hall-D software from a single directory, and makes it easy to view and modify current package versions. The main idea is to configure package settings with a series of simple files, separating the process of scripting from configuration, and providing a mechanism to save and restore groups of package settings. Default settings are provided which have been tested for compatibility on supported platforms. The following is a relatively brief description of how to use the Hall D Package Manager (hdpm); The detailed documentation is located at the GitHub-hdpm wiki.

Getting it

You can find download links for the latest release at https://github.com/JeffersonLab/hdpm/releases.

If you are on the JLab CUE, you can find the binary releases at /group/halld/Software/hdpm.

To put hdpm version 0.2.0 in your PATH (for csh):

setenv PATH /group/halld/Software/hdpm/0.2.0/bin:$PATH

If you are not at JLab, then you need to first download and unpack it.

macOS users should replace linux with macOS in the following commands.

curl -OL https://halldweb.jlab.org/dist/hdpm/hdpm-0.2.0.linux.tar.gz
tar xf hdpm-0.2.0.linux.tar.gz
setenv PATH $PWD/hdpm-0.2.0/bin:$PATH

Building software from source

You can set the package installation directory by setting the GLUEX_TOP environment variable.

If $GLUEX_TOP is an empty string or unset, hdpm will use the current working directory.

For help, just type 'hdpm' or 'hdpm help'.

Show usage and description of command.

hdpm help [<command>]

To write the default settings to the "settings" directory:

hdpm select

Select a package settings id. The "master"/"default" settings will be selected if no argument is given.

hdpm select [<settings-id>]

Show the current package settings. Note that these arguments are optional. Field names: "version", "url", "path", "deps", and "cmds".

hdpm show [<field-name>]

The current package settings are stored in the "settings" directory; these can be directly modified when the user wants to adjust their settings.

To change the versions to versions specified in a version XML file:

hdpm select --xml <xmlfile-url> | <xmlfile-path>

The current settings can then be saved by using the "save" command.

Checkout, clone, or download selected packages.

hdpm fetch [<pkg>...]
hdpm fetch --xml <xmlfile-url> | <xmlfile-path>

Build selected packages (fetch if needed). Use with no arguments to build all packages. If a package is already built, the build time, disk use, and timestamp of when the build finished will be displayed.

hdpm build [<pkg>...]
hdpm build <directory>
hdpm build --xml <xmlfile-url> | <xmlfile-path>

Update selected Git/SVN packages.

hdpm update [<pkg>...]

Completely remove build products of selected packages.

hdpm clean [<pkg>...] 

Print/write the GlueX environment variables.

hdpm env [<variable>]

Run a command in the GlueX offline environment.

hdpm run [<cmd>]

Installing pre-compiled software

CentOS/RHEL 6/7 and Ubuntu 14.04/16.04 LTS are supported at this time.

Fetch binary distribution of sim-recon and its dependencies and install it. Use with no argument to fetch the latest available distribution. Rerun this command for updates.

hdpm install [<commit>]
hdpm install [<tarfile-url> | <tarfile-path>]

Setting environment variables

The environment setup script for hdpm is located in the relative path "env-setup".

source $GLUEX_TOP/env-setup/master.[c]sh

or for binary distribution installations:

source $GLUEX_TOP/env-setup/dist.[c]sh

These scripts are automatically generated at build time based on the configuration encoded by your package-settings files. It is not recommended to modify these environment scripts directly. Instead, if needed, one can make an additional environment script which modifies some of the environment variables, and source it after sourcing the main one.