Hall D Package Manager

From GlueXWiki
Revision as of 15:26, 26 May 2016 by Nsparks (Talk | contribs) (Setting up the environment to run/develop the software)

Jump to: navigation, search

This is a set of scripts with a unified user interface 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 builds with a series of simple text files, separating the process of scripting from configuration, and providing templates for future builds. The configuration text files are meant to be general enough so that the user will never need to modify any of the source scripts. Secondly, an effort is made to minimize the number of lines a user will need to modify in order to (re)configure a build; the scripts recognize certain variables, such as [VER] for version number to make this possible. A "master" template is provided along with tools for generating custom templates from it. 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

git clone https://github.com/JeffersonLab/hdpm

Building software from source

On 64-bit Linux or Mac OS X, change to the hdpm directory and source the appropriate setup script.

This script is for setting up the package manager, not the builds, and needs to be sourced each time a new shell is started.

source setup.[c]sh

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

Show usage and description of 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.

Select a build template. The "master" template will be selected if no argument is given.

hdpm select [<template-id>]

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

hdpm show [<column-name>] [<column-spacing>]

The current build 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.

hdpm v-xml [<xmlfile-url> | <xmlfile-path>]

The current settings can be made into a template with 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.

hdpm fetch [<pkg>...]

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 [<template-id>]
hdpm build [<xmlfile-url> | <xmlfile-path>]

Update selected Git/SVN packages.

hdpm update [<pkg>...]

Completely remove build products of selected packages.

hdpm clean [<pkg>...] 

Do a clean build of selected packages.

hdpm clean-build [<pkg>...]

Installing pre-compiled software

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

First, source the appropriate package manager setup script for your platform as indicated in the previous section.

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 up the environment to run/develop the software

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

source <path_to_hdpm>/pkgs/env-setup/master.[c]sh

or for binary distribution installations:

source <path_to_hdpm>/pkgs/env-setup/dist.[c]sh

These scripts are automatically generated at build time based on the configuration encoded by your build-settings text files, which specify the top directory, package paths and versions. 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.