#author("2025-03-23T03:08:18+00:00","default:sysosa","sysosa") #author("2025-12-06T16:00:28+00:00","default:sysosa","sysosa") 本家様 [[https://emcore.ucsf.edu/ucsf-software>+https://emcore.ucsf.edu/ucsf-software]] ***MotionCor3 [#z92fdd23] ここで公開 [[https://github.com/czimaginginstitute/MotionCor3>+https://github.com/czimaginginstitute/MotionCor3]] READMEに #code(nonumber){{ MotionCor3, an improved implementation of MotionCor2 with addition of CTF (Contrast Transfer Function) estimation, is a multi-GPU accelerated software package that enables single-pixel level correction of anisotropic beam induced sample motion for cryo-electron microscopy and cryo-electron tomography images. (DeepL様翻訳) MotionCor3は、MotionCor2にCTF (Contrast Transfer Function)推定を追加した改良版で、低温電子顕微鏡および 低温電子トモグラフィー画像において、ビームによる試料の動きの異方性を1ピクセルレベルで補正できる マルチGPUアクセラレーションソフトウェアパッケージです。 }} とある っでライセンスは「BSD-3-Clause license」で企業利用も大丈夫みたい. 詳細はここ[[https://github.com/czimaginginstitute/MotionCor3?tab=BSD-3-Clause-1-ov-file#BSD-3-Clause-1-ov-file>+https://github.com/czimaginginstitute/MotionCor3?tab=BSD-3-Clause-1-ov-file#BSD-3-Clause-1-ov-file]] 作り方 #code(nonumber){{ cd /apps git clone https://github.com/czimaginginstitute/MotionCor3 cd MotionCor3 make exe -f makefile11 CUDAHOME=/usr/local/cuda-11.8 ls -l /apps/MotionCor3/MotionCor3 }} Environment Modulesは「/apps/modulefiles/MotionCor3」で #code(nonumber){{ #%Module set-alias MotionCor3 /apps/MotionCor3/MotionCor3 set-alias motioncor3 /apps/MotionCor3/MotionCor3 }} とかで. ubuntu22.04でコンパイルすると 「&color(red){/usr/bin/ld: /apps/MotionCor3/Lib/libmrcfile.a(CLoadExtHeader.o): relocation R_X86_64_32 against symbol `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a PIE object; recompile with -fPIE};」と表示される 回避策としてはmakefile11を下記のようにする. #code(diff,nonumber){{ --- a/makefile11 +++ b/makefile11 @@ -162,7 +162,7 @@ exe: $(OBJS) -L$(CUDALIB) \ -L$(CONDA)/lib \ -L/usr/lib64 \ - -lcufft -lcudart -lcuda -lnvToolsExt -ltiff -lc -lm -lpthread \ + -lcufft -lcudart -lcuda -lnvToolsExt -ltiff -lc -lm -lpthread -Xcompiler -no-pie \ -o MotionCor3 @echo MotionCor3 has been generated. }} ***MotionCor2 [#z2a56beb] ライセンスにご注意ください 本家様から #code(nonumber){{ NOTE: This software may only be downloaded and used for free by academic and/or non-profit users. All others are required to contact David Agard for licensing information prior to download. }} 取得申請フォームに記載して最新版のMotionCor2をダウンロードします. 「MotionCor2_1.6.4_Mar31_2023.zip」(9.8MB) これを展開します #code(nonumber){{ mkdir /apps/MotionCor2 cd /apps/MotionCor2 unzip /apps/src/MotionCor2_1.6.4_Mar31_2023.zip rm -rf /apps/src/MotionCor2_1.6.4_Mar31_2023.zip }} 「/usr/local」に展開しているcudaライブラリに応じて複数のバイナリーが用意されています。cuda-9.2からcuda-12.1と幅広いです. ここで ldd で必要な共有ライブラリを見てみると #code(nonumber){{ [root@rockylinux9 MotionCor2]# ldd ./MotionCor2_1.6.4_Cuda121_Mar312023 linux-vdso.so.1 (0x00007ffd7b74f000) libcufft.so.11 => /usr/local/cuda/targets/x86_64-linux/lib/libcufft.so.11 (0x00007f87e4400000) libcudart.so.12 => /usr/local/cuda/targets/x86_64-linux/lib/libcudart.so.12 (0x00007f87e4000000) libcuda.so.1 => /lib64/libcuda.so.1 (0x00007f87dfa00000) libnvToolsExt.so.1 => /usr/local/cuda/targets/x86_64-linux/lib/libnvToolsExt.so.1 (0x00007f87df600000) libtiff.so.5 => /lib64/libtiff.so.5 (0x00007f87f565e000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f87f5659000) librt.so.1 => /lib64/librt.so.1 (0x00007f87f5652000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f87f564d000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f87df200000) libm.so.6 => /lib64/libm.so.6 (0x00007f87e4325000) libc.so.6 => /lib64/libc.so.6 (0x00007f87dee00000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f87f5632000) /lib64/ld-linux-x86-64.so.2 (0x00007f87f56f7000) libwebp.so.7 => /lib64/libwebp.so.7 (0x00007f87e42b8000) libzstd.so.1 => /lib64/libzstd.so.1 (0x00007f87e3f29000) libjbig.so.2.1 => /lib64/libjbig.so.2.1 (0x00007f87f5622000) libjpeg.so.62 => /lib64/libjpeg.so.62 (0x00007f87df97f000) libz.so.1 => /lib64/libz.so.1 (0x00007f87f5608000) [root@rockylinux9 MotionCor2]# }} &size(10){cuda-12-8が入ってます}; これから「libtiff.so.5」が必要なのですが、ubuntu24.04ではこの「libtiff.so.5」がOS提供パッケージから外れてます。&size(10){代わりに「libtiff.so.6」が提供されている}; なのでubuntu24.04でこのMotionCor2を使うには別途 libtiff.so.5 を含むライブラリをインストールする必要があります 作ってみる. #code(nonumber){{ root@ubuntu24:~# cat /etc/os-release PRETTY_NAME="Ubuntu 24.04.1 LTS" : root@ubuntu24:~# root@ubuntu24:~# cd /usr/local/src/ root@ubuntu24:/usr/local/src# wget https://download.osgeo.org/libtiff/tiff-4.3.0.zip root@ubuntu24:/usr/local/src# unzip -q tiff-4.3.0.zip root@ubuntu24:/usr/local/src# cd tiff-4.3.0/ root@ubuntu24:/usr/local/src/tiff-4.3.0# ls -CF aclocal.m4 ChangeLog config/ configure.ac HOWTO-RELEASE libtiff-4.pc.in Makefile.in README.md TODO autogen.sh* cmake/ config.h.in contrib/ html/ m4/ man/ RELEASE-DATE tools/ build/ CMakeLists.txt configure* COPYRIGHT libtiff/ Makefile.am port/ test/ VERSION root@ubuntu24:/usr/local/src/tiff-4.3.0# apt install build-essential root@ubuntu24:/usr/local/src/tiff-4.3.0# ./configure : Libtiff is now configured for x86_64-pc-linux-gnu Installation directory: /usr/local Documentation directory: ${prefix}/share/doc/tiff-4.3.0 C compiler: gcc -g -O2 -Wall -W C++ compiler: g++ -g -O2 Enable runtime linker paths: no Enable linker symbol versioning: no Support Microsoft Document Imaging: yes Use Win32 IO: no Support for internal codecs: CCITT Group 3 & 4 algorithms: yes Macintosh PackBits algorithm: yes LZW algorithm: yes ThunderScan 4-bit RLE algorithm: yes NeXT 2-bit RLE algorithm: yes LogLuv high dynamic range encoding: yes Support for external codecs: ZLIB support: no <-- libzip-dev libdeflate support: no <-- libdeflate-dev Pixar log-format algorithm: no <-- libzip-dev JPEG support: no <-- libjpeg-dev Old JPEG support: no <-- libjpeg-dev JPEG 8/12 bit dual mode: no <-- 「--enable-jpeg12」<-- 使用時は ISO JBIG support: no <-- libjbig-dev LERC support: no <-- liblerc-dev LZMA2 support: no <-- liblzma-dev ZSTD support: no <-- libzstd-dev WEBP support: no <-- libwebp-dev C++ support: yes OpenGL support: no root@ubuntu24:/usr/local/src/tiff-4.3.0# apt install libzip-dev libdeflate-dev libjpeg-dev libjbig-dev liblerc-dev liblzma-dev libzstd-dev root@ubuntu24:/usr/local/src/tiff-4.3.0# ./configure --enable-jpeg12 --with-jpeg12-include-dir=/usr/include root@ubuntu24:/usr/local/src/tiff-4.3.0# make -j 20 root@ubuntu24:/usr/local/src/tiff-4.3.0# make install root@ubuntu24:/usr/local/src/tiff-4.3.0# ls -CF /usr/local/bin/ fax2ps* pal2rgb* raw2tiff* tiff2pdf* tiff2rgba* tiffcp* tiffdither* tiffinfo* tiffset* fax2tiff* ppm2tiff* tiff2bw* tiff2ps* tiffcmp* tiffcrop* tiffdump* tiffmedian* tiffsplit* root@ubuntu24:/usr/local/src/tiff-4.3.0# ls -CF /usr/local/lib/ libtiff.a libtiff.so@ libtiff.so.5.7.0* libtiffxx.la* libtiffxx.so.5@ pkgconfig/ libtiff.la* libtiff.so.5@ libtiffxx.a libtiffxx.so@ libtiffxx.so.5.7.0* python3.12/ root@ubuntu24:/usr/local/src/tiff-4.3.0# }} 一応「/etc/ld.so.conf.d/libc.conf」に「/usr/local/lib」が入っているので、そのままでlibtiff.so.5は共有ライブラリとして利用できる &size(10){「/usr/local/lib/libtiff.so」は削除した方がいいのかも}; ***Rockylinux10でMotionCor2を動かしたい. [#d256584d] RHEL10系はMotionCor2の実行に必要な libtiff.so.5 が用意されてません。より最新の tiff-4.6.0 がインストールされていて「/usr/lib64/libtiff.so.6」が提供されています 故 MotionCor2 を動かしたい場合は tiff-4.4.0 をインストールする必要があります. &size(10){tiff-4.5.0 はダメ}; っで作ってみます #code(nonumber){{ [root@rockylinux10 ~]# cd /apps/src/ [root@rockylinux10 src]# wget https://download.osgeo.org/libtiff/tiff-4.4.0.tar.xz [root@rockylinux10 src]# tar xf tiff-4.4.0.tar.xz [root@rockylinux10 src]# cd tiff-4.4.0/ [root@rockylinux10 tiff-4.4.0]# ./configure --prefix=/apps/local --enable-ld-version-script [root@rockylinux10 tiff-4.4.0]# make && make install }} これで必要な「libtiff.so.5」を得ました。 当然 MotionCor2 の modulefile には LD_LIBRARY_PATH を加える修正が必要 #code(nonumber){{ #%Module prepend-path LD_LIBRARY_PATH /apps/local/lib set-alias MotionCor2 /apps/MotionCor2/MotionCor2_1.6.4_Cuda121_Mar312023 set-alias motioncor2 /apps/MotionCor2/MotionCor2_1.6.4_Cuda121_Mar312023 }}