CERNLIB, Dis45, and TDR on MacOS X

Of course, you need to install X11 (XFree86 or Xtools) beforehand.

Preparation: libdl (dlopen, ...) by Christoph Pfisterer

MacOS X does not support SysV style dynamic loading facility like dlopen, etc. A wrapper called "dlcompat" for SysV compatibility has been developed and is maintained by Peter O'Gorman (see http://www.opendarwin.org/projects/dlcompat/). Notice also that as of CERNLIB v.2001, lapack routines have been removed from mathlib. One thus needs to install the lapack and blas libraries, too:

# rpm -ivh dlcompat-20021001-1a.ppc.rpm
# rpm -ivh lapack-3.0-12b.ppc.rpm
# rpm -ivh blas-3.0-12b.ppc.rpm

If you just want to use precompiled binary packages, go directly to  Installation subseciton.
 

CERNLIB-2002 Building Procedure

Compilation Conditions
 MacOS X Release 10.1
 gcc-with-g77-1175-1b
 Libcompat-14.1-2b
 dlcompat-20021001-1a
 lapack-3.0-12b
 blas-3.0-12b
Notice that as of CERNLIB v.2001, lapack routines have been removed from mathlib. One thus need to install the lapack and blas libraries as indicated above.

[0] Preparation

# cd /
# rm cern
# ln -s /Users/cernlib cern
# cd /cern
# for i in `ls <somewhere>/src_*.tar.gz`; do tar -zxvf $i; done

The following trick was necessary, because HFS+ is a case-insensitive file system:-(
 

# pushd 2003/src/mclibs/pdf/spdf
# for i in ctq4* ; do new=`echo $i | tr [A-Z] [a-z] | sed -e 's;\.f;.F;'`; if [ $new != $i ]; then mv $i $new; fi; done
# popd
 

# cp <somewhere>/Imakefile 2003/src
# ln -s 2003 new
# ln -s 2003 pro
# mkdir -p 2003/work
# chown fujiik:jlc 2003/work
# chown fujiik:jlc 2003
# cd 2003/src
# patch -p1 -s < <somewhere>/cernlib-2003-macosx.patch
# patch -p1 -s < <somewhere>/cernlib-2003-macosx.patch4
# exit


[1] Build

$ cd /cern/2003/
$ chown fujiik lib

$ ln -s /usr/local/lib/liblapack.a lib/liblapack3.a

$ ln -s /usr/local/lib/libblas.a lib/.

$ cd work

$ export CVSCOSRC=/cern/2003/src
$ mkdir ../bin

$ cp $CVSCOSRC/scripts/cernlib ../bin/
$ $CVSCOSRC/config/imake_boot
$ mkdir ../logs

$ make tree HAVE_MOTIF='YES' >& ../logs/tree.log &
$ tail -f ../logs/tree.log
^C
$ pushd packlib/kuip/programs/kuipc
$ make
$ make install.bin
$ popd
$ make HAVE_MOTIF='YES' >& ../logs/make.log &

$ tail -f ../logs/make.log
^C
$ cd packlib

$ make install.bin HAVE_MOTIF='YES' >& ../../logs/packlib.bin.log &
$ tail -f ../../logs/packlib.bin.log
$ cd ../pawlib

$ make install.bin HAVE_MOTIF='YES' >& ../../logs/pawlib.bin.log &
$ tail -f ../../logs/pawlib.bin.log
$ cd ../graflib

$ make install.bin HAVE_MOTIF='YES' >& ../../logs/graflib.bin.log &
$ tail -f ../../logs/graflib.bin.log
$ cd ../scripts

$ make install.bin HAVE_MOTIF='YES' >& ../../logs/scripts.bin.log &
$ tail -f ../../logs/scripts.bin.log
$ cd ..
$ make install.include CERN_INCLUDEDIR=/cern/new/include \
  >& ../logs/install.include.log &
$ tail -f ../logs/install.include.log

[2] Tests

$ cd packlib
$ make test >& ../../logs/packlib.test.log &
$ tail -f ../../logs/packlib.test.log
               ALL TESTS PASSED!
$ cd ../mathlib
$ make test >& ../../logs/mathlib.test.log &
$ tail -f ../../logs/mathlib.test.log
       ALL TESTS but C327 PASSED!
$ cd ../graflib/higz/examples
$ make higzex
$ ./higzex
             OK!
$ cd ../../../../src/pawlib/paw/demo
$ paw all.kumac
...
go
...
 OK!
$ cd ../../../../work/mclibs
$ make test >& ../../logs/mclibs.test.log &
$ tail -f ../../logs/mclibs.test.log
          ALL TESTS PASSED!
$ cd ../phtools
$ make test >& ../../logs/phtools.test.log &
$ tail -f ../../logs/phtools.test.log
      ALL TESTS PASSED!
$ cd ../geant321
$ make test >& ../../logs/geant321.test.log &
$ tail -f ../../logs/geant321.test.log
                ALL TESTS PASSED!

[3] Aftermath

# cd /home/cernlib
# chown -R root:wheel *
# mkdir 2003/tgz
# tar -zcvf 2003/tgz/cernlib-2003-bin.tar.gz 2003/bin
# tar -zcvf 2003/tgz/cernlib-2003-lib.tar.gz 2003/lib
# tar -zcvf 2003/tgz/cernlib-2003-include.tar.gz 2003/include
# tar -zcvf 2003/tgz/cernlib-2003-share.tar.gz 2003/share
 

Installation of Binary Packages

CERNLIB

To install, just expand the tarballs in whatever directory you want, for instance:

# ls <somewhere>
cernlib-2003-bin.tar.gz
cernlib-2003-include.tar.gz
cernlib-2003-lib.tar.gz
cernlib-2003-share.tar.gz
# mkdir /cern
# for i in <somewhere>/*; do tar -zxpvf $i -C /cern; done
# ln -s 2003 /cern/pro

Dis45

# rpm -ivh <somewhere>/dis45-1.36-3c.ppc.rpm

Topdrawer

# rpm -ivh <somewhere>/tdr-1.7-2b.ppc.rpm

or

# rpm -ivh <somewhere>/topdraw-1.4c-1c.ppc.rpm


Back to Keisuke Fujii's HEP on X Page
keisuke.fujii@kek.jp October16, 2002