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

Merge branch 'lintao/build/lcg105' into 'master'

WIP: try to support LCG 105 for both centos7 and el9

See merge request !164
parents 052661d8 cfe7978b
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
# Author: Tao Lin <lintao@ihep.ac.cn> # Author: Tao Lin <lintao@ihep.ac.cn>
############################################################################## ##############################################################################
THISSCRITDIR=$(dirname $(readlink -e "${BASH_SOURCE[0]}" 2>/dev/null) 2>/dev/null) # Darwin readlink doesnt accept -e
function info:() { function info:() {
echo "INFO: $*" 1>&2 echo "INFO: $*" 1>&2
} }
...@@ -74,8 +76,9 @@ function run-cmake() { ...@@ -74,8 +76,9 @@ function run-cmake() {
fi fi
cd $blddir cd $blddir
local installarea=$THISSCRITDIR/InstallArea/$CEPCSW_LCG_PLATFORM
cmake .. -DHOST_BINARY_TAG=${lcg_platform} ${bldgen} || { cmake .. -DCMAKE_INSTALL_PREFIX=$installarea -DHOST_BINARY_TAG=${lcg_platform} ${bldgen} || {
error: "Failed to cmake" error: "Failed to cmake"
return 1 return 1
} }
...@@ -115,6 +118,7 @@ function run-install() { ...@@ -115,6 +118,7 @@ function run-install() {
# Parse the command line options # Parse the command line options
############################################################################## ##############################################################################
# The following envvars should be defined after source setup scripts
# The current default platform # The current default platform
lcg_platform=${CEPCSW_LCG_PLATFORM:-x86_64-centos7-gcc11-opt} lcg_platform=${CEPCSW_LCG_PLATFORM:-x86_64-centos7-gcc11-opt}
lcg_version=${CEPCSW_LCG_VERSION:-103.0.2} lcg_version=${CEPCSW_LCG_VERSION:-103.0.2}
......
...@@ -32,19 +32,32 @@ function cepcsw-external() { ...@@ -32,19 +32,32 @@ function cepcsw-external() {
} }
function setup-external() { function setup-external() {
local f=$(cepcsw-external)/setup-${CEPCSW_LCG_VERSION}.sh local f
if [ ! -f $f ]; then
error: "Failed to find setup script $f" # try new os
f=$(cepcsw-external)/setup-${CEPCSW_LCG_VERSION}-${CEPCSW_LCG_OS}.sh
if [ -f "$f" ]; then
info: "Setup CEPCSW externals (os: $CEPCSW_LCG_OS, lcg: $CEPCSW_LCG_VERSION): $f"
source $f
return return
fi fi
info: "Setup CEPCSW externals: $f" # legacy
source $f if [ "$CEPCSW_LCG_OS" = "centos7" ]; then
f=$(cepcsw-external)/setup-${CEPCSW_LCG_VERSION}.sh
if [ -f "$f" ]; then
info: "Setup CEPCSW externals (os: $CEPCSW_LCG_OS, lcg: $CEPCSW_LCG_VERSION): $f"
source $f
return
fi
fi
error: "Failed to find setup script for CEPCSW_LCG_VERSION: ${CEPCSW_LCG_VERSION}, CEPCSW_LCG_OS: ${CEPCSW_LCG_OS}"
} }
function setup-install-area() { function setup-install-area() {
local installarea=$THISSCRITDIR/InstallArea local installarea=$THISSCRITDIR/InstallArea/$CEPCSW_LCG_PLATFORM
if [ ! -d "$installarea" ]; then if [ ! -d "$installarea" ]; then
info: "The InstallArea is not created yet. Please run ./build.sh first, then source setup.sh again." info: "The InstallArea is not created yet. Please run ./build.sh first, then source setup.sh again."
return return
...@@ -64,16 +77,58 @@ function setup-install-area() { ...@@ -64,16 +77,58 @@ function setup-install-area() {
info: "Setup CEPCSW: $installarea" info: "Setup CEPCSW: $installarea"
} }
function detect-os() {
local os=$(source /etc/os-release; echo $ID)
local os_ver=$(source /etc/os-release; echo $VERSION_ID)
local cepcsw_lcg_os
case "$os" in
almalinux)
cepcsw_lcg_os=el
;;
centos)
cepcsw_lcg_os=centos
;;
esac
case "$os_ver" in
7*)
cepcsw_lcg_os=${cepcsw_lcg_os}7
;;
9*)
cepcsw_lcg_os=${cepcsw_lcg_os}9
;;
esac
export CEPCSW_LCG_OS=${cepcsw_lcg_os}
}
############################################################################## ##############################################################################
# Parse the command line options # Parse the command line options
############################################################################## ##############################################################################
# CEPCSW_LCG_VERSION=${1}; shift
# CEPCSW_LCG_OS: centos7 or el9
if [ -z "$CEPCSW_LCG_OS" ]; then
# try to detect os
detect-os
fi
# if user don't specify the version, try to detect according to the current os
if [ -z "$CEPCSW_LCG_VERSION" ]; then if [ -z "$CEPCSW_LCG_VERSION" ]; then
CEPCSW_LCG_VERSION=103.0.2 case "$CEPCSW_LCG_OS" in
el9)
CEPCSW_LCG_VERSION=105.0.0
;;
*)
CEPCSW_LCG_VERSION=103.0.2
;;
esac
fi fi
export CEPCSW_LCG_VERSION export CEPCSW_LCG_VERSION
setup-external setup-external
setup-install-area setup-install-area
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