#author("2025-09-26T04:02:43+00:00","default:sysosa","sysosa") #author("2025-09-27T16:38:11+00:00","default:sysosa","sysosa") 本家様 [[https://posit.co/>+https://posit.co/]] &size(10){昔は[[https://rstudio.com/>+https://rstudio.com/]]だったのだが、変わったみたい}; Rの被せものなRStudio Desktop &size(10){よくrstudio とのみいいますが、正式にはRStudio Desktopみたい}; Rを使うならRStudio Desktop経由で使った方が断然楽 &size(10){ってまずはその「R」のインストールが必要でそれは [[R]]参照で}; ***RStudio Desktopのインストール(その1) [#abed6809] 自身のホームディレクトリにインストールして使うなら「Zip/Tarballs」版を入手します [[https://posit.co/download/rstudio-desktop/>+https://posit.co/download/rstudio-desktop/]]から「Zip/Tarballs」欄に移って ubuntu18.04LTS、ubutu20.04LTSは「Ubuntu 18+/Debian 10+」の「RSTUDIO-2022.07.2-576-AMD64-DEBIAN.TAR.GZ」をクリック RHEL7系(CentOS7)やRHEL8系(RockyLinuxら)は「Fedora 19/Red Hat 7」の「RSTUDIO-2022.07.2-576-X86_64-FEDORA.TAR.GZ」をクリックしてインストールバイナリを入手します インストール先がubuntu20.04なので「rstudio-2022.07.2-576-amd64-debian.tar.gz」(184MB)を取得 #code(nonumber){{ saber@ubuntu:~$ cat /etc/os-release |grep VERSION= VERSION="20.04.5 LTS (Focal Fossa)" saber@ubuntu:~$ wget https://download1.rstudio.org/desktop/bionic/amd64/rstudio-2022.07.2-576-amd64-debian.tar.gz (インストール先は$HOME/appsの中) saber@ubuntu:~$ mkdir apps saber@ubuntu:~$ tar -xf rstudio-2022.07.2-576-amd64-debian.tar.gz -C ./apps (パス設定) saber@ubuntu:~$ export PATH=$HOME/apps/rstudio-2022.07.2+576/bin:$PATH }} っで実行してみる #code(nonumber){{ saber@ubuntu:~$ module load R saber@ubuntu:~$ which R /apps/R-4.2.2/bin/R saber@ubuntu:~$ rstudio }} 暫くすると画面が表示されます &ref(2022y12m03d_221848695.png,nolink,60%); ***RStudio Desktopのインストール(その2) [#id08523e] ユーザ自身がRStudioをダウンロードして利用されるのもいいのですが、10人、20人とダウンロードされるとストレージも肥大します 共有の場所に置くものありかなと思います なら提供されているrpmファイルで入れてしまうのも手なのですが、RStudioのバージョンが選べない. RStudioが最新になってrpmでインストールすると前のバージョンが消えてしまう. 新しいバージョンは前のバージョンの上位互換がなされていると思うので、どんどん更新しても宜しいと思いますが、インターフェイスが前の方がいいとかで残した方がいいときもある. なのでrpmではいれず、tar.gzを使って /apps にいれます #code(nonumber){{ root@ubuntu:~# wget https://download1.rstudio.org/desktop/bionic/amd64/rstudio-2022.07.2-576-amd64-debian.tar.gz root@ubuntu:~# mkdir /apps root@ubuntu:~# tar -xf rstudio-2022.07.2-576-amd64-debian.tar.gz -C /apps }} あとは[[EnvironmentModules]]を設定します #code(nonumber){{ root@ubuntu:~# mkdir /apps/modulefiles/RStudio root@ubuntu:~# vi /apps/modulefiles/RStudio/2022.07.2-576 #%Module1.0 #module load R set RS /apps/rstudio-2022.07.2+576 prepend-path PATH $RS/bin root@ubuntu:~# root@ubuntu:~# (RStudio既定のバージョンを指定) root@ubuntu:~# vi /apps/modulefiles/RStudio/.version #%Module1.0 set ModulesVersion 2022.07.2-576 root@ubuntu:~# }} 使う際はまずRを呼び出して、RStudioも読み込む. EnvironmentModulesのRStudio内に「module load R」とか書けばいいのでしょうが、、お好みで. ***メモ [#qd0854d1] RStudioDesktopを実行したら下記のようねメッセージが表示される. 恐らくSSHらでリモートマシンにログインされてRStudioを起動されたと思います X11を通すためにも「ssh <マシン名> -X」とかいれてリモートアクセスすれば解消されるかと &size(10){「ssh <マシン名> -XY」でもいいのかも}; #code(nonumber){{ saber@ubuntu:~$ rstudio (略 qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb. Aborted (core dumped) saber@ubuntu:~$ }} RStudioDesktopを実行して画面は表示されるが、何も映っていない. その際は「~/.config/RStudio/desktop.ini」に下記を加える. &size(10){「~/.config/RStudio/desktop.ini」は「RStudio Desktop」(rstudio)を起動したときに作られる}; #code(nonumber){{ [General] cookies=@Invalid() desktop.renderingEngine=software }} &color(red){*};&size(10){multi-user.targetではだめみたい. graphical.target で稼働が必要みたい}; ***めも [#uebf7e02] [[https://github.com/rstudio/rstudio/issues/13959>+https://github.com/rstudio/rstudio/issues/13959]] #code(nonumber){{ (GL関係のエラーメッセージが表示されたら下記で実行します) rstudio --use-gl=angle }} ***ソースから構築 [#mc42f12e] 2025.05.0から RHEL8系 のrpm/tarファイルの提供が終わってしまった. 2024.12.1 はok [[https://dailies.rstudio.com/version/2024.12.1+563.pro5/>+https://dailies.rstudio.com/version/2024.12.1+563.pro5/]]. その次の 202505.0からなし [[https://dailies.rstudio.com/version/2025.05.0+496.pro5/>+https://dailies.rstudio.com/version/2025.05.0+496.pro5/]] なのでソースから構築したいと思う #code(nonumber){{ [root@rockylinux8 ~]# cat /etc/redhat-release Rocky Linux release 8.10 (Green Obsidian) [root@rockylinux8 ~]# [root@rockylinux8 ~]# cd /apps/src/ [root@rockylinux8 src]# [root@rockylinux8 src]# git clone https://github.com/rstudio/rstudio [root@rockylinux8 src]# cd rstudio/ [root@rockylinux8 rstudio]# git tag | tail -n 3 v2025.05.0+496 v2025.05.1+513 v2025.09.0+387 [root@rockylinux8 rstudio]# [root@rockylinux8 rstudio]# git checkout v2025.09.0+387 [root@rockylinux8 rstudio]# git branch * (HEAD detached at v2025.09.0+387) main [root@rockylinux8 rstudio]# : : : }} #code(nonumber){{ [root@rockylinux8 rstudio]# mkdir build && cd build [root@rockylinux8 build]# cmake .. -DRSTUDIO_TARGET=Electron -DRSTUDIO_PACKAGE_BUILD=1 -DCMAKE_INSTALL_PREFIX=/apps/rstudio-v2025.09.0+387 }} っがいろいろ手を尽くしたが無理でした...