-------------
 On fujiipb
-------------

MacOSX Installation

	MacOS X Release 10.0.01
	make-3.78-1a
	gcc-with-g77-2.95.2-1a
	Libc-167-1a
	Libcomapt-14.1-1a
	dlcompat-20010123-1a
	

[0] Preparation

# cd /
# rm cern
# ln -s /Users/fujiik/sandbox/hep/cernlib cern
# cd /cern
# for i in `ls <somewhere>/src_*.tar.gz`; do tar -zxvf $i; done
# cp <somewhere>/Imakefile 2000/src/
# ln -s 2000 new
# ln -s 2000 pro 
# mkdir -p 2000/work
# chown fujiik:jlc 2000/work
# chown fujiik:jlc 2000
# cd 2000/src
# patch -p1 -s < <somewhere>/cernlib-2000-macosx.patch
# vi /usr/bin/cpp
make sure cpp flags contain -D__APPLE__


# vi config/MacOSX.cf
make sure -fno-common in compiler lfags

[1] Build

$ cd /cern/2000/work
$ mkdir ../logs
$ export CVSCOSRC=/cern/2000/src
$ mkdir ../bin
$ cp $CVSCOSRC/scripts/cernlib ../bin
$ $CVSCOSRC/config/imake_boot
$ make tree HAVE_MOTIF='YES' >& ../logs/tree.log &
$ tail -f ../logs/tree.log			2001/04/27 20:02-20:05
^C

$ cd packlib/kuip/programs/kuipc
$ make
$ make install.bin
$ cd /cern/2000/work

$ make HAVE_MOTIF='YES' >& ../logs/make.log &		
$ tail -f ../logs/make.log			2001/04/27 20:11-22:17

$ cd packlib
$ make install.bin HAVE_MOTIF='YES' >& ../../logs/packlib.bin.log & 
$ tail -f ../../logs/packlib.bin.log		2001/04:27 22:20-22:25

$ cd ../pawlib
$ make install.bin HAVE_MOTIF='YES' >& ../../logs/pawlib.bin.log &  
$ tail -f ../../logs/pawlib.bin.log		2001/04/27 22:26-22:
......
g77 -o paw++ -O -fPIC -funroll-loops -fomit-frame-pointer -fno-automatic -fno-se
cond-underscore -fno-f90 -fugly-complex -fno-globals -fugly-init -Wno-globals   
  -L/cern/pro/src/lib 0pamainm.o      `cernlib pawlib graflib/Motif packlib math
lib kernlib` -L/usr/X11R6/lib \
|| rm -f paw++
/usr/bin/ld: warning -L: directory name (/cern/pro/src/lib) does not exist
/usr/bin/ld: warning table of contents of library: /cern/pro/lib/libpawlib.a not
 sorted slower link editing will result (use the ranlib(1) -s option)
/usr/bin/ld: warning table of contents of library: /cern/pro/lib/libgraflib.a no
t sorted slower link editing will result (use the ranlib(1) -s option)
/usr/bin/ld: warning table of contents of library: /cern/pro/lib/libgrafX11.a no
t sorted slower link editing will result (use the ranlib(1) -s option)
/usr/bin/ld: warning table of contents of library: /cern/pro/lib/libpacklib.a no
t sorted slower link editing will result (use the ranlib(1) -s option)
/usr/bin/ld: warning table of contents of library: /cern/pro/lib/libmathlib.a no
t sorted slower link editing will result (use the ranlib(1) -s option)
/usr/bin/ld: warning table of contents of library: /cern/pro/lib/libkernlib.a no
t sorted slower link editing will result (use the ranlib(1) -s option)
/usr/bin/ld: Undefined symbols:
_f__xargc
_f__xargv
Error: paw++ not executable
gmake[2]: *** [paw++] Error 1
gmake[2]: Leaving directory `/cern/2000/work/pawlib/paw/programs'
gmake[1]: *** [install.bin] Error 2
gmake[1]: Leaving directory `/cern/2000/work/pawlib/paw'
make: *** [install.bin] Error 2

Strange. _f__xargc and _f__xargv are globals defined in setarg.o of libg2c.a
and setarg.o is referred to by g77's main function to pass argc and argv's 
from command line to fortran program by setting them to these globals.
It is hard to understand why on earth setarg.o is not linked.

This was due to OpenMotif's libXm.a.
Lesstif's libXm.a worked OK.



$ 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

$ su
# tar -zxvf <somewhere>/patchy-4.15-bin.tar.gz -C /
# exit
$ cd patchy
$ PATH=.:$PATH make install.bin HAVE_MOTIF='YES' >& ../../logs/patchy.bin.log & 
$ tail -f ../../logs/patchy.bin.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!
        but remember you remove lepto63 from testlibdir.
        pythia had to be compiled with -O0, otherwise it gets into an infinite loop

$ 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 2000/tgz
# tar -zcvf 2000/tgz/cernlib2000-bin.tar.gz 2000/bin
# tar -zcvf 2000/tgz/cernlib2000-lib.tar.gz 2000/lib
# tar -zcvf 2000/tgz/cernlib2000-include.tar.gz 2000/include
# tar -zcvf 2000/tgz/cernlib2000-share.tar.gz 2000/share
