rockylinux9で coot-1.x をソースから作成してみる

[root@rockylinux9 ~]# cat /etc/redhat-release
Rocky Linux release 9.6 (Blue Onyx)
 
[root@rockylinux9 ~]# dnf groupinstall "Development Tools"
[root@rockylinux9 ~]# dnf install epel-release
[root@rockylinux9 ~]# dnf config-manager --enable crb
[root@rockylinux9 ~]# dnf install --enablerepo=devel cmake texinfo gtk4-devel gfortran libepoxy-devel swig blas-devel lapack-devel re2c libpsl-devel readline-devel libjpeg-devel psl gobject-introspection-devel python3-gobject-devel
 
[root@rockylinux9 ~]# mkdir script ; cd script
 
[root@rockylinux9 script]#
[root@rockylinux9 script]# wget https://raw.githubusercontent.com/pemsley/coot/main/build-it-3-3
[root@rockylinux9 script]# vi ./build-it-3-3

「build-it-3-3」の中で修正を行います.

--- script/build-it-3-3.orig    2025-10-30 02:02:30.578448242 +0900
+++ script/build-it-3-3 2025-10-30 13:07:43.084423130 +0900
@@ -641,11 +641,11 @@
     lib_as=`cd $fat_dir && ls -1 lib/lib*.a`
 
     if [ "$clear_type" = "clear-dynamic" ] ; then
-       keep_lib_archs="$lib_as"
+       keep_lib_archs="$lib_sos"
     fi
 
     if [ "$clear_type" = "clear-static" ] ; then
-       keep_lib_archs="$lib_sos"
+       keep_lib_archs="$lib_as"
     fi
 
     file_list="etc info man share libexec  \
@@ -1053,7 +1053,7 @@
          if test -e /etc/os-release ; then
              # 20240914 strip quote marks also now
              dist_name=$(grep ^ID= /etc/os-release | sed -e 's/ID=//' -e 's/"//g')
-             dist_ver=$(grep ^VERSION_ID /etc/os-release | sed -e 's/VERSION_ID=//')
+             dist_ver=$(grep ^VERSION_ID /etc/os-release | sed -e 's/VERSION_ID=//' -e 's/"//g')
          else
              for i in fedora-release redhat-release redhat-release-workstation centos-release sl-release openSUSE-release ; do
                  rpm -q --qf '%{name}' ${i}
@@ -3168,7 +3168,7 @@
    (
    # see https://github.com/ninja-build/ninja/releases
    unset LD_LIBRARY_PATH
-   ninja_version=1.10.2
+   ninja_version=1.13.0
    ${WGET} https://github.com/ninja-build/ninja/archive/refs/tags/v$ninja_version.tar.gz
    tar xf ${AUTOBUILD_SOURCES}/v$ninja_version.tar.gz
    cd ninja-$ninja_version
@@ -3647,7 +3647,7 @@
       #    |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       # compilation terminated.
       # numpy_version=2.2.2 # hellish build complexity
-      numpy_version=1.26.4
+      numpy_version=2.3.4
       echo BUILDING numpy $numpy_version
       echo BUILDING numpy $numpy_version >&2
       (
@@ -4092,7 +4092,7 @@
           if test "$dist_name" = ubuntu ; then
               echo don.t mess with LDFLAGS here on ubuntu
           else
-              if test "$dist_name" = almalinux ; then
+              if test "$dist_name" = almalinux || test "$dist_name" = rocky ; then
                   echo don.t mess with LDFLAGS on almalinux
               else
                  if test "$dist_name" = arch ; then
@@ -5038,7 +5038,7 @@
 # 20220707-PE does this improve thie linking (get pass the problem with g_module_open_full)?
 # We get checking dynamic linker characteristics... awk: symbol lookup error: /home/pemsley/autobuild/Linux-emsley-vm-fedora-2.lmb.internal-gtk4/lib/libreadline.so.8: undefined symbol: UP
 # on fedora if LD_LIBRARY_PATH is set
-if [ "$dist_name" = fedora ] ;  then
+if [ "$dist_name" = fedora -o "$dist_name" = rocky ] ;  then
     :
 else
     if [ "$dist_name" = arch ] ;  then

これでコンパイルします.

[root@rockylinux9 script]# run_tests=true AUTOBUILD_INSTALLED=/apps/coot bash ./build-it-3-3
 :
(ケーキと紅茶)
 :
[root@rockylinux9 script]#

ですが、rockylinux9のGlibが「2.68.4」によるエラーが発生します. GLib 2.74以降に加わった「g_idle_add_once()」関数が入っているため
対応のためソースを修正します. 場所は「/root/script/coot/layla/state.cpp」です.

--- coot/layla/state.cpp.orig   2025-10-30 04:12:50.496436337 +0900
+++ coot/layla/state.cpp        2025-10-30 04:22:44.485422416 +0900
@@ -66,7 +66,7 @@
     std::string package_dir = coot::package_data_dir();
     typedef std::tuple<std::string, std::unique_ptr<InchiKeyDatabase>*> HelperTuple1;
     HelperTuple1* helper_tuple = new std::tuple(coot::util::append_dir_dir(package_dir, "data"), &this->inchi_key_database);
-    g_idle_add_once(+[](gpointer user_data){
+    g_idle_add_full(G_PRIORITY_DEFAULT_IDLE,+[](gpointer user_data) -> gboolean {
         HelperTuple1* helper_tuple = (HelperTuple1*) user_data;
         std::string inchi_key_database_path = coot::util::append_dir_file(std::get<0>(*helper_tuple), "Components-inchikey.ich");
         g_info("Loading InChIKey database from: %s", inchi_key_database_path.c_str());
@@ -104,7 +104,7 @@
             g_object_unref(G_FILE(source_object));
         }, ht2);
         delete helper_tuple;
-    }, helper_tuple);
+    }, helper_tuple, nullptr);
 
 
     g_signal_connect(canvas_widget, "smiles-changed", G_CALLBACK(+[](CootLigandEditorCanvas* self, gpointer user_data){

それで再度

[root@rockylinux9 script]# run_tests=true AUTOBUILD_INSTALLED=/apps/coot bash ./build-it-3-3
 :
(紅茶のみ)
 :
[root@rockylinux9 script]#

コンパイルが完了すると/appsに「coot」と「coot-Linux-x86_64-rocky-9.6-gtk4」が現れる

[root@rockylinux9 ~]# ls -l /apps/
total 0
drwxr-xr-x. 9 root root 96 Oct 30 14:05 coot
drwxr-xr-x. 7 root root 68 Oct 30 14:06 coot-Linux-x86_64-rocky-9.6-gtk4
[root@rockylinux9 ~]#

「/apps/coot」はbuild時に用意されてモノで、必要なファイルらを移した「/apps/coot-Linux-x86_64-rocky-9.6-gtk4」を使うものかと思うのだが、
必要なファイルが適切に移っていない模様.

取り敢えずは「/apps/cooot」を使ってみる
っでEnvironment-modulesは「/apps/modulefiles/coot」を下記のようにします.

#%Module1.0
set          root /apps/coot
prepend-path PATH            $root/bin
prepend-path LD_LIBRARY_PATH $root/lib

これをloadして「coot」と実行すると
2025y08m20d_023637416.png
そして本体の画面が表示され、そのヘルプは下記になります
2025y08m20d_023944834.png

X11越しに使うのは微妙でしょうか。コンソールで使った方が早いですね.

ubuntu24.04で

root@ubuntu24:~# apt install build-essential git cmake m4 libtool swig flex bison gfortran autoconf automake libssl-dev libblas-dev \
   liblapack-dev libncurses5-dev libjpeg-dev libgtk-4-dev libpsl-dev pkg-config  gobject-introspection python-gi-dev libgirepository-1.0-dev
 
root@ubuntu24:~#
root@ubuntu24:~# mkdir script
root@ubuntu24:~# cd script/
root@ubuntu24:~/script#
root@ubuntu24:~/script# wget https://raw.githubusercontent.com/pemsley/coot/main/build-it-3-3

下記のように「build-it-3-3」を修正します.

--- build-it-3-3.orig   2025-08-19 07:16:40.705240603 +0900
+++ build-it-3-3        2025-08-19 13:27:54.684257616 +0900
@@ -641,11 +641,11 @@
     lib_as=`cd $fat_dir && ls -1 lib/lib*.a`
 
     if [ "$clear_type" = "clear-dynamic" ] ; then
-       keep_lib_archs="$lib_as"
+       keep_lib_archs="$lib_sos"
     fi
 
     if [ "$clear_type" = "clear-static" ] ; then
-       keep_lib_archs="$lib_sos"
+       keep_lib_archs="$lib_as"
     fi
 
     file_list="etc info man share libexec  \
@@ -3057,7 +3057,7 @@
    (
    which pip3
    $python_version -m pip install --upgrade pip
-   $python_version -m pip install setuptools
+   $python_version -m pip install 'setuptools<70'
    # pip3 install pycairo
    # pip3 install pygobject
    ) >  $HOSTLOGDIR/13-pip-upgrade.txt 2>&1
@@ -3107,7 +3107,7 @@
 #
 
 # we need python3 to have setuptools for meson - sigh
-python3 -m pip install setuptools
+python3 -m pip install 'setuptools<70'
 
 build_meson=true
 if command -v meson --version ; then
@@ -3169,6 +3169,7 @@
    # see https://github.com/ninja-build/ninja/releases
    unset LD_LIBRARY_PATH
    ninja_version=1.10.2
+   ninja_version=1.12.0
    ${WGET} https://github.com/ninja-build/ninja/archive/refs/tags/v$ninja_version.tar.gz
    tar xf ${AUTOBUILD_SOURCES}/v$ninja_version.tar.gz
    cd ninja-$ninja_version
@@ -4493,7 +4494,7 @@
     echo PKG_CONFIG_PATH $PKG_CONFIG_PATH
     which pip3
     pip3 install wheel
-    pip3 install pygobject
+    pip3 install pygobject==3.48.2
     ) > $HOSTLOGDIR/34-pip-wheel-pygobject.txt 2>&1
     echo BUILDING: "done" install pygobject with pip3 >&2
 fi

そしてインストール先を「/apps/coot」として作成しますが、その後に「/apps/coot」から必要な分をコピーした「/apps/coot-Linux-x86_64-ubuntu-24.04.2-gtk4」が用意されます.
その後に「/apps/coot」を削除しても構わないです.

root@ubuntu24:~/script# AUTOBUILD_INSTALLED=/apps/coot bash ./build-it-3-3
 
root@ubuntu24:~/script# cd /apps/
root@ubuntu24:/apps# ls -l
total 8
drwxr-xr-x 8 root root 4096 Aug 19 18:46 coot
drwxr-xr-x 7 root root 4096 Aug 19 18:48 coot-Linux-x86_64-ubuntu-24.04.2-gtk4
 
root@ubuntu24:/apps# rm -rf coot
root@ubuntu24:/apps#

environment-modules
「/apps/modulefiles/coot」

#%Module1.0
set          root /apps/coot-Linux-x86_64-ubuntu-24.04.2-gtk4
prepend-path PATH            $root/bin
prepend-path LD_LIBRARY_PATH $root/lib

environment-modulesをロードしてcootと実行すると起動します。下記はヘルプ画面.

2025y08m19d_191301299.png

最新の60件
2026-01-18 2026-01-17 2026-01-16 2026-01-12 2026-01-11 2026-01-10 2026-01-09 2026-01-08 2026-01-06 2026-01-04 2026-01-01 2025-12-31 2025-12-28 2025-12-27 2025-12-12 2025-12-11 2025-12-09 2025-12-08 2025-12-07 2025-12-05 2025-11-30 2025-11-27 2025-11-24 2025-11-23 2025-11-18 2025-11-16 2025-11-05 2025-11-03 2025-11-02 2025-10-30
  • coot/source/v1
2025-10-29 2025-10-28 2025-10-26 2025-10-25 2025-10-24 2025-10-22 2025-10-21 2025-10-17 2025-10-13 2025-10-11 2025-10-06 2025-10-05

edit


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2025-10-30 (木) 14:55:16