SuperKEKB XRM system |
Not logged in |
 |
|
Message ID: 3
Entry time: Tue May 3 08:11:06 2016
|
Author: |
M. Andrew |
Type: |
documentation |
Subject: |
what was done in January 2016 |
|
|
Here is a data dump of everything that happened on the asus laptop while getting the laste 2015 / early 2016 incarnation of the XRM tested before being delivered to KEK on the weekend of January 24th. Everything was done in bash and the firmware only addressed one carrier at a time, so the purpose of this elog entry is simply to archive the information. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#!/bin/bash -e
# written 2014-12-30 by mza
# last updated 2014-12-30
declare scriptdir=$(dirname "$BASH_SOURCE")
cd "${scriptdir}"
scriptdir="$(pwd -P)"
cd - >/dev/null
# Moved this script to a local dir
#declare otherscriptdir="${scriptdir}/../../../tags/2015-01.gigE-carrier-pre-screen"
. "detect_linux_variant" >/dev/null
function delete_boogers {
local string="${1}"
string=$(echo "${string}" | sed -e "s,^:,,")
string=$(echo "${string}" | sed -e "s,:$,,")
string=$(echo "${string}" | sed -e "s,::,:,g")
echo ${string}
}
function delete_repeats {
string=$(echo "${1}" | sed -e "s,:, ,g")
#echo ${string}
newstring=$( (for each in ${string}; do echo "${each}"; done; ) | sort -u)
newstring=$(echo $(echo "${newstring}") | sed -e "s, ,:,g")
echo ${newstring}
}
declare -i errors=0
declare BASE QTDIR PYTHONPATH
BASE="${PWD}"
if [ "$OS" = "Ubuntu" ]; then
if [ ${BITS} -eq 32 ] && [ -e "/usr/lib/i386-linux-gnu/qt4" ]; then
QTDIR="/usr/lib/i386-linux-gnu/qt4"
elif [ ${BITS} -eq 64 ] && [ -e "/usr/lib/x86_64-linux-gnu/qt4" ]; then
QTDIR="/usr/lib/x86_64-linux-gnu/qt4"
fi
elif [ "$OS" = "Linux" ]; then
if [ ${BITS} -eq 32 ] && [ -e "/usr/lib/qt4" ]; then
QTDIR="/usr/lib/qt4"
elif [ ${BITS} -eq 32 ] && [ -e "/usr/lib/i386-linux-gnu/qt4" ]; then
QTDIR="/usr/lib/i386-linux-gnu/qt4"
elif [ ${BITS} -eq 64 ] && [ -e "/usr/lib64/qt4" ]; then
QTDIR="/usr/lib64/qt4"
elif [ -e "/usr/local/Trolltech/Qt-4.6.4" ]; then
QTDIR="/usr/local/Trolltech/Qt-4.6.4"
elif [ -e "/usr/local/Trolltech/Qt-4.4.3" ]; then
QTDIR="/usr/local/Trolltech/Qt-4.4.3"
elif [ -e "/usr/local/Trolltech/Qt-4.8.5" ]; then
QTDIR="/usr/local/Trolltech/Qt-4.8.5"
fi
else
:
fi
#for each in "/usr/lib/qt4" "/usr/lib64/qt4" "/usr/lib/x86_64-linux-gnu/qt4" "/usr/lib/i386-linux-gnu/qt4"; do
if [ -z "${QTDIR}" ] || [ ! -e "${QTDIR}/bin/qmake" ]; then echo "error: is libqt4-dev installed?" > /dev/stderr; errors=$((errors+1)); fi
# || [ ! -e "${QTDIR}/lib" ]
#PATH="${QTDIR}/bin:${PATH}"
PATH="${BASE}/bin:${QTDIR}/bin:${PATH}"
#export PATH="${ROOTSYS}/bin:${PATH}"
PATH=$(delete_repeats ${PATH})
PATH=$(delete_boogers ${PATH})
PYTHONPATH="${BASE}/python/lib/python"
#PYTHONPATH="${BASE}/python/lib64/python"
# a xilinx-related entry in the original LD_LIBRARY_PATH causes problems with the QT build
if [ "$OS" = "Ubuntu" ]; then
if [ ${BITS} -eq 32 ] && [ -e "/usr/lib/i386-linux-gnu" ]; then
LD_LIBRARY_PATH="/usr/lib/i386-linux-gnu"
elif [ ${BITS} -eq 64 ] && [ -e "/usr/lib/x86_64-linux-gnu" ]; then
LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu"
fi
elif [ "$OS" = "Linux" ]; then
if [ ${BITS} -eq 32 ]; then
LD_LIBRARY_PATH="/usr/lib:${QTDIR}/lib"
else
LD_LIBRARY_PATH="/usr/lib64:${QTDIR}/lib"
fi
elif [ "${OS:0:6}" = "CYGWIN" ]; then
LD_LIBRARY_PATH="/lib:${QTDIR}/lib:${LD_LIBRARY_PATH}"
else
:
fi
#for each in "/lib" "/usr/lib" "/lib64" "/usr/lib64" "/usr/lib/x86_64" "/usr/lib/i386-linux-gnu" "/lib/i386-linux-gnu"; do
#export setenv LD_LIBRARY_PATH="${ROOTSYS}/lib:${LD_LIBRARY_PATH}"
LD_LIBRARY_PATH=$(delete_repeats ${LD_LIBRARY_PATH})
LD_LIBRARY_PATH=$(delete_boogers ${LD_LIBRARY_PATH})
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"
function check_for {
#cygwin is /lib/libxml2.dll.a
if [ "${OS:0:6}" = "CYGWIN" ]; then
suffix="dll.a"
name="$1.$suffix"
else
suffix="so"
name="$1.$suffix"
fi
#echo $name
installable=$2
string=$(echo "${LD_LIBRARY_PATH}" | sed -e "s,:, ,g")
#lib=$(find ${string} 2>/dev/null | grep ${name} | grep $suffix$ | head -n 1)
#echo "${string}"
lib=$(find ${string} 2>/dev/null | grep ${name})
if [ ! -z "${lib}" ]; then
libdir=$(dirname "${lib}")
if [ -z "${libdir}" ]; then echo "error: is ${installable} installed?" > /dev/stderr; errors=$((errors+1)); fi
else
echo "error: is ${installable} installed?" > /dev/stderr
errors=$((errors+1))
fi
}
check_for "libxml2" "libxml2-dev"
check_for "libbz2" "libbz2-dev"
check_for "libz" "libz"
#echo "as root, do the following if not already done:"
#echo "cd /lib/i386-linux-gnu"
#echo "ln -s libz.so.1 libz.so"
#echo "BASE ${BASE}"
#echo "PYTHONPATH ${PYTHONPATH}"
echo " PATH=${PATH}" | tee ${scriptdir}/makeenv
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" | tee -a ${scriptdir}/makeenv
echo " QTDIR=${QTDIR}" | tee -a ${scriptdir}/makeenv
echo | tee -a ${scriptdir}/makeenv
export BASE QTDIR PYTHONPATH PATH LD_LIBRARY_PATH
if [ ${errors} -ne 0 ]; then
(echo; echo "errors encountered"; echo;) > /dev/stderr
# this trick from http://stackoverflow.com/questions/2683279/how-to-detect-if-a-script-is-being-sourced :
return 2>/dev/null || exit 17
fi
|
|