Skip to content
Snippets Groups Projects
Commit e5f3bf54 authored by Dmitry Kalinkin's avatar Dmitry Kalinkin
Browse files

add bin/build_eicrecon.sh (like the build_detector.sh)

parent 743ccd6b
No related branches found
No related tags found
1 merge request!72Draft: add bin/build_eicrecon.sh (like the build_detector.sh)
...@@ -69,6 +69,15 @@ common:detector: ...@@ -69,6 +69,15 @@ common:detector:
- print_env.sh - print_env.sh
- ls -lrth - ls -lrth
common:eicrecon:
stage: initialize
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
needs: ["common:setup"]
script:
- source .local/bin/env.sh && build_eicrecon.sh
detector_benchmarks: detector_benchmarks:
stage: benchmarks stage: benchmarks
rules: rules:
...@@ -85,7 +94,9 @@ detector_benchmarks: ...@@ -85,7 +94,9 @@ detector_benchmarks:
DETECTOR_CONFIG: 'epic_arches' DETECTOR_CONFIG: 'epic_arches'
DETECTOR_VERSION: 'main' DETECTOR_VERSION: 'main'
DETECTOR_REPOSITORYURL: 'https://github.com/eic/epic.git' DETECTOR_REPOSITORYURL: 'https://github.com/eic/epic.git'
EICRECON_REPOSITORYURL: 'https://github.com/eic/EICrecon.git'
- DETECTOR: 'epic' - DETECTOR: 'epic'
DETECTOR_CONFIG: 'epic_brycecanyon' DETECTOR_CONFIG: 'epic_brycecanyon'
DETECTOR_VERSION: 'main' DETECTOR_VERSION: 'main'
DETECTOR_REPOSITORYURL: 'https://github.com/eic/epic.git' DETECTOR_REPOSITORYURL: 'https://github.com/eic/epic.git'
EICRECON_REPOSITORYURL: 'https://github.com/eic/EICrecon.git'
#!/bin/bash
## =============================================================================
## Build and install the EICrecon package into our local prefix
## =============================================================================
## =============================================================================
## Load the environment variables. To build the detector we need the following
## variables:
##
## - LOCAL_PREFIX: location where local packages should be installed
if [ -n "${LOCAL_PREFIX}" ] ; then
source .local/bin/env.sh
else
source ${LOCAL_PREFIX}/bin/env.sh
fi
## =============================================================================
## Step 1: download/update the detector definitions (if needed)
pushd "$(mktemp -d)"
echo "Fetching EICrecon"
if [ -n "${DETECTOR_DEPLOY_TOKEN_USERNAME:-}" -a -n "${DETECTOR_DEPLOY_TOKEN_PASSWORD:-}" ]; then
DEPLOY_TOKEN="${DETECTOR_DEPLOY_TOKEN_USERNAME}:${DETECTOR_DEPLOY_TOKEN_PASSWORD}@"
echo "Deploy token for ${DETECTOR_DEPLOY_TOKEN_USERNAME} is masked in the next line."
else
DEPLOY_TOKEN=""
fi
echo "git clone -b ${EICRECON_VERSION} --depth 1 ${EICRECON_REPOSITORYURL:-https://eicweb.phy.anl.gov/EIC/eicrecons/EICrecon.git} EICrecon"
git clone -b ${EICRECON_VERSION} --depth 1 ${EICRECON_REPOSITORYURL:-https://${DEPLOY_TOKEN}eicweb.phy.anl.gov/EIC/eicrecons/EICrecon.git} EICrecon
rm -rf "EICrecon/.git"
## =============================================================================
## Step 2: Compile and install the detector definition
echo "Building and installing the ${DETECTOR} package"
cd EICrecon
cmake -DCMAKE_INSTALL_PREFIX=${LOCAL_PREFIX} && make -j$(($(nproc)/4+1)) install || exit 1
TO_REMOVE="$PWD"
popd
rm -rf "$TO_REMOVE"
unset TO_REMOVE
## =============================================================================
## Step 3: That's all!
echo "Detector build/install complete!"
...@@ -127,6 +127,12 @@ echo "LOCAL_DATA_PATH=${LOCAL_DATA_PATH}" >> .env ...@@ -127,6 +127,12 @@ echo "LOCAL_DATA_PATH=${LOCAL_DATA_PATH}" >> .env
echo "Adding LOCAL_PREFIX to PATH and LD_LIBRARY_PATH" echo "Adding LOCAL_PREFIX to PATH and LD_LIBRARY_PATH"
export PATH=${LOCAL_PREFIX}/bin:${PATH} export PATH=${LOCAL_PREFIX}/bin:${PATH}
export LD_LIBRARY_PATH=${LOCAL_PREFIX}/lib:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH=${LOCAL_PREFIX}/lib:${LD_LIBRARY_PATH}
if [ -d "${LOCAL_PREFIX}/lib/EICrecon/plugins" ]; then
echo "Using EICrecon plugins from ${LOCAL_PREFIX}/lib/EICrecon/plugins"
export JANA_PLUGIN_PATH=${LOCAL_PREFIX}/lib/EICrecon/plugins
else
echo "The ${LOCAL_PREFIX}/lib/EICrecon/plugins doesn't exist"
fi
# Local field maps # Local field maps
mkdir -p ${LOCAL_DATA_PATH}/fieldmaps mkdir -p ${LOCAL_DATA_PATH}/fieldmaps
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment