Skip to content
Snippets Groups Projects
Commit 484e3b68 authored by lintao@ihep.ac.cn's avatar lintao@ihep.ac.cn
Browse files

WIP: add a run.sh script and update the README.

parent 3d8b9253
No related branches found
No related tags found
No related merge requests found
...@@ -12,14 +12,12 @@ $ /cvmfs/container.ihep.ac.cn/bin/hep_container shell SL6 ...@@ -12,14 +12,12 @@ $ /cvmfs/container.ihep.ac.cn/bin/hep_container shell SL6
Before run following commands, please make sure you setup the CVMFS: Before run following commands, please make sure you setup the CVMFS:
``` ```
$ source /cvmfs/cepcsw.ihep.ac.cn/prototype/releases/externals/97.0.2/setup.sh
$ git clone git@github.com:cepc/CEPCSW.git $ git clone git@github.com:cepc/CEPCSW.git
$ cd CEPCSW $ cd CEPCSW
$ git checkout master # branch name $ git checkout master # branch name
$ mkdir build && cd build $ source setup.sh
$ cmake .. -DHOST_BINARY_TAG=${BINARY_TAG} $ ./build.sh
$ make $ ./run.sh Examples/options/helloalg.py
$ ./run gaudirun.py '$EXAMPLESROOT/options/helloalg.py'
``` ```
## Packages ## Packages
......
run.sh 0 → 100755
#!/bin/bash
##############################################################################
# Run script for CEPCSW:
# - run a simple job
#
# Usage:
# $ ./run.sh Examples/options/helloalg.py
# or:
# $
#
# Author: Tao Lin <lintao@ihep.ac.cn>
##############################################################################
function info:() {
echo "INFO: $*" 1>&2
}
function error:() {
echo "ERROR: $*" 1>&2
}
function check-cepcsw-envvar() {
# CEPCSWEXTERNAL is defined in /cvmfs/cepcsw.ihep.ac.cn/prototype/releases/externals/
if [ -z "${CEPCSWEXTERNAL}" ]; then
error: "The CEPCSW is not setup. Please source setup.sh."
return 1
fi
}
function build-dir() {
local blddir=build
# If detect the extra env var, append it to the build dir
if [ -n "${lcg_version}" ]; then
blddir=${blddir}.${lcg_version}
fi
if [ -n "${lcg_platform}" ]; then
blddir=${blddir}.${lcg_platform}
fi
echo $blddir
}
function check-working-builddir() {
local blddir=$(build-dir)
if [ ! -d "$blddir" ]; then
mkdir $blddir || {
error: "Failed to create $blddir"
return 1
}
fi
}
function run-job() {
local blddir=$(build-dir)
$blddir/run gaudirun.py $*
}
##############################################################################
# Parse the command line options
##############################################################################
# The current default platform
lcg_platform=x86_64-slc6-gcc8-opt
lcg_version=97.0.2
check-cepcsw-envvar || exit -1
check-working-builddir || exit -1
run-job $* || exit -1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment