Installing Fink Cernlib And G77 For Mac

Of course, you need to install X11 beforehand.

  1. Installing Fink Cernlib And G77 For Macbook Pro
  2. Installing Fink Cernlib And G77 For Mac Os
  3. Installing Fink Cernlib And G77 For Mac Osx

$ fink configure. In which you must select the use of the 'unstable' branch of packages in order to get access to numpy, etc. This is not sketchy in the way that it sounds! Then run $ fink selfupdate. Which may take a LONG time to complete. Then run $ fink index $ fink scanpackages $ fink install scipy-py26 $ fink install matplotlib-py26 $ fink. There is an impressive number of applications you can install via fink. Fink was designed carefully as to not disturb or modify the system. It can be uninstalled with a single command 'sudo rm -r /sw' You definitely want f77, imagemagick, ghostscript for X, ispell, xdvi, and gimp if you want to edit graphics or xv to preview them. Installing Fink Cernlib And G77 For Mac Dbz Big Green Dub Downloader Funshion In English Elena Rotter Duffy Warwick Avenue Midi For Synthesia Download the IOS file. Open GNS3 and click Edit file menu and from sub-menu click Preferences. Navigate to Dynamips- IOS routers option in left pane and click New button in right pane. CNS 1.2.1 on OS X Main Points. CNS 1.2.1 is the current version of CNS.Download it and install it in /usr/local or /usr/local/xtal to get it to work with the scripts listed below. You can get a CNS intel binary directly from the CNS website; CNS 1.2, which is slightly older, is available as a pre-compiled, optimized, universal binary from David Gohara; My highly unofficial (local) fink.

Preparation: lapack

Notice that as of CERNLIB v.2001, lapack routines have been removed from mathlib. You thus need to install the lapack and blas libraries:
# rpm -Uvh lapack-3.0-12c.ppc.rpm
# rpm -Uvh blas-3.0-12c.ppc.rpm

In addition if you want to use paw++, you need OpenMotif libraries:
# rpm -Uvh OpenMotif-2.2.2-1a.ppc.rpm
# rpm -Uvh OpenMotif-devel-2.2.2-1a.ppc.rpm
If you just want to use precompiled binary packages, go directly to Installation subsection.

CERNLIB-2003 Building Procedure

Compilation Conditions
MacOS X Release 10.3
gcc-with-g77-1495-2b
Libcompat-14.1-2c
lapack-3.0-12c
blas-3.0-12c
OpenMotif-2.2.2-1a
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

# cp <somewhere>/Inaccessible 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.10.3.patch
# patch -p1 -s < <somewhere>/cernlib-2003-macosx.O0.patch

# exit

where the last patch is to compile everything with -O0 (no optimization) for safety, though the situation with the tests described below was unaffected even without it.
Notice that the first patch has also been updated because of the following problems:

  1. The dlsym function in the system default libdl.dylib now looks for a symbol in the given dylib after putting a leading underscore to the symbol. This is the standard behavior, but different from that of the old dlcompat package for 10.2.The previous patch to pawlib/comis/code/csaddr.F became thus obsolete.
  2. The test programs for mclibs/lepto63 (demo.F, demo2.F) had to be patched to declare the lepto63 block data (LEPTOD) to be EXTERNAL. Otherwise, the block data would remain uninitialized and the program get in an infinite loop.

[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

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
# mkdir /cern
# for i in <somewhere>/*; do tar -zxpvf $i -C /cern; done
# ln -s 2003 /cern/pro

Dis45

# rpm -Uvh <somewhere>/dis45-1.36-3d.ppc.rpm

Topdrawer

# rpm -Uvh <somewhere>/tdr-1.7-2c.ppc.rpm
or
# rpm -Uvh <somewhere>/topdraw-1.4d-1d.ppc.rpm
Back to Keisuke Fujii's HEP on X Page keisuke.fujii@kek.jp January13, 2004

Note: Article to compile GAMIT/GLOBK v10.3.x on Mac PPC & Intel here. It’s much easier now to compile.

GAMIT and GLOBK are a comprehensive suite of programs for analyzing GPS measurements primarily to study crustal deformation.This page is a resource to compile and install GAMIT/GLOBK for Mac OS X.

Installation instructions for GAMIT/GLOBK 10.21 (PowerPC)

Software Requirements:

  • Apple XCode development environment (Xcode 2.4.1 for Mac OS X 10.4.x)
  • Apple X11 installed in /Applications/Utilites (from your Mac OSX Install DVD/CD)
  • A FORTRAN compiler customized GNU Fortran g77 (do not use Fink’s g77 in /sw/bin/)
  • A user with ‘Admin’ rights

We first need to install Apple’s XCode development environment, then build a customized GNU77 Fortran, edit some GAMIT/GLOBK config files to get a succesful compilation.

Apple XCode installation

Mac

Installing Fink Cernlib And G77 For Macbook Pro

  1. Download and install the latest Apple XCode development environment (free registration required) from Apple’s Developer Connection website.
  2. Open ‘Terminal’ (from /Applications/Utilities/)

Built a customized GNU77 FORTRAN compiler (for PowerPC Macs only !!!)

This process is necessary as the default version of gcc/g77 only allows a maximum unit number (MXUNIT) of 99, while GLOBK requires a MXUNIT of 9999.Create the installation directory for your FORTRAN compiler:
% mkdir /usr/local/g77
Download gcc version 3.4.6 (latest version in the 3.4 tree)

ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.4.6/gcc-3.4.6.tar.gz

Unzip and untar the source in your download directory:
% tar -xvfz gcc-3.4.6.tar.gz

Installing Fink Cernlib And G77 For Mac Os

%cd gcc-3.4.6

Increase g77 MXUNIT to 10000

Modify libI77/fio.h fortran include file to allow access to 10000 unit numbers :

% vi libf2c/libI77/fio.h

Replace line:
#define MXUNIT 100

With line:

#define MXUNIT 10000

Make the build directory and run configure:
% mkdir objdir

% cd objdir

% ../configure –prefix=/usr/local/g77/

Build GCC/G77

% make

Install GCC/G77

% make install
The executables/binaries are now installed in the directory /usr/local/g77/bin/

Download and install GAMIT/GLOBK

Now that you have installed the FORTRAN compiler, download the source files, request your download form here.

Create a directory in /usr/local/gamit with:

%sudo mkdir /usr/local/gamit

G77

%cd /usr/local/gamit

Download GAMIT sources via ftp. Ftp server address provided by the request form.Change ‘install_software’ and ‘install_updates’ as executables:

%chmod ug+rx /usr/local/gamit/install*

Launch ‘install_software’ to decompress all the *.tar files:
%./install_software

Just say “yes” to decompress com.10.21.tar.Z etc. and for X11 PATH.

Now that all the files are decompressed we can replace ‘com/unimake‘ and ‘libraries/Makefile.config‘ with the new ones.

Install updated ‘unimake’ & ‘Makefile.config’ for Mac OS X

Installing Fink Cernlib And G77 For Mac Osx

  • Download unimake.gz
  • Decompress it with command:
  • #gunzip unimake.gz and move it to /usr/local/gamit/com/
  • Download Makefile.config.gz
  • Decompress it with command:
  • #gunzip Makefile.config and move it to /usr/local/gamit/libraries
Installing Fink Cernlib And G77 For Mac

Restart ‘./install_software’ again, and it should compile and install fine.

Stop here! If you want to get the big picture of what has been changed:

Edit libraries/Makefile.config

1. Change OS_ID number for Darwin

If it stops after a few seconds with error message:

OSID Darwin 8700 not found in Makefile.config – remove Makefile and STOP Failure in make_gamit — install_software terminated,

then we need to edit libraries/Makefile.config and change the line 329 from:

OS_ID Darwin 5200 8500
to
OS_ID Darwin 5200 9900

so it will compile correctly for the next MacOSX versions up to OSX 10.5.9 🙂

Note: You get the OS_ID number with command ‘uname -a’, e.g:Mac OS X version 10.4.7 is 8.7.0

2. Remove optimization options -O3

Remove the optimization options -O3 or else we will get errors compiling ‘glorg’ in directory ‘kf’.

The section of ‘OS_ID Darwin’ should look like this:

#------ for Mac OSX 10.2 til Mac OSX 10.5.9-----
OS_ID Darwin 5200 9900
# ASSIGMENTS -- removed optimization '-O3 -Wuninitialized' or else problems compiling 'kf/glorg'
FFLAGS = -Wunused -Wimplicit -fno-f2c -fno-automatic -fno-backslash -Wno-globals -fno-globals
# Fortran compiler it points to
FTN = /usr/local/g77/bin/g77
CFLAGS = -g
CC = gcc
# EXPLICIT_RULESranlib THELIB
# SUFFIX_RULES.c.a:$(CC) -c $(CFLAGS) -I$(II) $< ar rv $@ *.orm -f $*.o.f.a:$(FTN) -c $(FFLAGS) $<ar rv $@ *.orm -f $*.o# BLOCKEND

3. Change absolute PATH of your customized g77

Change also the line 333 of FTN to have the absolute PATH for g77 binary (in section ‘OS_ID Darwin’)

FTN = /usr/local/g77/bin/g77

If you restart again ‘./install_software’, after a while you will get the following error message:

/usr/bin/ld: Undefined symbols:_printf$LDBLStub_scanf

$LDBLStubcollect2: ld returned 1 exit statusmake: *** [makex] Error 1

Installing Fink Cernlib And G77 For Mac

Then we need to edit the file com/unimake

Edit com/unimake

To compile correctly we just need to append the ‘-lSystemStubs’ library to ‘com/unimake’.

Change lines 342 to 345 from ‘com/unimake’ (after ‘if ( $mainext ‘f’ ) then” to:

if ( $os[1] 'Darwin' ) then
#echo 'Darwin'
echo ' #(FTN) #(FFLAGS) $mainfull $libnam #(SLIB) -L#(X11LIB) -lX11 -o $execs[$i]$ext -lSystemStubs' | tr '#' '$' >> Makefile
else
echo ' #(FTN) #(FFLAGS) $mainfull $libnam #(SLIB) -L#(X11LIB) -lX11 -o $execs[$i]$ext ' | tr '#' '$' >> Makefile
endif # Darwin
else if ( $mainext 'c' ) then
echo ' #(CC) #(CFLAGS) $mainfull -L#(X11LIB) -lX11 -o $execs[$i]$ext ' | tr '#' '$' >> Makefile
endif
elseif ( $mainext 'f' ) then
if ( $os[1] 'Darwin' ) then #echo 'Darwin2'
echo ' #(FTN) #(FFLAGS) $mainfull $libnam #(SLIB) -o $execs[$i]$ext -lSystemStubs' | tr '#' '$' >> Makefile
else
echo ' #(FTN) #(FFLAGS) $mainfull $libnam #(SLIB) -o $execs[$i]$ext ' | tr '#' '$' >> Makefile
endif # Darwin

Relaunch install_software

Launch install_software again, and it should compile fine.