[kobayash@saho-a ~]$ cat /etc/redhat-release AlmaLinux release 8.4 (Electric Cheetah) [kobayash@saho-a ~]$ uname -a Linux saho-a.rcnp.osaka-u.ac.jp 4.18.0-193.14.2.el8_2.x86_64 #1 SMP Sun Jul 26 03:54:29 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ echo $SHELL /bin/bash
saho-a /saho-b のデフォルトのシェルは tcsh だった気がするが、もし tcsh だった場合、bashに変更しておくと良い。ログインシェルを bash に変えるには、アカウント管理ページから設定できず、計算機室にメールでお願いする必要があるかも。
[kobayash@saho-a ~]$ dnf list zstd libzstd-devel bzip2-devel cmake python36-devel ptyhon36 tmux ... Installed Packages bzip2-devel.x86_64 1.0.6-26.el8 @BaseOS libzstd-devel.x86_64 1.4.2-2.el8 @BaseOS python36-devel.x86_64 3.6.8-2.module_el8.1.0+245+c39af44f @AppStream tmux.x86_64 2.7-1.el8 @BaseOS zstd.x86_64 1.4.2-2.el8 @AppStream ...
ただ、pythonは古いバージョンの 3.6 しか入っていないので、SlowDashを使う時はこれだと問題がおきるはず(TimeSeriesのグラフが表示されなくなるはず)。SlowDash を動かす際は、新しいPython に切り替える必要あり。
$ pip3 install dataclasses --user
$ ssh kobayash@saho-a Password: $ mkdir -p $HOME/local/cmake-3.27.7
$ wget https://github.com/Kitware/CMake/releases/download/v3.27.7/cmake-3.27.7.tar.gz
$ scp cmake-3.27.7.tar.gz kobayash@saho-a:local/cmake-3.27.7
$ ssh kobayash@saho-a Password:
$ $ cd $HOME/local/cmake-3.27.7 $ tar zxvf cmake-3.27.7.tar.gz $ cd cmake-3.27.7 $ ./configure --prefix=$HOME/local/cmake-3.27.7 $ time make -j10 real 1m41.326s user 13m1.044s sys 1m38.289s $ make install
ちなみに、time make -j20 とすると、メモリが足りないと言われた。
$ emacs -nw $HOME/.bashrc <以下の行を最下部あたりに追記> # For PATH of cmake 2023.10.12 export PATH=$HOME/local/cmake-3.27.7/bin:$PATH
$ source $HOME/.bashrc $ cmake --version cmake version 3.27.7 CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ root --version ROOT Version: 6.20/06 Built for linuxx8664gcc on Jun 10 2020, 06:10:57 From tags/v6-20-06@v6-20-06
もし、古いバージョンの ROOT が起動したら、まずそのROOTが立ち上がらない様に設定する。ROOTのインストール(または設定)をしたのは自分自身なので、記憶を頼りに設定を消す。おそらく、ホームディレクトリの .bashrc に以下の様な行が書かれているはずなので、そこをコメントアウトすれば良い。
source /saho/sharedAPL/root/6.20.06/bin/thisroot.sh
古い ROOT の設定を消したら、新しい ROOT (v6.28.06) をバイナリからインストールする。(ソースからインストールしても良い。)インストール方法は以下の通り。
$ ssh kobayash@saho-a Password: $ mkdir -p $HOME/local/root_v6.28.06
$ wget https://root.cern/download/root_v6.28.06.Linux-centos8-x86_64-gcc8.5.tar.gz
ちなみに、saho-a/saho-b の OS は AlmaLinux 8 であるが、CentOS 8 用のバイナリが問題なく動く。(AlmaLinux と CentOS は共に RedHat Enterprise Linux のソースコードをコンパイルして作られた RedHat Enterprise Linux のクローン。)
$ scp root_v6.28.06.Linux-centos8-x86_64-gcc8.5.tar.gz kobayash@saho-a:local/root_v6.28.06
$ ssh kobayash@saho-a Password:
$ $ cd $HOME/local/root_v6.28.06 $ tar zxvf root_v6.28.06.Linux-centos8-x86_64-gcc8.5.tar.gz $ ls root_v6.28.06.Linux-centos8-x86_64-gcc8.5.tar.gz root
$ emacs -nw $HOME/.bashrc <以下の行を最下部あたりに追記> # Setup for ROOT version 6.28/06 source $HOME/local/root_v6.28.06/root/bin/thisroot.sh
$ source $HOME/.bashrc $ root --version ROOT Version: 6.28/06 Built for linuxx8664gcc on Aug 28 2023, 11:29:15 From tags/v6-28-06@v6-28-06
というように、ROOT Version: 6.28/06 となっていたらOK。
[kobayash@saho-a ~]$ getenforce Disabled
$ mkdir -p $HOME/nestdaq/src $ cd $HOME/nestdaq/src $ git clone https://github.com/redis/redis.git $ cd redis $ git checkout -b 6.0.16 6.0.16 $ time make -j20 PREFIX=$HOME/nestdaq real 0m30.695s user 1m1.271s sys 0m15.397s $ make PREFIX=$HOME/nestdaq install
$ mkdir $HOME/nestdaq/etc $ cp $HOME/nestdaq/src/redis/redis.conf $HOME/nestdaq/etc/
$ emacs -nw $HOME/nestdaq/etc/redis.conf daemonize no | | | V V V #daemonize no daemonize yes
$ cd $HOME/nestdaq/src $ git clone --recursive https://github.com/RedisTimeSeries/RedisTimeSeries.git $ cd RedisTimeSeries $ git checkout -b v1.4.9 v1.4.9 $ time make ... real 0m4.267s user 0m3.825s sys 0m1.531s $ mkdir $HOME/nestdaq/lib $ cp $HOME/nestdaq/src/RedisTimeSeries/bin/linux-x64-release/redistimeseries.so $HOME/nestdaq/lib/
$ time make -j2 ... make[1]: warning: -jN forced in submake: disabling jobserver mode. Submodule path 'deps/RedisModulesSDK': checked out 'c0740b8209abae38775adc6f3fefe05a520be55b' Submodule path 'deps/readies': checked out '32e37e68f6ffa66f5a6e41cb37794147e84c38cb' ../deps/readies/mk/main:67: /home/kobayash/nestdaq/src/RedisTimeSeries/deps/readies/mk/cfg: No such file or directory make[1]: *** No rule to make target '/home/kobayash/nestdaq/src/RedisTimeSeries/deps/readies/mk/cfg'. Stop. make: *** [Makefile:31: build] Error 2
$ cd $HOME/nestdaq/src $ git clone https://github.com/boostorg/boost.git $ cd boost $ git checkout -b boost-1.80.0 boost-1.80.0 $ time git submodule update --init --recursive ... real 6m49.684s user 1m34.577s sys 1m10.656s $ time ./bootstrap.sh ... real 0m14.797s user 0m11.396s sys 0m1.902s $ time ./b2 install \ link=static,shared \ threading=single,multi \ cxxstd=17 \ variant=release,debug \ --layout=tagged \ -j20 \ --prefix=$HOME/nestdaq ... ...updated 20831 targets... real 8m15.210s user 41m38.956s sys 8m18.069s
$ cd $HOME/nestdaq/src $ git clone https://github.com/zeromq/libzmq.git $ cd libzmq $ mkdir build $ cmake \ -DCMAKE_INSTALL_PREFIX=$HOME/nestdaq \ -DCMAKE_CXX_STANDARD=17 \ -B ./build \ -S . $ cd build $ time make -j20 ... real 0m7.852s user 1m18.741s sys 0m13.478s $ make install
[kobayash@saho-a libzmq]$ cmake \ > -DCMAKE_INSTALL_PREFIX=$HOME/nestdaq \ > -DCMAKE_CXX_STANDARD=17 \ > -B build \ > -S . ... -- Performing Test ZMQ_HAVE_GETRANDOM - Success -- Found AsciiDoc: /usr/bin/asciidoc CMake Error at CMakeLists.txt:844 (message): CMake generation is not allowed within the source directory! Remove the CMakeCache.txt file and try again from another folder, e.g.: rm CMakeCache.txt mkdir cmake-make cd cmake-make cmake .. -- Configuring incomplete, errors occurred! See also "/home/kobayash/nestdaq/src/libzmq/CMakeFiles/CMakeOutput.log". See also "/home/kobayash/nestdaq/src/libzmq/CMakeFiles/CMakeError.log". <code> cmake のバージョンは<code>$ cmake --version cmake version 3.11.4
もし cmake 3.11 を使って cmake する場合は、build ディレクトリ内で cmake コマンドを打つようにする。このエラーの原因は cmake のバージョン 3.11 では -B オプションが効いていない模様。ただ、cmake 3.11 だとバージョンが古すぎて FairMQ の cmake が通らないので、結局 新しいバージョンの cmake を自前でインストールする必要がある。
$ cd $HOME/nestdaq/src $ git clone https://github.com/fmtlib/fmt.git $ cd fmt $ mkdir build $ cmake \ -DCMAKE_INSTALL_PREFIX=$HOME/nestdaq \ -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ -DCMAKE_CXX_STANDARD=17 \ -B build \ -S . $ cd build $ time make -j20 ... real 0m33.625s user 2m54.603s sys 0m12.291s $ make install
$ cd $HOME/nestdaq/src $ git clone https://github.com/FairRootGroup/FairLogger.git $ cd FairLogger $ mkdir build $ cmake \ -DCMAKE_INSTALL_PREFIX=$HOME/nestdaq \ -DCMAKE_CXX_STANDARD=17 \ -DUSE_EXTERNAL_FMT=OFF \ -B build \ -S . $ cd build $ time make -j20 ... real 0m16.200s user 0m42.838s sys 0m3.366s $ make install
$ cd $HOME/nestdaq/src $ git clone https://github.com/FairRootGroup/FairMQ.git $ cd FairMQ $ git checkout -b v1.4.55 v1.4.55 $ mkdir build $ cmake \ -DCMAKE_INSTALL_PREFIX=$HOME/nestdaq \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_PREFIX_PATH="$HOME/nestdaq" \ -B build \ -S . $ cd build $ time make -j10 ... $ make install
ちなみに、cmake 3.11だとバージョンが古すぎて以下のエラーになる。
$ cmake \ -DCMAKE_INSTALL_PREFIX=$HOME/nestdaq \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_PREFIX_PATH="$HOME/nestdaq" \ -B build \ -S . CMake Error at CMakeLists.txt:11 (cmake_minimum_required): CMake 3.15 or higher is required. You are running version 3.11.4 -- Configuring incomplete, errors occurred!
あと、make -j20 とすると、場合によってはメモリが足りなくなる。
[ 63%] Building CXX object examples/qc/CMakeFiles/fairmq-ex-qc-dispatcher.dir/qCDispatcher.cxx.o virtual memory exhausted: Cannot allocate memory virtual memory exhausted: Cannot allocate memory virtual memory exhausted: Cannot allocate memory cc1plus: out of memory allocating 4072 bytes after a total of 15908864 bytes virtual memory exhausted: Cannot allocate memory
$ cd $HOME/nestdaq/src $ git clone https://github.com/redis/hiredis.git $ cd hiredis $ time make PREFIX=$HOME/nestdaq install ... real 0m2.074s user 0m1.335s sys 0m0.289s
$ cd $HOME/nestdaq/src $ git clone https://github.com/sewenew/redis-plus-plus.git $ cd redis-plus-plus $ mkdir build $ cmake \ -DCMAKE_INSTALL_PREFIX=$HOME/nestdaq \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH=$HOME/nestdaq \ -DREDIS_PLUS_PLUS_CXX_STANDARD=17 \ -DREDIS_PLUS_PLUS_BUILD_TEST=OFF \ -B ./build \ -S . $ cd build $ time make -j20 install ... real 0m3.605s user 0m33.359s sys 0m3.654s
$ cd $HOME/nestdaq/src $ git clone https://github.com/spadi-alliance/nestdaq.git $ cd nestdaq $ mkdir build $ cmake \ -DCMAKE_INSTALL_PREFIX=$HOME/nestdaq \ -DCMAKE_PREFIX_PATH=$HOME/nestdaq \ -B ./build \ -S . $ cd build $ time make -j20 install ...
$ wget https://downloads.redisinsight.redislabs.com/1.12.0/redisinsight-linux64
$ scp redisinsight-linux64 kobayash@saho-a:nestdaq/bin
$ ssh kobayash@saho-a $ cd $HOME/nestdaq/bin $ chmod +x redisinsight-linux64 $ ./redisinsight-linux64 <なにも表示されなければOK。Ctrl-Cで殺す。殺したときはいろいろ言われる。> $
ちなみに、最新版をダウンロードして実行すると、以下の様なエラーとなる。
$./redisinsight-linux64 [1468586] Error loading Python lib '/tmp/_MEIS1uqBj/libpython3.10.so.1.0': dlopen: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/_MEIS1uqBj/libpython3.10.so.1.0)
$ mkdir $HOME/run
$ cd $HOME/run $ emacs nestdaq.sh
中身は以下。
#!/bin/bash export NESTDAQ=$HOME/nestdaq export PATH=$NESTDAQ/bin:$PATH
さらに、$HOME/.bashrc に以下の行を追記。
# For NestDAQ 2023.10.02 source $HOME/run/nestdaq.sh
$ cd $HOME/run $ emacs init.sh
中身は以下。
#!/bin/bash redis-server $NESTDAQ/etc/redis.conf --loadmodule $NESTDAQ/lib/redistimeseries.so --port 5921 #RIHOST=0.0.0.0 redisinsight-linux64 & #daq-webctl >& $NESTDAQ/log/daq-webctl.log & daq-webctl --http-uri http://0.0.0.0:5920 --redis-uri tcp://127.0.0.1:5921 >& /dev/null &
ちなみに、daq-webctl の –port オプションで DAQ controller のHTTPサーバーのポートを 5920 にしている。さらに、redis-server のポート番号は 5921 にしている。すでにこのポートが他のユーザーに使われていたら、他の番号を指定する。ただし、saho-a/saho-bの場合は 5901 -5999 あたりの番号をしているのが良い。他のポート番号はだいたい外部からのアクセスができないので注意。ここで 5920 と 5921 以外の番号を指定した場合、以下の文章では適宜 5920 と 5921 の部分の番号を読み替える。ポートが他のユーザーに使われているかどうかは以下のコマンドで確認可能。
$ netstat -at | grep 5920 tcp 0 0 0.0.0.0:5920 0.0.0.0:* LISTEN tcp 0 0 saho-a.rcnp.osaka-:5920 kobamac01.rcnp.os:52126 TIME_WAIT $ netstat -at | grep 5921 tcp 0 0 0.0.0.0:5921 0.0.0.0:* LISTEN tcp6 0 0 [::]:5921 [::]:* LISTEN
$ chmod +x ./init.sh
$ cd $HOME/run $ cp $HOME/nestdaq/scripts/*.sh ./
cd $HOME/run
$ source $HOME/.bashrc $ ./init.sh
もし間違って .init.sh を複数回実行した場合、redis と daq-webctl のプロセスを殺す。プロセスの殺し方は色々あるが、
$ killall redis-server $ killall daq-webctl
とすれば、全部殺せる。このようなスクリプトを用意しておいても良いかも。または、init.sh を編集し、すでにプロセスが立ち上がっていたら新たに立ち上げないとか、既存のプロセスを殺してから立ち上げるとか、賢い感じに編集しても良い。
--------------------------------------- $ ./topology-1-1.sh ... --------------------------------------- $ ./start_device.sh Sampler ... --------------------------------------- $ ./start_device.sh Sink ... ---------------------------------------
$ cd $HOME/nestdaq/src $ git clone https://github.com/spadi-alliance/nestdaq-user-impl.git $ cd nestdaq-user-impl $ mkdir build $ cmake \ -DCMAKE_INSTALL_PREFIX=$HOME/nestdaq \ -DCMAKE_PREFIX_PATH=$HOME/nestdaq \ -B ./build \ -S . $ cd build $ time make -j10 install ...
ただし、これをすると /home/nestdaq/nestdaq/bin 内の nestdaq のインストール時に作られた実行形式ファイル Sampler や Sink が上書きされる。nestdaq の 実行形式ファイルと nestdaq-user-impl の実行形式ファイルを別々に扱うには、インストール場所を変えるなどの対策が必要 (-DCMAKE_INSTALL_PREFIX を変えるとか)。
$ wget http://www-online.kek.jp/~igarashi/nestdaq/run000408_00_stf.dat.gz $ wget http://www-online.kek.jp/~igarashi/nestdaq/run000410.dat.gz $ wget http://www-online.kek.jp/~igarashi/nestdaq/topo_player.sh
$ scp run000408_00_stf.dat.gz saho-a:run/ $ scp run000410.dat.gz saho-a:run/ $ scp topo_player.sh saho-a:run/
$ ssh kobayash@saho-a Passowrd: $ cd $HOME/run $ gunzip run000408_00_stf.dat.gz $ gunzip run000410.dat.gz $ ls ... run000408_00_stf.dat run000410.dat ...
$ ps aux | grep redis $ ps aux | grep daq-webctl $ ./init.sh
#!/bin/bash #host=127.0.0.1 #port=6379 #db=0 server=redis://127.0.0.1:5921/0 ... <以下省略> ...
$ chmod +x topo_player.sh $ ./topo_player.sh
<パネル 1> $ ./start_device.sh TFBFilePlayer --in-file run000410.dat <パネル 2> $ ./start_device.sh fltcoin <パネル 3> $ ./start_device.sh tfdump
#!/bin/bash #host=127.0.0.1 #port=6379 #db=0 server=redis://127.0.0.1:5921/0 #function config_endpoint () { function endpoint () { # Usage: # config_endpoint "service" "channel" "parameters" echo redis-cli -u $server hset daq_service:topology:endpoint:$1:$2 ${@:3} $NESTDAQ/bin/redis-cli -u $server hset daq_service:topology:endpoint:$1:$2 ${@:3} } #function config_link () { function link () { # config_link "service1" "channel" "service2" "channel" "parameters" echo redis-cli -u $server set daq_service:topology:link:$1:$2,$3:$4 non $NESTDAQ/bin/redis-cli -u $server set daq_service:topology:link:$1:$2,$3:$4 none } echo "---------------------------------------------------------------------" echo " config endpoint (socket)" echo "---------------------------------------------------------------------" #--------------------------------------------------------------------------- # service channel options #--------------------------------------------------------------------------- endpoint STFBFilePlayer out type push method connect portRangeMin 5951 portRangeMax 5970 endpoint STFBFilePlayer dqm type push method connect portRangeMin 5951 portRangeMax 5970 endpoint Scaler in type pull method bind portRangeMin 5951 portRangeMax 5970 endpoint Scaler out type push method connect portRangeMin 5951 portRangeMax 5970 endpoint FileSink in type pull method bind portRangeMin 5951 portRangeMax 5970 endpoint ScrSink in type pull method bind portRangeMin 5951 portRangeMax 5970 echo "---------------------------------------------------------------------" echo " config link" echo "---------------------------------------------------------------------" #--------------------------------------------------------------------------- # service1 channel1 service2 channel2 #--------------------------------------------------------------------------- link STFBFilePlayer out FileSink in link STFBFilePlayer dqm Scaler in link Scaler out ScrSink in
#!/bin/bash server=redis://127.0.0.1:5921/2 function param () { # "instance":"field" "value" #echo redis-cli -u $server set parameters:$1:$2 ${@:3} #redis-cli -u $server set parameters:$1:$2 ${@:3} echo redis-cli -u $server hset parameters:$1 ${@:2} redis-cli -u $server hset parameters:$1 ${@:2} } #============================================================================== # isntance-id field value field value field value param FileSink-0 multipart true openmode create prefix data ext .dat param ScrSink-0 multipart true openmode create prefix scrdata ext .dat param Scaler-0 num-source 1 prefix scr ext .dat
#!/bin/bash #MY_TERM=xterm DAQSERVICE_URI=' --registry-uri tcp://127.0.0.1:5921/0' METRICS_URI=' --metrics-uri tcp://127.0.0.1:5921/1' CONFIG_URI=' --parameter-config-uri tcp://127.0.0.1:5921/2' DQM_URI=' --scaler-uri tcp://127.0.0.1:5921/3' #--------------------------------------------------------- if [[ $1 =~ fairmq- ]]; then BINDIR="" else BINDIR=$HOME/nestdaq/bin fi PLUGIN_LIBDIR=$HOME/nestdaq/lib PLUGIN_SEARCH_PATH=" -S '<$PLUGIN_LIBDIR'" DAQSERVICE_PLUGIN=" -P daq_service" METRICS_PLUGIN=" -P metrics" CONFIG_PLUGIN=" -P parameter_config" echo "BINDIR = $BINDIR" echo "PLUGIN_LIBDIR = $PLUGIN_LIBDIR" echo "PLUGIN_SEARCH_PATH = $PLUGIN_SEARCH_PATH" echo "DAQSERVICE_PLUGIN = $DAQSERVICE_PLUGIN" echo "METRICS_PLUGIN = $METRICS_PLUGIN" echo "CONFIG_PLUGIN = $CONFIG_PLUGIN" echo "DAQSERVICE_URI = $DAQSERVICE_URI" echo "METRICS_URI = $METRICS_URI" echo "CONFIG_URI = $CONFIG_URI" echo "DQM_URI = $DQM_URI" #============================================================================== function run_device () { local var; var+=$PLUGIN_SEARCH_PATH var+=$DAQSERVICE_PLUGIN var+=$METRICS_PLUGIN var+=$CONFIG_PLUGIN var+=$DAQSERVICE_URI var+=$METRICS_URI var+=$CONFIG_URI var+=$DQM_URI var+=" --severity debug4" if [ -n "$MY_TERM" ]; then #echo \ $MY_TERM -title $1 -e "$BINDIR/$@ $var" else #echo \ eval "$BINDIR/$@ $var" fi } run_device $@
#============================================================================== function run_device () { local var; var+=$PLUGIN_SEARCH_PATH var+=$DAQSERVICE_PLUGIN var+=$METRICS_PLUGIN var+=$CONFIG_PLUGIN var+=$DAQSERVICE_URI var+=$METRICS_URI var+=$CONFIG_URI var+=$DQM_URI var+=" --severity debug4" var+=" --service-name ScrSink" ...
$ chmod +x topology_stbplayer_scr.sh $ chmod +x mq_param_stbplayer_scr.sh $ chmod +x start_device_scr.sh $ ./topology_stbplayer_scr.sh $ ./mq_param_stbplayer_scr.sh
$ mkdir scr scrdata data
<パネル 1> $ ./start_device.sh STFBFilePlayer --wait 1000 --in-file run000408_00_stf.dat <パネル 2> $ ./start_device.sh Scaler <パネル 3> $ ./start_device_scr.sh FileSink <パネル 4> $ ./start_device.sh FileSink
ちなみに、STFBFilePlayer –wait 1000 は 1000 ms wait している。wait がないと一瞬でファイルを読んでしまう。ただし、mq_param.sh で STFBFilePlayer-0 に wait を設定していると、それで上書きされる。実行時のオプションより redis のパラメータの方が優先されるので注意。redis をクリアする必要あり。
$ cp $HOME/Downloads/SlowDash-230608.tgz $HOME/nestdaq/src/ $ cd $HOME/nestdaq/src $ tar zxvf SlowDash-230608.tgz
$ cd $HOME/nestdaq/src/SlowDash-230608/system/ $ make
# For SlowDash 2023.10.02 export PATH=${PATH}:${HOME}/nestdaq/src/SlowDash-230608/bin
$ mkdir $HOME/nestdaq/src/SlowDash-230608/Projects/Test_Redis_Histo $ cd $HOME/nestdaq/src/SlowDash-230608/Projects/Test_Redis_Histo
slowdash_project: name: RedisTest title: Redis Test, Simple version data_source: type: Redis parameters: url: redis://localhost:5921/ time_series: {db: 1} object: { db: 3 }
$ pip3 install redis $ slowdash --port=5922