Skip to content
Snippets Groups Projects
Commit afc23461 authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

Init commit

parents
Branches
Tags
No related merge requests found
Showing
with 993 additions and 0 deletions
# Compiled Object files
*.slo
*.lo
*.o
# Compiled Dynamic libraries
*.so
*.dylib
# Compiled Static libraries
*.lai
*.la
*.a
# build trees
DEBUG*/*
BUILD*/*
RELEASE*/*
TEST*/*
# cmake
CMakeCache.txt
CMakeFiles
Makefile
cmake_install.cmake
install_manifest.txt
# vim
~*
*.swp
*.swo
# python
__pycache__/
*.py[cod]
*$py.class
.ipynb_checkpoints
image: eicweb.phy.anl.gov:4567/containers/image_recipes/root_base:latest
#
stages:
- phase1
- phase2
eic_docker:
stage: phase1
tags:
- eic0 docker
script:
- cd containers/docker
- make login
- make release
eic_singularity:
stage: phase2
tags:
- singularity
script:
- cp containers/singularity/eic.def .
- /bin/bash .gitlabci/setup.sh
- /bin/bash .gitlabci/build.sh eic.def
- mkdir -p build
- cp eic.sif build/.
- cp eic.def build/.
# This is where you can save job artifacts
# https://docs.gitlab.com/ee/user/project/pipelines/job_artifacts.html
# You can specify the path to containers or the build folder to save.
# Don't forget to save your recipes too!
artifacts:
paths:
- build/eic.sif
- build/eic.def
#!/bin/bash
# build.sh will build a Singularity container. It's not overly complicated.
#
# USAGE: build.sh --uri collection-name/container-name --cli registry Singularity
# build.sh --uri collection-name/container-name --cli registry
# build.sh Singularity
# Copyright (C) 2017-2018 Vanessa Sochat.
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
set -o errexit
set -o nounset
function usage() {
echo "USAGE: build [recipe] [options]"
echo ""
echo "OPTIONS:
Image Format
--uri -u if uploading, a uri to give to sregistry
--cli -c the sregistry client to use (if uploading)
--help -h show this help and exit
"
}
# --- Option processing --------------------------------------------------------
uri=""
cli=""
tag=""
while true; do
case ${1:-} in
-h|--help|help)
usage
exit 0
;;
-u|-uri)
shift
uri="${1:-}"
shift
;;
-t|--tag)
shift
tag="${1:-}"
shift
;;
-c|--cli)
shift
cli="${1:-}"
shift
;;
\?) printf "illegal option: -%s\n" "${1:-}" >&2
usage
exit 1
;;
-*)
printf "illegal option: -%s\n" "${1:-}" >&2
usage
exit 1
;;
*)
break;
;;
esac
done
################################################################################
### Recipe File ################################################################
################################################################################
if [ $# == 0 ] ; then
recipe="Singularity"
else
recipe=$1
fi
echo ""
echo "Image Recipe: ${recipe}"
################################################################################
### Storage Client #############################################################
################################################################################
is_valid_client () {
local e match="$1"
shift
for e; do [[ "$e" == "$match" ]] && return 0; done
return 1
}
# Test if client is valid
clients=("google-storage" "registry" "globus" "dropbox" "google-drive")
if [ "${cli}" != "" ]; then
is_valid_client "${cli}" "${clients[@]}"
if [ $? -ne 0 ]; then
echo "${cli} is not a valid choice! Choose from ${clients[@]}";
exit 1
fi
echo "Storage Client: ${cli}"
else
echo "Storage Client: none"
fi
################################################################################
### Build! #####################################################################
################################################################################
# Continue if the image recipe is found
if [ -f "$recipe" ]; then
imagefile="`basename ${recipe} .def`.sif"
echo "Creating $imagefile using $recipe..."
singularity build $imagefile $recipe
# If the image is successfully built, test it and upload (examples)
if [ -f "${imagefile}" ]; then
# Example testing using run (you could also use test command)
echo "Testing the image... Marco!"
singularity exec $imagefile echo "Polo!"
# Example sregistry commands to push to endpoints
if [ "${cli}" != "" ]; then
# If the uri isn't provided, he gets a robot name
if [ "${uri}" == "" ]; then
uri=$(python -c "from sregistry.logger.namer import RobotNamer; bot=RobotNamer(); print(bot.generate())")
fi
# If a tag is provided, add to uri
if [ "${tag}" != "" ]; then
uri="${uri}:${tag}"
fi
echo "Pushing ${uri} to ${cli}://"
echo "SREGISTRY_CLIENT=${cli} sregistry push --name ${uri} ${imagefile}"
SREGISTRY_CLIENT="${cli}" sregistry push --name "${uri}" "${imagefile}"
else
echo "Skipping upload. Image $imagefile is finished!"
fi
fi
else
echo "Singularity recipe ${recipe} not found!"
exit 1
fi
#!/bin/bash
apt-get update && apt-get install -y wget git \
build-essential \
squashfs-tools \
libtool \
autotools-dev \
libarchive-dev \
automake \
autoconf \
uuid-dev \
libssl-dev \
python-pip
## Somehow sed cant find /etc/sudoers
#sed -i -e 's/^Defaults\tsecure_path.*$//' /etc/sudoers
# Check Python
echo "Python Version:"
python --version
pip install sregistry[all]
sregistry version
echo "sregistry Version:"
# Install Singularity
cd /tmp && \
rm -rf singularity && \
git clone -b vault/release-2.5 https://www.github.com/sylabs/singularity.git
cd singularity && \
./autogen.sh && \
./configure --prefix=/usr/local && \
make -j8 && make install
.gitlabci/sregistry-gitlab.png

37.4 KiB

File added
## CMake project file for hallac_container
################################################################################
## PROJECT: hallac_container
################################################################################
cmake_minimum_required (VERSION 3.8)
project (eic_container VERSION 1.6.7)
################################################################################
## The name of our container
################################################################################
set(CONTAINER eic-${PROJECT_VERSION}.sif)
################################################################################
## CMAKE Settings
################################################################################
include(cmake/options.cmake)
################################################################################
## Subdirectories
################################################################################
add_subdirectory(containers)
add_subdirectory(modulefiles)
add_subdirectory(scripts)
EIC software container
============================================
Installation
-----------
1. Checkout the repository and create a build directory
```
git clone https://eicweb.phy.anl.gov/containers/eic_containers.git
cd eic_containers && mkdir BUILD && cd BUILD
```
2. Configure the install for your environment, providing the appropriate `prefix` and
`module_dir` you want to use.
```
cmake .. -DCMAKE_INSTALL_PREFIX=<prefix> -DINSTALL_MODULE_DIR=<module_dir>
```
3. Download the container and install.
```
make install
```
4. To use the container: load the modulefile, and then use the included apps as if
they are native to your system!
```
module load eic_container
```
################################################################################
## CMAKE Settings
################################################################################
## make sure that the default is RELEASE
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo."
FORCE)
endif ()
## Offer the user the choice of overriding the installation directories
set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
set(INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
set(INSTALL_INCLUDE_DIR include/${PROJECT_NAME} CACHE PATH "Installation directory for header files")
set(INSTALL_MODULE_DIR ${CMAKE_INSTALL_PREFIX}/../../etc/modulefiles CACHE PATH "Installation directory for module files")
set(INSTALL_BIND_PATH "/net" "/group" "/cache" "/work" "/volatile" CACHE PATH "Installation singularity bind path")
if(WIN32 AND NOT CYGWIN)
set(DEF_INSTALL_CMAKE_DIR cmake)
else()
set(DEF_INSTALL_CMAKE_DIR lib/cmake/${PROJECT_NAME})
endif()
set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH
"Installation directory for cmake files")
## Make relative paths absolute (useful when auto-generating cmake configuration
## files) Note: not including INSTALL_BIND_PATH on purpose as we should be giving absolute
## paths anyway
foreach(p LIB BIN INCLUDE CMAKE MODULE)
set(var INSTALL_${p}_DIR)
if(NOT IS_ABSOLUTE "${${var}}")
set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
endif()
endforeach()
## extra cmake modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
"${PROJECT_SOURCE_DIR}/cmake/")
################################################################################
## Download the container
################################################################################
set(CONTAINER_SOURCE
"https://eicweb.phy.anl.gov/containers/eic_container/-/jobs/artifacts/v${PROJECT_VERSION}/raw/build/eic.sif?job=eic_singularity")
add_custom_command(OUTPUT ${CONTAINER}
COMMAND wget ${CONTAINER_SOURCE} -O ${CONTAINER}
COMMENT "Downloading ${CONTAINER}"
)
################################################################################
## Global target
################################################################################
add_custom_target(container ALL
DEPENDS ${CONTAINER})
################################################################################
## Install the container to <prefix>/lib
################################################################################
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CONTAINER}
DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib)
FROM eicweb.phy.anl.gov:4567/containers/image_recipes/dd4hep_base:latest
LABEL maintainer="Whitney Armstrong <warmstrong@anl.gov>" \
name="eic_container" \
group="containers/eic_containers" \
march="native" \
basedist="ubuntu" \
base="dd4hep_base"
ENV EPICS_ROOT="/usr/local/epics" \
EPICS_BASE="/usr/local/epics/base" \
PYTHONPATH="/usr/local/lib:${PYTHONPATH}" \
EPICS_HOST_ARCH="linux-x86_64" \
PATH="${EPICS_ROOT}/bin:${EPICS_ROOT}/bin/${EPICS_HOST_ARCH}:${PATH}:" \
LD_LIBRARY_PATH="${EPICS_ROOT}/lib:${EPICS_BASE}/bin/${EPICS_HOST_ARCH}:${LD_LIBRARY_PATH}"
#RUN source /usr/local/bin/thisroot.sh \
# && echo " -------------------------------------------------" \
# && echo " 0. Installing project dependencies" \
# && echo " -------------------------------------------------" \
# && apt-get install libtbb-dev libtbb2 \
# && sed -i 's/\/tmp\/builds\/root_build\/lib\/libtbb.so/\/usr\/local\/lib\/libtbb.so/g' \
# /usr/local/cmake/ROOTConfig-targets.cmake \
# && echo " -------------------------------------------------" \
# && echo " 1. Installing project library: libfmt" \
# && echo " -------------------------------------------------" \
# && echo " spdlog now in base image"
#
#RUN echo " -------------------------------------------------" \
# && echo " 2. Installing project library: nlohmann/json" \
# && echo " -------------------------------------------------" \
# && source /usr/local/bin/thisroot.sh \
# && echo " -------------------------------------------------" \
# && echo " 3. Installing: eic/EVIO" \
# && echo " -------------------------------------------------" \
# && cd /tmp \
# && git clone https://eicweb.phy.anl.gov/jlab/hallc/analyzer_software/eic_evio.git \
# && cd eic_evio && git checkout v4.4.6 \
# && mkdir build && cd build \
# && cmake ../. && make -j20 && make install \
# && cd /tmp && rm -rf eic_evio \
# && echo " -------------------------------------------------" \
# && echo " 4. Installing: Coda/ET" \
# && echo " -------------------------------------------------" \
# && cd /tmp \
# && git clone https://eicweb.phy.anl.gov/jlab/coda/et.git \
# && cd et && git checkout v12.0.1 \
# && mkdir build && cd build \
# && cmake ../. -DINSTALL_LMOD_FILES=OFF && make -j20 && make install \
# && cd /tmp && rm -rf et
#
#RUN echo " -------------------------------------------------" \
# && echo " 5. Installing: Podd" \
# && echo " -------------------------------------------------" \
# && cd /tmp \
# && ls -lrth /usr/local/lib/cmake/* \
# && ls -lrth /usr/local/lib/cmake/spdlog * \
# && git clone https://eicweb.phy.anl.gov/jlab/hallc/analyzer_software/analyzer.git \
# && cd analyzer && git checkout v1.8.2 \
# && mkdir build && cd build \
# && cmake ../. && make -j20 && make install \
# && cd /tmp && rm -rf analyzer
#
#RUN echo " -------------------------------------------------" \
# && echo " 6. Installing: hcana" \
# && echo " -------------------------------------------------" \
# && source /usr/local/bin/thisroot.sh \
# && cd /tmp && rm -rf hcana \
# && git clone https://eicweb.phy.anl.gov/jlab/hallc/analyzer_software/hcana.git \
# && cd hcana && git checkout v1.2.0 \
# && mkdir build && cd build \
# && cmake ../. && make -j20 && make install \
# && cd /tmp && rm -rf hcana \
# && echo " -------------------------------------------------" \
# && echo " 7. Installing: hconline" \
# && echo " -------------------------------------------------" \
# && cd /tmp && rm -rf hconline \
# && git clone https://eicweb.phy.anl.gov/jlab/hallc/analyzer_software/hconline.git \
# && cd hconline && git checkout v1.1.7 \
# && mkdir build && cd build \
# && cmake ../. && make -j20 && make install \
# && cd /tmp && rm -rf hconline
#
#RUN cd /tmp \
# && echo " -------------------------------------------------" \
# && echo " 8. Installing: hallc_tools" \
# && echo " -------------------------------------------------" \
# && cd /tmp \
# && git clone --depth=1 --branch 0.9.1 https://github.com/ericniebler/range-v3.git \
# && mkdir -p range-v3/build && cd range-v3/build \
# && cmake ../. -DRANGE_V3_PERF=OFF -DRANGE_BUILD_CALENDAR_EXAMPLE=OFF \
# -DBUILD_TESTING=OFF -DRANGE_V3_EXAMPLES=OFF \
# -DRANGE_V3_TESTS=OFF -DRANGE_V3_DOCS=OFF \
# -DRANGES_CXX_STD=17 \
# && make -j8 install \
# && cd /tmp && rm -r range-v3 \
# && git clone https://eicweb.phy.anl.gov/jlab/hallc/analyzer_software/hallc_tools.git \
# && cd hallc_tools && git checkout v1.1.9 \
# && mkdir build && cd build \
# && cmake ../. && make -j20 && make install \
# && cd /tmp && rm -rf hallc_tools \
# && echo " -------------------------------------------------" \
# && echo " 10. Slimming down image" \
# && echo " -------------------------------------------------" \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/* \
# && echo " -------------------------------------------------"
#
## && echo " 9. Installing: simc" \
## && echo " -------------------------------------------------" \
## && cd /tmp
## git clone --recurse-submodules https://eicweb.phy.anl.gov/jlab/hallc/simulation/simc-file-input.git \
## && cd simc-file-input && git checkout v1.0.0 && cd - \
## mkdir build && cd build && cmake ../simc-file-input && make -j4 install \
## cd /tmp && rm -rf build simc-file-input \
## echo " -------------------------------------------------" \
## echo " ===> Image setup complete" \
## echo " -------------------------------------------------" \
REG_TOKEN ?= ${CI_IMAGE_BUILD_PAT}
REG_USER ?= whit
REG_HOST ?= eicweb.phy.anl.gov
REG_NAME ?= eicweb.phy.anl.gov:4567
REG_PORT ?= 4567
REG_URL ?= https://$(REG_HOST)
# name of alternate build:
# Dockerfile.$(ALT_NAME) --> $(APP_NAME)_${ALT_NAME}
ALT_NAME ?= broadwell
APP_NAME = eic_container
REPO_NAME = eic_container
DH_ORG = eic
GL_GROUP = eic_container
GL_REG_GROUP = containers/eic_container
GL_REG_NAME = $(REG_NAME)
REPO = $(REG_USER)
TAG_VERSION = latest
# INSTALL
# - copy the files deploy.env, config.env, version.sh and Makefile to your repo
# - replace the vars in deploy.env
# - define the version script
# Build the container
make build
# Build and publish the container
make release
# Publish a container to AWS-ECR.
# This includes the login to the repo
make publish
# Run the container
make run
# Build an run the container
make up
# Stop the running container
make stop
# Build the container with differnt config and deploy file
make cnf=another_config.env dpl=another_deploy.env build
\ No newline at end of file
#!/bin/bash
grep "hallac_container VERSION" ../../CMakeLists.txt | sed 's/project (hallac_container VERSION //' | sed 's/)//'
Bootstrap: docker
From: eicweb.phy.anl.gov:4567/containers/eic_container/eic_container:latest
%help
EIC software container.
Tools:
- root : root version used for the analyzer
- rootls, rootbrowse, root-config, hadd, h2root
- dd4hep
%labels
Maintainer "Whitney Armstrong"
Version v1.0
%post -c /bin/bash
#export PYTHONPATH=/usr/local/lib:$PYTHONPATH
#export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
#export PATH=/usr/local/bin:$PATH
#source /usr/local/bin/thisroot.sh
#echo " -------------------------------------------------"
#echo " 0. Installing project dependencies"
#echo " -------------------------------------------------"
#apt-get install libtbb-dev libtbb2
### this line fixes the ROOT cmake TBB bug
#sed -i 's/\/tmp\/builds\/root_build\/lib\/libtbb.so/\/usr\/local\/lib\/libtbb.so/g' /usr/local/cmake/ROOTConfig-targets.cmake
#export EPICS_ROOT=/usr/local/epics
#export EPICS_BASE=/usr/local/epics/base
#export EPICS_HOST_ARCH=linux-x86_64
#export PATH=$EPICS_ROOT/bin:$PATH
#export LD_LIBRARY_PATH=$EPICS_ROOT/lib:$LD_LIBRARY_PATH
#export PATH=$EPICS_BASE/bin/$EPICS_HOST_ARCH:$PATH
#export LD_LIBRARY_PATH=$EPICS_BASE/lib/$EPICS_HOST_ARCH:$LD_LIBRARY_PATH
#echo " -------------------------------------------------"
#echo " 1. Installing project library: libfmt"
#echo " -------------------------------------------------"
#cd /tmp
#git clone https://github.com/fmtlib/fmt.git && cd fmt && \
# git checkout 5.3.0 && mkdir /tmp/build && cd /tmp/build && \
# cmake -DBUILD_SHARED_LIBS=TRUE ../fmt &&
# make -j20 install
#cd /tmp && rm -r /tmp/build && rm -r /tmp/fmt
#echo " -------------------------------------------------"
#echo " 2. Installing project library: nlohmann/json"
#echo " -------------------------------------------------"
#apt-get install nlohmann-json-dev
#echo " -------------------------------------------------"
#echo " 3. Installing: eic/EVIO"
#echo " -------------------------------------------------"
#cd /tmp
#git clone https://eicweb.phy.anl.gov/jlab/hallc/analyzer_software/eic_evio.git \
# && cd eic_evio && git checkout v4.4.6 \
# && mkdir build && cd build \
# && cmake ../. && make -j20 && make install
#cd /tmp && rm -rf eic_evio
#echo " -------------------------------------------------"
#echo " 4. Installing: Coda/ET"
#echo " -------------------------------------------------"
#cd /tmp
#git clone https://eicweb.phy.anl.gov/jlab/coda/et.git \
# && cd et && git checkout v12.0.1 \
# && mkdir build && cd build \
# && cmake ../. -DINSTALL_LMOD_FILES=OFF && make -j20 && make install
#cd /tmp && rm -rf et
#echo " -------------------------------------------------"
#echo " 5. Installing: Podd"
#echo " -------------------------------------------------"
#cd /tmp
#git clone https://eicweb.phy.anl.gov/jlab/hallc/analyzer_software/analyzer.git \
# && cd analyzer && git checkout v1.8.2 \
# && mkdir build && cd build \
# && cmake ../. && make -j20 && make install
#cd /tmp && rm -rf analyzer
#echo " -------------------------------------------------"
#echo " 6. Installing: hcana"
#echo " -------------------------------------------------"
#cd /tmp && rm -rf hcana
#git clone https://eicweb.phy.anl.gov/jlab/hallc/analyzer_software/hcana.git \
# && cd hcana && git checkout v1.1.9 \
# && mkdir build && cd build \
# && cmake ../. && make -j20 && make install
#cd /tmp && rm -rf hcana
#echo " -------------------------------------------------"
#echo " 7. Installing: hconline"
#echo " -------------------------------------------------"
#cd /tmp && rm -rf hconline
#git clone https://eicweb.phy.anl.gov/jlab/hallc/analyzer_software/hconline.git \
# && cd hconline && git checkout v1.1.5 \
# && mkdir build && cd build \
# && cmake ../. && make -j20 && make install
#cd /tmp && rm -rf hconline
#echo " -------------------------------------------------"
#echo " 8. Installing: hallc_tools"
#echo " -------------------------------------------------"
#cd /tmp && rm -rf hallc_tools
#git clone https://eicweb.phy.anl.gov/jlab/hallc/analyzer_software/hallc_tools.git \
# && cd hallc_tools && git checkout v1.0.0 \
# && mkdir build && cd build \
# && cmake ../. && make -j20 && make install
#cd /tmp && rm -rf hallc_tools
#echo " -------------------------------------------------"
#echo " 9. Installing: simc"
#echo " -------------------------------------------------"
#cd /tmp
#git clone --recurse-submodules https://eicweb.phy.anl.gov/jlab/hallc/simulation/simc-file-input.git \
# && cd simc-file-input && git checkout v1.0.0 && cd - \
# mkdir build && cd build && cmake ../simc-file-input && make -j4 install
#cd /tmp && rm -rf build simc-file-input
#echo " -------------------------------------------------"
#echo " 10. Slimming down image"
#echo " -------------------------------------------------"
#apt-get clean
#rm -rf /var/lib/apt/lists/*
echo " Image build is now mostly done in dockerfile"
echo " -------------------------------------------------"
echo " ===> Image setup complete"
echo " -------------------------------------------------"
# ===================================
# GLOBAL
# ===================================
%environment -c /bin/bash
export PYTHONPATH=/usr/local/lib:$PYTHONPATH
export PATH=/usr/loca/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/usr/local/include
export EPICS_ROOT=/usr/local/epics
export EPICS_BASE=/usr/local/epics/base
export EPICS_HOST_ARCH=linux-x86_64
export PATH=$EPICS_ROOT/bin:$PATH
export LD_LIBRARY_PATH=$EPICS_ROOT/lib:$LD_LIBRARY_PATH
export PATH=$EPICS_BASE/bin/$EPICS_HOST_ARCH:$PATH
export LD_LIBRARY_PATH=$EPICS_BASE/lib/$EPICS_HOST_ARCH:$LD_LIBRARY_PATH
%runscript
echo "Launching a shell in the Hall A/C container."
echo "Use through singularity apps recommended (see help for more info)."
exec bash
# ===================================
# SIMC
# ===================================
%apprun simc
simc "%@"
%appenv simc
export PYTHONPATH=/usr/local/lib:$PYTHONPATH
export PATH=/usr/loca/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/usr/local/include
# =======================
# root
# =======================
%apprun root
root "$@"
%appenv root
export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
export PATH=/usr/local/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana
export EPICS_ROOT=/usr/local/epics
export EPICS_BASE=/usr/local/epics/base
export EPICS_HOST_ARCH=linux-x86_64
export PATH=$EPICS_ROOT/bin:$PATH
export LD_LIBRARY_PATH=$EPICS_ROOT/lib:$LD_LIBRARY_PATH
export PATH=$EPICS_BASE/bin/$EPICS_HOST_ARCH:$PATH
export LD_LIBRARY_PATH=$EPICS_BASE/lib/$EPICS_HOST_ARCH:$LD_LIBRARY_PATH
# =======================
# analyzer
# =======================
%apprun analyzer
analyzer "$@"
%appenv analyzer
export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
export PATH=/usr/local/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana
export EPICS_ROOT=/usr/local/epics
export EPICS_BASE=/usr/local/epics/base
export EPICS_HOST_ARCH=linux-x86_64
export PATH=$EPICS_ROOT/bin:$PATH
export LD_LIBRARY_PATH=$EPICS_ROOT/lib:$LD_LIBRARY_PATH
export PATH=$EPICS_BASE/bin/$EPICS_HOST_ARCH:$PATH
export LD_LIBRARY_PATH=$EPICS_BASE/lib/$EPICS_HOST_ARCH:$LD_LIBRARY_PATH
# =======================
# hcana
# =======================
%apphelp hcana
Run the Hall-C analyzer with same root-style arguments.
%apprun hcana
hcana "$@"
%appenv hcana
export DB_DIR=DBASE
export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
export PATH=/usr/local/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ROOTSYS=/usr/local
export ROOT_INCLUDE_PATH=/usr/local/include
export EPICS_ROOT=/usr/local/epics
export EPICS_BASE=/usr/local/epics/base
export EPICS_HOST_ARCH=linux-x86_64
export PATH=$EPICS_ROOT/bin:$PATH
export LD_LIBRARY_PATH=$EPICS_ROOT/lib:$LD_LIBRARY_PATH
export PATH=$EPICS_BASE/bin/$EPICS_HOST_ARCH:$PATH
export LD_LIBRARY_PATH=$EPICS_BASE/lib/$EPICS_HOST_ARCH:$LD_LIBRARY_PATH
# =======================
# root-config
# =======================
%apprun root-config
root-config "$@"
%appenv root-config
export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
export PATH=/usr/local/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana
# =======================
# rootbrowse
# =======================
%apprun rootbrowse
rootbrowse "$@"
%appenv rootbrowse
export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
export PATH=/usr/local/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana
# =======================
# rootls
# =======================
%apprun rootls
rootls "$@"
%appenv rootls
export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
export PATH=/usr/local/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana
# =======================
# hadd
# =======================
%apprun hadd
hadd "$@"
%appenv hadd
export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
export PATH=/usr/local/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana
# =======================
# h2root
# =======================
%apprun h2root
h2root "$@"
%appenv h2root
export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
export PATH=/usr/local/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana
# =======================
# xml2evio
# =======================
%apprun xml2evio
xml2evio "$@"
%appenv xml2evio
export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
export PATH=/usr/local/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana
# =======================
# evio2xml
# =======================
%apprun evio2xml
evio2xml "$@"
%appenv evio2xml
export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
export PATH=/usr/local/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana
# =======================
# evioCat
# =======================
%apprun evioCat
evioCat "$@"
%appenv evioCat
export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
export PATH=/usr/local/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana
# =======================
# eviocopy
# =======================
%apprun eviocopy
eviocopy "$@"
%appenv eviocopy
export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
export PATH=/usr/local/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana
################################################################################
## Configure modulefile for our environment
################################################################################
set(MODULEFILE "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
configure_file(modulefile.in ${MODULEFILE} @ONLY)
################################################################################
## Install the modulefile to <install_module_dir>/<project>/<version>
################################################################################
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${MODULEFILE}
DESTINATION "${INSTALL_MODULE_DIR}/${PROJECT_NAME}" COMPONENT lib)
#%Module1.0#####################################################################
##
## for tmux
##
proc ModulesHelp { } {
puts stderr "This module sets up the environment for the EIC container"
}
module-whatis "@PROJECT_NAME@ @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@"
# for Tcl script use only
set version 4.1.4
set iprefix @CMAKE_INSTALL_PREFIX@
prepend-path PATH $iprefix/bin
################################################################################
## Configure launcher scripts for our singularity apps
################################################################################
set(APPS
"analyzer"
"evio2xml"
"evioCat"
"eviocopy"
"hcana"
"root"
"root-config"
"rootbrowse"
"rootls"
"xml2evio"
"et_feeder"
"et_consumer"
"et_producer"
"hc_display_server"
"hc_spec"
"softIoc"
"softIocPVA"
"caget"
"caput"
"pvput"
"pvget"
"camonitor"
"pvmonitor"
"mongo"
"mongod"
"mongodump"
"mongoexport"
"mongoimport"
"mongostat"
)
set(APPS_ABSOLUTE_PATH "")
## Bind directive for known systems
set (OPT_BIND_DIRECTIVE "")
foreach(BIND_PATH ${INSTALL_BIND_PATH})
if (NOT "${BIND_PATH} " EQUAL " " AND EXISTS ${BIND_PATH})
set (OPT_BIND_DIRECTIVE "${OPT_BIND_DIRECTIVE} -B ${BIND_PATH}:${BIND_PATH} ")
endif ()
endforeach()
message("Adding singularity bind directive: '${OPT_BIND_DIRECTIVE}'")
find_program(SINGULARITY singularity)
foreach(APP ${APPS})
configure_file(launcher.in ${APP} @ONLY)
set(APPS_ABSOLUTE_PATH ${APPS_ABSOLUTE_PATH} "${CMAKE_CURRENT_BINARY_DIR}/${APP}")
endforeach ()
################################################################################
## Install the launcher scripts to <prefix>/bin
################################################################################
install(PROGRAMS ${APPS_ABSOLUTE_PATH}
DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin)
#!/bin/bash
piped_args=
if [ -p /dev/stdin ]; then
# If we want to read the input line by line
while IFS= read line; do
#echo "Line: ${line}"
if [ -z "$piped_args" ]; then
piped_args="${line}"
else
piped_args="${piped_args}\n${line}"
fi
done
fi
if [ ${piped_args} ] ; then
echo -e ${piped_args} | @SINGULARITY@ exec @OPT_BIND_DIRECTIVE@@INSTALL_LIB_DIR@/@CONTAINER@ @APP@ $@
else
@SINGULARITY@ exec @OPT_BIND_DIRECTIVE@@INSTALL_LIB_DIR@/@CONTAINER@ @APP@ $@
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment