Skip to content

Commit

Permalink
feat: HIPO submodule and installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Sep 24, 2024
1 parent 592c052 commit bbf30e8
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 27 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,8 @@ jobs:
run: |
mkdir -p $HIPO
- name: checkout hipo
uses: actions/checkout@v4
with:
repository: gavalian/hipo
ref: 20094876df040ec234dd376fa527cf58442b775a
path: hipo_src

- name: build hipo
run: |
meson setup hipo_build hipo_src --prefix=$HIPO
meson install -C hipo_build
run: ./installHIPO $HIPO

- name: build ccdb
run: |
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ hipo4
lib
man

# dependency installations
##############
/hipo

# hipo source
##############
ExtraPackages/rhipo/chipo/
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "ccdb"]
path = ccdb
url = https://github.com/baltzell/ccdb.git
[submodule "hipo_src"]
path = hipo_src
url = https://github.com/gavalian/hipo.git
22 changes: 5 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,14 @@ Data Analysis Tools for hipo4 data format.

Examples are given for running in interactive ROOT sessions and ROOT-Jupyter notebooks.


## Clas12Banks -> Clas12Root

We now use an external hipo4 repository. This must be pointed at with the variable HIPO when installing. The files from hipo/hipo4 will be copied here to Hipo4.


A default hipo implementation is now packed with clas12root. If you prefer to use this do not set the enviroment variable HIPO. If you would like to use a different version of the hipo library set HIPO. You may get the most up to data hipo library from


For Hipo library see https://github.com/gavalian/hipo

## New : from version 1.9.0 an external hipo install is required before building clas12root

git clone --recurse-submodules https://github.com/gavalian/hipo
cd hipo/
git checkout 4.1.0
cmake -DCMAKE_INSTALL_PREFIX=$PWD/
cmake --build . --target install
We now use an external hipo4 repository. This must be pointed at with the environment variable `HIPO` when installing.

For convenience, the hipo4 source code is included here in `hipo_src/` as a submodule, and you may compile and install it with `./installHIPO`;
the default installation location is the top-level directory `hipo/`.

The environment variable HIPO must be set to the path of the hipo install.
You may get the most up to data hipo library from <https://github.com/gavalian/hipo>

## Clas12Banks and Clas12Root

Expand Down
1 change: 1 addition & 0 deletions hipo_src
Submodule hipo_src added at 200948
35 changes: 35 additions & 0 deletions installHIPO
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# install HIPO locally

set -eou pipefail

# set the installation prefix: the default is clas12root/hipo, and it may be overriden by user argument
top_dir=$(cd $(dirname ${BASH_SOURCE[0]:-$0}) && pwd -P)
[ $# -ge 1 ] && prefix=$1 || prefix=$top_dir/hipo

# check for meson and ninja
if ! type meson; then
echo "ERROR: 'meson' is needed to build HIPO; you can install it with your package manager or with 'pip'." >&2
exit 1
fi
if ! type ninja; then
echo "WARNING: 'ninja' may be needed for 'meson', unless you prefer a different default backend; building HIPO may fail." >&2
fi

# compile and install
source_dir=$top_dir/hipo_src
build_dir=$source_dir/build
echo """==================================================================================
source directory: $source_dir
build directory: $build_dir
installation directory: $prefix
==================================================================================
"""
meson setup --wipe $build_dir $source_dir --prefix=$prefix # use --wipe to force a 'clean' build
meson install -C $build_dir
echo """==================================================================================
Done installing HIPO.
You may now set your environment to point to this installation:
- for bash or zsh: export HIPO=$prefix
- for csh or tcsh: setenv HIPO $prefix
"""

0 comments on commit bbf30e8

Please sign in to comment.