文書の過去の版を表示しています。


CERN Program Library

CentOS 7

  • CentOS 7 に g77 と g77 でコンパイルされた cernlib をインストールした。
$ wget http://ftp.riken.jp/Linux/scientific/6.8/x86_64/os/Packages/compat-libf2c-34-3.4.6-19.el6.x86_64.rpm
$ wget http://ftp.riken.jp/Linux/scientific/6.8/x86_64/os/Packages/compat-gcc-34-3.4.6-19.el6.x86_64.rpm
$ wget http://ftp.riken.jp/Linux/scientific/6.8/x86_64/os/Packages/compat-gcc-34-g77-3.4.6-19.el6.x86_64.rpm
$ wget http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/Packages/c/cernlib-g77-2006-34.el6.x86_64.rpm
$ wget http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/Packages/c/cernlib-g77-devel-2006-34.el6.x86_64.rpm
$ wget http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/Packages/c/cernlib-g77-static-2006-34.el6.x86_64.rpm
$ wget http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/Packages/c/cernlib-g77-utils-2006-34.el6.x86_64.rpm
$ wget http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/Packages/p/paw-2006-34.el6.x86_64.rpm
$ su
# yum remove compat-libf2c-34
# yum localinstall compat-libf2c-34-3.4.6-19.el6.x86_64.rpm
# yum localinstall compat-gcc-34-3.4.6-19.el6.x86_64.rpm
# yum localinstall compat-gcc-34-g77-3.4.6-19.el6.x86_64.rpm
# yum localinstall cernlib-g77-2006-34.el6.x86_64.rpm
# yum localinstall cernlib-g77-devel-2006-34.el6.x86_64.rpm
# yum localinstall cernlib-g77-static-2006-34.el6.x86_64.rpm
# yum localinstall cernlib-g77-utils-2006-34.el6.x86_64.rpm
# yum localinstall paw-2006-34.el6.x86_64.rpm

順番をまちがえるとだめかも? インストール後、http://lnr.irb.hr/soya/physics/asdoc/chbook-example.c をダウンロードしてきてコンパイル。http://hep.fuw.edu.pl/misc/CERNLIB_from_C.html を参考に。C から cernlib を実行できた。

$ wget http://lnr.irb.hr/soya/physics/asdoc/chbook-example.c
$ gcc -c -Df2cFortran -I/usr/include/cernlib/2006/cfortran chbook-example.c
$ g77 chbook-example.o `cernlib-g77 packlib,mathlib` -o chbook-example
$ ./chbook-example
1 some random distribution                                                            PART  1 OF **
 
 HBOOK     ID =         1                                        DATE  24/12/2016            NO =     1
 
 
 CHANNELS 100   0                                                                                                  1   
           10   0        1         2         3         4         5         6         7         8         9         0   
            1   1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890   
...
...
 LOW-EDGE   1.  3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333334
            0   9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990
            0   6666666666666666666666667777777777777777777777777888888888888888888888888899999999999999999999999990
            0   0011222334445566677888990001122233444556667788899000112223344455666778889900011222334445566677888990
            0   4826048260482604826048260482604826048260482604826048260482604826048260482604826048260482604826048260
 
  * ENTRIES =     100000      * ALL CHANNELS = 0.0000E+00      * UNDERFLOW = 0.0000E+00      * OVERFLOW = 0.1000E+06
  * BIN WID = 0.4000E-03      * MEAN VALUE   = 0.0000E+00      * R . M . S = 0.0000E+00
$

Shared Library

* CERN program library はそもそも shared library (lib*.so) をサポートしないらしい(参考: https://userweb.jlab.org/~marki/cernlib_on_debian/cernlib/faq.html#33)? 公式ページでも、武内さんのバイナリでも (http://ribf.riken.jp/~takesato/research/as/ap6.html)、static library (lib*.a) しかない。

softwares/cernlib.1516429345.txt.gz · 最終更新: 2018/01/20 15:22 by kobayash
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0