$ cat /etc/os-release NAME="AlmaLinux" VERSION="9.2 (Turquoise Kodkod)" ID="almalinux" ID_LIKE="rhel centos fedora" VERSION_ID="9.2" PLATFORM_ID="platform:el9" PRETTY_NAME="AlmaLinux 9.2 (Turquoise Kodkod)" ANSI_COLOR="0;34" LOGO="fedora-logo-icon" CPE_NAME="cpe:/o:almalinux:almalinux:9::baseos" HOME_URL="https://almalinux.org/" DOCUMENTATION_URL="https://wiki.almalinux.org/" BUG_REPORT_URL="https://bugs.almalinux.org/" ALMALINUX_MANTISBT_PROJECT="AlmaLinux-9" ALMALINUX_MANTISBT_PROJECT_VERSION="9.2" REDHAT_SUPPORT_PRODUCT="AlmaLinux" REDHAT_SUPPORT_PRODUCT_VERSION="9.2"
$ gcc --version gcc (GCC) 11.3.1 20221121 (Red Hat 11.3.1-4) ...
$ sudo dd if=./AlmaLinux-9.1-x86_64-dvd.iso of=/dev/sdX status=progress $ sync
# dnf groupinstall "Server with GUI" # systemctl set-default graphical.target
# dnf groupinstall "Development Tools" # dnf install emacs
# useradd nestdaq # passwd nestdaq Changing password for user nestdaq. New password: Retype new password: # usermod -aG wheel nestdaq
$ su Password: # systemctl stop firewalld # systemctl disable firewalld Removed "/etc/systemd/system/multi-user.target.wants/firewalld.service". Removed "/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service". # systemctl status firewalld ○ firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; prese> Active: inactive (dead) Docs: man:firewalld(1) ...
$ pwd /home/nestdaq $ mkdir -p nestdaq/src $ cd nestdaq/src $ git clone https://github.com/redis/redis.git $ cd redis $ git checkout -b 6.0.16 6.0.16 $ make PREFIX=$HOME/nestdaq $ make PREFIX=$HOME/nestdaq install
$ mkdir $HOME/nestdaq/etc $ cp $HOME/nestdaq/src/redis/redis.conf $HOME/nestdaq/etc
$ emacs $HOME/nestdaq/etc/redis.conf #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 $ make $ mkdir $HOME/nestdaq/lib $ cp $HOME/nestdaq/src/RedisTimeSeries/bin/linux-x64-release/redistimeseries.so $HOME/nestdaq/lib/
$ make deps/readies/mk/main:49: *** Cannot find python3 interpreter. You can install one by running 'make setup'.. Stop.
と言われた。
$ ./deps/readies/bin/getpy3
を実行すればよい? (参考: https://github.com/RedisLabsModules/readies/issues/101 ) ただ、sudo になれず失敗した気もする。getpy3 を実行したり、sudoers に nestdaq を追加したり、ログアウトしてログインしなおしたりと色々したらエラーなく make できるようになった。何が効いたかよくわからない。
$ su Password: # dnf install zstd libzstd-devel ... Package zstd-1.5.1-2.el9.x86_64 is already installed. Package libzstd-devel-1.5.1-2.el9.x86_64 is already installed. ...
$ su Password: # dnf install python python3-devel # exit $ 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 $ git submodule update --init --recursive $ time ./bootstrap.sh $ time ./b2 install \ link=static,shared \ threading=single,multi \ cxxstd=17 \ variant=release,debug \ --layout=tagged \ -j50 \ --prefix=$HOME/nestdaq ... ...updated 20718 targets... real 8m22.452s user 104m50.154s sys 8m11.127s
... - Has Large File Support : yes [4] - Has attribute init_priority : yes [4] warning: No python installation configured and autoconfiguration note: failed. See http://www.boost.org/libs/python/doc/building.html note: for configuration instructions or pass --without-python to note: suppress this message and silently skip all Boost.Python targets - libbacktrace builds : no [4] - libbacktrace builds : no [6] ...
... ./boost/python/detail/wrap_python.hpp:57:11: fatal error: pyconfig.h: No such file or directory
... ... mkdir: cannot create directory ‘/home/nestdaq/nestdaq/lib’: Not a directory ...
$ su Password: # dnf install cmake # cmake --version cmake version 3.20.2 ... # exit
$ 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 -j50 ... real 0m9.800s user 4m16.739s sys 0m30.115s $ make install
$ 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 -j50 $ 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 -j50 ... real 0m21.608s user 1m2.594s sys 0m2.767s $ 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 -j50 ... real 1m41.157s user 14m14.481s sys 0m42.518s $ make install
$ cd $HOME/nestdaq/src $ git clone https://github.com/redis/hiredis.git $ cd hiredis $ time make PREFIX=$HOME/nestdaq install ... real 0m2.300s user 0m2.123s sys 0m0.173s
$ 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 install ... real 0m57.939s user 0m54.182s sys 0m3.452s
$ 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 -j50 install ... real 0m18.452s user 2m23.000s sys 0m9.292s
$ cd $HOME/nestdaq/bin $ wget https://downloads.redisinsight.redislabs.com/latest/redisinsight-linux64 $ chmod +x redisinsight-linux64 $ ./redisinsight-linux64 <なにも表示されなければOK。Ctrl-Cで殺す。殺したときはいろいろ言われる。> $
$ mkdir $HOME/run
$ cd $HOME/run $ emacs nestdaq.sh
中身は以下。
#!/bin/sh export NESTDAQ=$HOME/nestdaq export PATH=$NESTDAQ/bin:$PATH
さらに、.bashrc に以下の行を追記。
# For NestDAQ 2023.06.09 source $HOME/run/nestdaq.sh
$ cd $HOME/run $ emacs init.sh
中身は以下。
#!/bin/sh redis-server $NESTDAQ/etc/redis.conf --loadmodule $NESTDAQ/lib/redistimeseries.so RIHOST=0.0.0.0 redisinsight-linux64 & #daq-webctl >& $NESTDAQ/log/daq-webctl.log & daq-webctl >& /dev/null &
さらに、実行権限を付与
$ chmod +x ./init.sh
$ cd $HOME/run $ cp $HOME/nestdaq/scripts/*.sh ./
cd $HOME/run
$ source $HOME/.bashrc $ ./init.sh
2回以上 ./init.sh を実行すると、以下のようなエラーが出る。
$ ERROR 2023-07-09 00:50:12,338 redisinsight_startup Error running web app Traceback (most recent call last): File "startup.py", line 138, in run_web_app ... OSError: [Errno 98] Address already in use ERROR 2023-07-09 00:50:12,338 redisinsight_startup Error in main() Traceback (most recent call last): File "startup.py", line 565, in main ... OSError: [Errno 98] Address already in use [149481] Failed to execute script 'entry.prod' due to unhandled exception!
もし間違って .init.sh を複数回実行した場合、redis と daq-webctl のプロセスを殺す。プロセスの殺し方は色々あるが、
$ killall redis-server $ killall redisinsight-linux64 $ killall daq-webctl
とすれば、全部殺せる。このようなスクリプトを用意しておいても良いかも。または、init.sh を編集し、すでにプロセスが立ち上がっていたら新たに立ち上げないとか、既存のプロセスを殺してから立ち上げるとか、賢い感じに編集しても良い。
$ su Password: # dnf install tigervnc tigervnc-server # emacs /etc/selinux/config #SELINUX=enforcing SELINUX=disabled # reboot
ちなみに、SELinux を殺さない場合、macOS からVNCクライアント (RealVNCの VNC Viewer) でログインはできてデスクトップも表示されるが、ウィンドウを立ち上げようとすると、以下のようなエラーが出てvncserverが落ちる。
On no! Something has gone wrong. A problem has occurred and the system can't recover. Please log out and try again. [ Log Out ]
$ su Password: # dnf install tmux # exit
--------------------------------------- $ ./topology-1-1.sh ... --------------------------------------- $ ./start_device.sh Sampler ... --------------------------------------- $ ./start_device.sh Sink ... ---------------------------------------