CERNLIB

CERNLIB in Fedora

 * CERN Program Library
 * http://cernlib.web.cern.ch/cernlib/
 * https://www-zeuthen.desy.de/linear_collider/cernlib/new/cernlib_2005.html

-rw-rw-r-- 1 musinsky musinsky 28974483 2010-05-05 20:29:33 cernlib-2006-35.fc14.src.rpm -rw-r--r-- 1 musinsky musinsky   59057 2010-05-05 18:46:36 cernlib.spec %changelog * Wed May 05 2010 Jon Ciesla  2006-35 - Apply debian cernlib 2006.dfsg.2-14 patchset.
 * Posledny udrziavany balik CERNLIB bol v Fedore 14 cernlib-2006-35.fc14.src.rpm
 * Tento CERNLIB balik je stale pritomny v Koji RPM building and tracking system
 * https://kojipkgs.fedoraproject.org/packages/cernlib/2006/35.fc14/src/cernlib-2006-35.fc14.src.rpm
 * Source rpm baliky (koji a archive) su absolutne identicke, minimalny rozdiel vo velkosti je sposobeny inymi casmi build-ovania (a teda ina Signature vnutri balika). Fungujem dalej s Koji source rpm balikom
 * Original subor a posledny  v nom
 * Fedora balik pouziva pre-patch-ovanu verziu CERNLIB 2006 z Debian distribucie (aka new Debian's cernlib) s poslednym patchset-om

Build CERNLIB 2006 in Fedora
$ dnf builddep cernlib-2006-35.fc14.src.rpm $ rpmbuild --rebuild cernlib-2006-35.fc14.src.rpm $ cp -p $HOME/rpmbuild/SPECS/cernlib.spec $HOME/rpmbuild/SPECS/cernlib.spec.orig
 * Instalacia zavislosti (ako root)
 * Zaciname s build-ovanim cernlib (dalej vsetko ako user)
 * 1) many errors
 * Vsetky subory su teraz v vratane
 * Zaciname build-ovat a postupne patch-ovat spec file

error01
$ rm -rf $HOME/rpmbuild/BUILD/; rpmbuild -ba $HOME/rpmbuild/SPECS/cernlib.spec

+ sed -i.optflags -e 's/FOPT \+=.*/FOPT = "-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection"/' -e 's/COPT \+=.*/COPT = "-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE"/' p4boot.sh sed: -e expression #1, char 183: unknown option to `s'
 * Nekorektna zamena a  parametrov v subore
 * vo vyraze pouziva premenu, ktora obsahuje slash(es) (char / ), riesenie je pouzit alternativny regex delimiter, t.j. namiesto pouzit
 * edit lines 918, 919 ( alebo obidva riadky s prikazom sed zakomentovat, kompilacia prejde)

error02
$ rm -rf $HOME/rpmbuild/BUILD/; rpmbuild -ba $HOME/rpmbuild/SPECS/cernlib.spec

gfortran -c -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -m-cypatch.f gfortran: fatal error: no input files Fortran   name : gfortran Fortran options : -c -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -m-c CC   name : cc             CC options : -c -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -m
 * Chybne generovanie Fortran a CC options programom
 * Su to presne tie options, ktore boli zamenene (uz korektne) pri rieseni predchadzajuceho problemu error01
 * Tieto options su zjavne "umelo useknute", co je sposobene malou hodnotou velkosti parametra pola v subore  (dlzka options string je cca 350 znakov)
 * add line 920

!!! POZOR !!! teoreticky mozno obidva riadky s prikazom zakomentovat. Vyriesi sa naraz error01 aj error02. Kompilacia prejde, ale bude s inymi options ako kompilacia ostatneho kodu. Options zo suboru set FOPT  = "-O2"                # Fortran compiler options set FOPTC = "-c $FOPT -posix" set COPT  = "-O2"                # C compiler options set COPTC =  "-c $COPT -posix" set FOPT = "-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection" set FOPTC = "-c $FOPT -posix" set COPT = "-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE" set COPTC =  "-c $COPT -posix"
 * default hodoty
 * zamiename na (po patch-ovani)

error03
$ rpmbuild -ba $HOME/rpmbuild/SPECS/cernlib.spec

In file included from /home/musinsky/rpmbuild/BUILD/cernlib-2006/2006/src/packlib/kuip/kuip/kuip.h:10, from /home/musinsky/rpmbuild/BUILD/cernlib-2006/2006/src/packlib/kuip/programs/kuipc/kuipcc.c:46: /home/musinsky/rpmbuild/BUILD/cernlib-2006/2006/src/packlib/kuip/kuip/kstring.h:77:14: error: conflicting types for 'strfromd' extern char* strfromd( double d, size_t prec ); ^~ In file included from /home/musinsky/rpmbuild/BUILD/cernlib-2006/2006/src/packlib/kuip/kuip/ksys.h:419, from /home/musinsky/rpmbuild/BUILD/cernlib-2006/2006/src/packlib/kuip/kuip/kuip.h:9, from /home/musinsky/rpmbuild/BUILD/cernlib-2006/2006/src/packlib/kuip/programs/kuipc/kuipcc.c:46: /usr/include/stdlib.h:212:12: note: previous declaration of 'strfromd' was here extern int strfromd (char *__dest, size_t __size, const char *__format,           ^~

BuildRequires: gcc-gfortran BuildRequires: /usr/bin/g77

BuildRequires => dnf install libnsl2-devel => resp. => /usr/lib64/libnsl.so

sed -i 's|printf (flis_name|printf ("\%s", flis_name|' src/packlib/kuip/code_kuip/kmenu.c
 * 1) chybne generovanie nazvov suborov v subore
 * 2) riesenie dodat do  pred, line