Skip to content
Snippets Groups Projects
Unverified Commit 33727072 authored by Petr Zejdl's avatar Petr Zejdl Committed by GitHub
Browse files

Revert "Add script to build RPM"

parent 3c3a6b4e
No related branches found
No related tags found
1 merge request!59CMSSW json file
################################################################################
##
## Input settings
##
################################################################################
# Input settings, allowed values are:
# "wzdma" for DMA driver from Wojciech M. Zabolotny
# "dma" for XILINX DMA driver
# "filedma" for reading from file and simulating DMA
#
input:wzdma
## Settings for DMA input
# DMA device
dma_dev:/dev/xdma0_c2h_0
# Max received packet size in bytes (buffer to reserve)
dma_packet_buffer_size:1048576
# Number of packet buffers to allocate
dma_number_of_packet_buffers:1000
# Print report each N packets, use 0 to disable
packets_per_report:200000
## Extra settings for "filedma" input
#input_file:/dev/shm/testdata.bin
input_file:testdata.bin
################################################################################
##
## Stream processor settings
##
################################################################################
enable_stream_processor:yes
# Define processing type (unpacking), allowed values are:
# "PASS_THROUGH"
# "GMT"
#
# Note: When changing the processing type, change also "output_filename_prefix"
# in the file output section.
#
processor_type:PASS_THROUGH
# Enable software zero-supression
doZS:no
################################################################################
##
## File output settings
##
################################################################################
output_filename_prefix:scout_pass_through
output_filename_base:/fff/BU0/ramdisk/scdaq
max_file_size:8589934592
# Always write data to a file regardless of the run status, useful for debugging
output_force_write:no
################################################################################
##
## Elastics processor settings (obsolete)
##
################################################################################
enable_elastic_processor:no
port:8000
elastic_url:http://something.somewhere
pt_cut:7
quality_cut:12
################################################################################
##
## SCDAQ Generic Settings
##
################################################################################
# Pipeline settings
threads:8
#!/bin/sh #!/bin/sh
echo "reset" | nc localhost 12345 echo "reset" | nc scoutsrv-s1d12-38-01 12345
...@@ -14,7 +14,7 @@ umask 000 # Files and folders we create should be world accessible ...@@ -14,7 +14,7 @@ umask 000 # Files and folders we create should be world accessible
while true while true
do do
echo "Starting scdaq..." echo "Starting scdaq..."
/opt/scdaq/bin/scdaq /etc/scdaq/scdaq.conf 2>&1 | logger --tag scdaq --id -p user.debug ./scdaq 2>&1 | logger --tag scdaq --id -p user.debug
echo "Resetting the board..." echo "Resetting the board..."
../scripts/reset-firmware.sh ../scripts/reset-firmware.sh
echo "Clearing caches..." echo "Clearing caches..."
......
#!/bin/bash -e
BUILD_ARCH=x86_64
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
RHEL_MAJOR=`cat /etc/redhat-release | cut -d' ' -f4 | cut -d'.' -f1`
echo "Checking if necessary build packages are installed..."
if [ "$RHEL_MAJOR" = "7" ]; then
if ! rpm -q rpm-build; then
echo "\nPlease install missing packages.";
exit 1;
fi
else
if ! rpm -q gcc redhat-rpm-config rpm-build zlib-devel; then
echo "";
echo "Please install missing packages.";
exit 1;
fi
fi
echo "..Build dependencies OK"
echo ""
cd $SCRIPTDIR/..
BASEDIR=$PWD
PARAMCACHE="paramcache"
NLINES=1
ASK="1"
if [ -n "$1" ]; then
if [ "$1" = "--batch" ]; then
ASK="0"
fi
if [ "$1" = "-b" ]; then
ASK="0"
fi
if [ $ASK = "0" ]; then #check $2 if found
if [ -n "$2" ]; then
PARAMCACHE=${2##*/}
fi
fi
if [ $ASK = "1" ]; then #take $1
PARAMCACHE=${1##*/}
fi
fi
echo "Using cache file $PARAMCACHE"
if [ -f $SCRIPTDIR/$PARAMCACHE ];
then
readarray lines < $SCRIPTDIR/$PARAMCACHE
for (( i=0; i < ${NLINES}; i++ ))
do
lines[$i]=`echo -n ${lines[$i]} | tr -d "\n"`
done
else
for (( i=0; i < ${NLINES}; i++ ))
do
lines[$i]=""
done
fi
if [ $ASK = "1" ]; then
echo "This is the scdaq build script. It will now ask for several configuration parameters."
echo "Use -b cmdline parameter to build from cache without waiting for input"
echo " ... press any key to continue ..."
read readin
echo "Dummy parameter, this will be used to modify/obtain build parameters from cache (press enter for \"${lines[0]}\"):"
readin=""
read readin
if [ ${#readin} != "0" ]; then
lines[0]=$readin
fi
fi #ask
#update cache file
if [ -f $SCRIPTDIR/$PARAMCACHE ];
then
rm -rf -f $SCRIPTDIR/$PARAMCACHE
fi
for (( i=0; i < ${NLINES}; i++ ))
do
echo ${lines[$i]} >> $SCRIPTDIR/$PARAMCACHE
done
PACKAGENAME="scdaq"
# set the RPM build architecture
#BUILD_ARCH=$(uname -i) # "i386" for SLC4, "x86_64" for SLC5
cd $SCRIPTDIR/..
BASEDIR=$PWD
# create a build area
echo "removing old build area"
rm -rf /tmp/$PACKAGENAME-build-tmp
echo "creating new build area"
mkdir /tmp/$PACKAGENAME-build-tmp
cd /tmp/$PACKAGENAME-build-tmp
#mkdir BUILD
#mkdir RPMS
TOPDIR=$PWD
echo "working in $PWD"
#ls
# we are done here, write the specs and make the fu***** rpm
cat > scoutdaq.spec << EOF
Name: $PACKAGENAME$pkgsuffix
Version: 0.1.0
Release: 0%{?dist}
Summary: scouting daq
License: gpl
Group: DAQ
Packager: meschi
Source: none
%define _tmppath $TOPDIR/scdaq-build
BuildRoot: %{_tmppath}
BuildArch: $BUILD_ARCH
AutoReqProv: no
Provides:/opt/scdaq
Requires: tbb boost-thread libcurl
Obsoletes: scdaq
%description
scouting daq
%prep
echo "PIPPPPPPPPO"
echo $RPM_SOURCE_DIR
echo "PIPPOOOOOOOOO"
echo $BASEDIR
cp -R $BASEDIR/src SOURCES/
%build
echo $RPM_SOURCE_DIR
cd SOURCES
pwd
make
%install
echo $RPM_SOURCE_DIR
rm -rf \$RPM_BUILD_ROOT
mkdir -p \$RPM_BUILD_ROOT
%__install -d "%{buildroot}/var/cache/scdaq"
%__install -d "%{buildroot}/var/log/scdaq"
%__install -d "%{buildroot}/var/log/scdaq/pid"
%__install -d "%{buildroot}/opt/scdaq"
%__install -d "%{buildroot}/opt/scdaq/init.d"
%__install -d "%{buildroot}/opt/scdaq/bin"
cd \$RPM_BUILD_ROOT
echo "Creating directories"
mkdir -p opt/scdaq
mkdir -p etc/scdaq
mkdir -p etc/logrotate.d
mkdir -p usr/lib/systemd/system
#mkdir -p %{buildroot}/usr/lib/systemd/system
mkdir -p etc/init.d
#mkdir -p %{buildroot}/opt/scdaq/init.d
echo "Copying files to their destination"
cp $BASEDIR/init.d/runSCdaq.service usr/lib/systemd/system/runSCdaq.service
cp $BASEDIR/init.d/scoutboardResetServer.service usr/lib/systemd/system/scoutboardResetServer.service
cp -R $BASEDIR/* opt/scdaq
echo "PIPPOOOOOOOOOOO"
pwd
cp $TOPDIR/RPMBUILD/BUILD/SOURCES/scdaq opt/scdaq/bin/
cp -R $BASEDIR/etc/scdaq/scdaq.conf etc/scdaq/
#cp -R $BASEDIR/etc/logrotate.d/scdaq etc/logrotate.d/
#rm -rf opt/hltd/init.d
#touch opt/scdaq/scratch/new-version
echo "Deleting unnecessary files"
rm -rf opt/hltd/{bin,rpm,lib}
rm -rf opt/hltd/scripts/paramcache*
rm -rf opt/hltd/scripts/*rpm.sh
#rm -rf opt/hltd/scripts/postinstall.sh
%post
#/opt/scdaq/postinstall.sh
systemctl daemon-reload
%files
%dir %attr(777, -, -) /var/cache/scdaq
%dir %attr(777, -, -) /var/log/scdaq
%dir %attr(777, -, -) /var/log/scdaq/pid
%defattr(-, root, root, -)
/opt/scdaq/
%config /etc/scdaq/scdaq.conf
#/etc/logrotate.d/scdaq
%attr( 644 ,root, root) /usr/lib/systemd/system/runSCdaq.service
%attr( 644 ,root, root) /usr/lib/systemd/system/scoutboardResetServer.service
#%attr( 755 ,root, root) /opt/scdaq/init.d/
#%attr( 755 ,root, root) /opt/scdaq/init.d/
%preun
if [ \$1 == 0 ]; then
/usr/bin/systemctl stop runSCdaq || true
/usr/bin/systemctl disable runSCdaq || true
/usr/bin/systemctl stop scoutboardResetServer || true
/usr/bin/systemctl disable scoutboardResetServer || true
fi
EOF
mkdir -p RPMBUILD/{RPMS/{noarch},SPECS,BUILD,SOURCES,SRPMS}
rpmbuild --define "_topdir `pwd`/RPMBUILD" -bb scoutdaq.spec
#rm -rf patch-cmssw-tmp
#!/bin/sh #!/bin/sh
source /opt/Xilinx/Vivado_Lab/2018.3/settings64.sh source /opt/Xilinx/Vivado/2018.2/settings64.sh
vivado_lab -mode batch -source reset_scouting-proc.tcl vivado -mode batch -source reset_scouting-proc.tcl
...@@ -3,9 +3,9 @@ connect_hw_server -url localhost:3121 ...@@ -3,9 +3,9 @@ connect_hw_server -url localhost:3121
current_hw_target [get_hw_targets */xilinx_tcf/Xilinx/1234-tulA] current_hw_target [get_hw_targets */xilinx_tcf/Xilinx/1234-tulA]
set_property PARAM.FREQUENCY 15000000 [get_hw_targets */xilinx_tcf/Xilinx/1234-tulA] set_property PARAM.FREQUENCY 15000000 [get_hw_targets */xilinx_tcf/Xilinx/1234-tulA]
open_hw_target open_hw_target
set_property PROGRAM.FILE {/home/scouter/bitfiles/currently_used/scouting_build.bit} [get_hw_devices xcku115_0] set_property PROGRAM.FILE {/home/scouter/bitfiles/eight_links_zs/top.bit} [get_hw_devices xcku115_0]
set_property PROBES.FILE {/home/scouter/bitfiles/currently_used/scouting_build.ltx} [get_hw_devices xcku115_0] set_property PROBES.FILE {/home/scouter/bitfiles/eight_links_zs/top.ltx} [get_hw_devices xcku115_0]
set_property FULL_PROBES.FILE {/home/scouter/bitfiles/currently_used/scouting_build.ltx} [get_hw_devices xcku115_0] set_property FULL_PROBES.FILE {/home/scouter/bitfiles/eight_links_zs/top.ltx} [get_hw_devices xcku115_0]
current_hw_device [get_hw_devices xcku115_0] current_hw_device [get_hw_devices xcku115_0]
refresh_hw_device [lindex [get_hw_devices xcku115_0] 0] refresh_hw_device [lindex [get_hw_devices xcku115_0] 0]
......
#!/bin/sh #!/bin/sh
source /opt/Xilinx/Vivado_Lab/2018.3/settings64.sh source /opt/Xilinx/Vivado/2018.2/settings64.sh
vivado_lab -mode batch -source reset_server.tcl vivado -mode batch -source reset_server.tcl
...@@ -7,9 +7,9 @@ proc init_hw {} { ...@@ -7,9 +7,9 @@ proc init_hw {} {
current_hw_target [get_hw_targets */xilinx_tcf/Xilinx/1234-tulA] current_hw_target [get_hw_targets */xilinx_tcf/Xilinx/1234-tulA]
set_property PARAM.FREQUENCY 15000000 [get_hw_targets */xilinx_tcf/Xilinx/1234-tulA] set_property PARAM.FREQUENCY 15000000 [get_hw_targets */xilinx_tcf/Xilinx/1234-tulA]
open_hw_target open_hw_target
set_property PROGRAM.FILE {/home/scouter/bitfiles/currently_used/scouting_build.bit} [get_hw_devices xcku115_0] set_property PROGRAM.FILE {/home/scouter/bitfiles/use_with_vivado_2018.2/eight_links_zs_lids_from_protocol/top.bit} [get_hw_devices xcku115_0]
set_property PROBES.FILE {/home/scouter/bitfiles/currently_used/scouting_build.ltx} [get_hw_devices xcku115_0] set_property PROBES.FILE {/home/scouter/bitfiles/use_with_vivado_2018.2/eight_links_zs_lids_from_protocol/top.ltx} [get_hw_devices xcku115_0]
set_property FULL_PROBES.FILE {/home/scouter/bitfiles/currently_used/scouting_build.ltx} [get_hw_devices xcku115_0] set_property FULL_PROBES.FILE {/home/scouter/bitfiles/use_with_vivado_2018.2/eight_links_zs_lids_from_protocol/top.ltx} [get_hw_devices xcku115_0]
current_hw_device [get_hw_devices xcku115_0] current_hw_device [get_hw_devices xcku115_0]
refresh_hw_device [lindex [get_hw_devices xcku115_0] 0] refresh_hw_device [lindex [get_hw_devices xcku115_0] 0]
} }
......
...@@ -105,16 +105,12 @@ int run_pipeline( int nbThreads, ctrl& control, config& conf ) ...@@ -105,16 +105,12 @@ int run_pipeline( int nbThreads, ctrl& control, config& conf )
int main( int argc, char* argv[] ) { int main( int argc, char* argv[] ) {
(void)(argc); (void)(argc);
(void)(argv); (void)(argv);
if(argc<2){ LOG(DEBUG) << "here 0";
LOG(ERROR) << "missing argument [conffile] in scdaq invocation";
exit(-1);
}
LOG(DEBUG) << "scdaq started with argument" << argv[1];
try { try {
config conf(argv[1]); config conf("scdaq.conf");
conf.print(); conf.print();
LOG(DEBUG) << "configuration loaded"; LOG(DEBUG) << "here 1";
ctrl control; ctrl control;
// tbb::tick_count mainStartTime = tbb::tick_count::now(); // tbb::tick_count mainStartTime = tbb::tick_count::now();
......
scdaq-calo.conf
\ No newline at end of file
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