Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CEPCSW_OTE_development
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yudian2002@sjtu.edu.cn
CEPCSW_OTE_development
Commits
95daa645
Commit
95daa645
authored
4 years ago
by
lintao@ihep.ac.cn
Browse files
Options
Downloads
Patches
Plain Diff
add the script to build CEPCSW with Key4hep.
parent
7d4fcc0e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build-k4.sh
+107
-0
107 additions, 0 deletions
build-k4.sh
with
107 additions
and
0 deletions
build-k4.sh
0 → 100755
+
107
−
0
View file @
95daa645
#!/bin/bash
##############################################################################
# Setup script for CEPCSW:
# - build the cepcsw
#
# Usage:
# $ bash build.sh
# or:
# $
#
# Author: Tao Lin <lintao@ihep.ac.cn>
##############################################################################
function
info:
()
{
echo
"INFO:
$*
"
1>&2
}
function
error:
()
{
echo
"ERROR:
$*
"
1>&2
}
function
check-cepcsw-envvar
()
{
source
/cvmfs/sw.hsf.org/key4hep/setup.sh
}
function
build-dir
()
{
local
blddir
=
build
# If detect the extra env var, append it to the build dir
if
[
-n
"
${
k4_version
}
"
]
;
then
blddir
=
${
blddir
}
.
${
k4_version
}
fi
if
[
-n
"
${
k4_platform
}
"
]
;
then
blddir
=
${
blddir
}
.
${
k4_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-cmake
()
{
local
blddir
=
$(
build-dir
)
if
[
!
-d
"
$blddir
"
]
;
then
error:
"Failed to create
$blddir
"
return
1
fi
cd
$blddir
local
clhep_prefix
=
$(
clhep-config
--prefix
)
local
clhep_include
=
${
clhep_prefix
}
/include
# locate the pandorapfa
local
pandorapfa
=
$(
echo
$CMAKE_PREFIX_PATH
|
tr
':'
'\n'
|
grep
pandorapfa |
head
-n1
)
info:
"Find PandoraPFA:
$pandorapfa
"
if
[
-z
"
$pandorapfa
"
]
;
then
error:
"Failed to find the PandoraPFA"
return
1
fi
local
pandorapfa_cmake_modules
=
${
pandorapfa
}
/cmakemodules
info:
"Find PandoraPFA cmake:
${
pandorapfa_cmake_modules
}
"
if
[
!
-d
"
${
pandorapfa_cmake_modules
}
"
]
;
then
error:
"Failed to find the cmake modules for PandoraPFA:
${
pandorapfa_cmake_modules
}
"
return
1
fi
local
cmake_modules
=
${
pandorapfa_cmake_modules
}
cmake ..
-DHOST_BINARY_TAG
=
${
k4_platform
}
\
-DCLHEP_INCLUDE_DIR
=
${
clhep_include
}
\
-DCMAKE_MODULE_PATH
=
${
cmake_modules
}
||
{
error:
"Failed to cmake"
return
1
}
}
function
run-make
()
{
make
}
##############################################################################
# Parse the command line options
##############################################################################
# The current default platform
k4_platform
=
x86_64-linux-gcc9-opt
k4_version
=
master
check-cepcsw-envvar
||
exit
-1
check-working-builddir
||
exit
-1
run-cmake
||
exit
-1
run-make
||
exit
-1
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment