SuperKEKB XRM system  Not logged in ELOG logo
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.

Attachment 1: howtogetdata.mza  408 Bytes  | Show | Hide all
Attachment 2: 2016-01-24.XRM-history  14 kB  | Show | Hide all
Attachment 3: 2016-01-24.XRM-code-chanes.patch  6 kB  | Show | Hide all
Attachment 4: XRM-fpga2-alias-output  1 kB  | Show | Hide all
Attachment 5: grab_all_peds  731 Bytes  | Show | Hide all
Attachment 6: mza.gnuplot  773 Bytes  | Show | Hide all
Attachment 7: IMG_1025.JPG  314 kB  | Show | Hide all
Attachment 8: IMG_1027.JPG  337 kB  | Show | Hide all
Attachment 9: IMG_1028.JPG  285 kB  | Show | Hide all
Attachment 10: 2016-01-24.LASER5.png  659 kB  | Show | Hide all
Attachment 11: 2016-01-24.LASER.png  614 kB  | Show | Hide all
Attachment 12: 2016-01-24.LASER14.png  640 kB  | Show | Hide all
Attachment 13: 2016-01-24.LASER13.png  671 kB  | Show | Hide all
Attachment 14: 2016-01-24.LASER12.png  619 kB  | Show | Hide all
Attachment 15: 2016-01-24.LASER11.png  641 kB  | Show | Hide all
Attachment 16: 2016-01-24.LASER9.png  638 kB  | Show | Hide all
Attachment 17: program-bit-and-elf-and-go.xmd.tcl  3 kB  | Show | Hide all
Attachment 18: setup_env_template.sh  4 kB  | Hide | Hide all
#!/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

Attachment 19: XRM.bashrc  3 kB  | Show | Hide all
ELOG V3.1.5-3a5f2f0