Installing Fink Cernlib And G77 For Mac

Preparation:lapack

  1. To build cernlib from the source files you need to install, the imake command, the motif and the compatibility libraries. $ su # apt-get update # apt-get install imake openMotif-devel Libcompat # apt-get clean If you just want to use precompiled binary packages, go directly to Installation subsection. CERNLIB-2006 Building Procedure.
  2. To: address@hidden From: Dierk Polzin Subject: MacOS X: FINK install of netcdf fails Organization: Center for Sustainability and Global Environment/U Wisconsin Keywords: 13.fAGGDvN05779 netCDF MacOS Hi DierkI was using FINK to install the netcdf libraries on Mac OS 10.1 and it failed. As the MAC I have.

To build cernlib from the source files you need to install, the imake command, the motif and the compatibility libraries.
$ su
# apt-get update

# apt-get install imake openMotif-devel Libcompat
# apt-get clean
If you just want to use precompiled binary packages, go directly to Installation subsection.

Installing Fink Cernlib And G77 For Mac Download

Install g77 or gfortran (use fink for Mac OS X, use gcc-g77 package for MinGW) Download the source code FreeMat-src.tar.gz. Unpack the source code: tar xvfz FreeMat-src.tar.gz. For Windows, you will need to install MSYS as well as MINGW to build FreeMat. G77 3.4: This is the FINAL release of g77 (version 3.4 compiler). Future versions of GCC will have gfortran (see above). Download my binaries, and cd to the download folder. Then gunzip g77-bin.tar.gz (if your browser didn't do so already) and sudo tar -xvf g77-bin.tar -C /. It installs everything in /usr/local. You will need to have Apple's.

CERNLIB-2006Building Procedure

Compilation Conditions
MacOS X Release 10.11
gcc-5.3.0-1osx10.11
imake-1.0.5-10.11hepx4a
Libcompat-14.1-10.11hepx3a
motif-2.3.4-1osx10.11
My gfortran-related changes have been sent to a CERNLIB maintainerand adopted in CERNLIB v.2006 so the building of CERNLIB on MacOS Xis now much easier than before.In order to compile it in 64-bit mode, however, we need extra paches.The patches for 64-bit support are largely due to Harald Vogt at DESY.Thanks to Remi Mommsen, the main cernlib mainteainer of Fink Project, these 64-bit paches have been assmbled with various MacOSX patches. The first patch I will use below is the result of hard work by these people.

[0] Preparation

In the following, <somewhere> stands for a directory intowhich you downloaded necessary tarballs or patches, while <username> means your login name. Replace them as needed according toyour environment.

# cd /
# rm cern
# mkdir /Users/cernlib
# ln -s /Users/cernlib cern
# cd /cern
# tar -zxvf 2006_src.tar.gz
# ln -s 2006 new

# ln -s 2006 pro
# mkdir -p 2006/work
# chown <user name> 2006/work
# chown <user name> 2006
# cd 2006/src
# patch -p1 -s < <somewhere>/cernlib2006-2006b-14.patch
# patch -p1 -s < <somewhere>/cernlib-2006-macosx10.9.patch
# exit
where the 2nd patch is to work around some remaining problems. It is probably worth mentioning that the addtion of '-Wl,-no_pie' to LDFLAGS was essentail to making paw work properly).

[1] Build

$ cd /cern/2006/
$ mkdir lib

$ ln -s /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib lib/liblapack3.a
$ ln -s /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib lib/libblas.a

$ cd ../work

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

$ cp $CVSCOSRC/scripts/cernlib ../bin/
$ $CVSCOSRC/config/imake_boot
$ export PATH=$PATH:/cern/2006/bin
$ 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 PACKAGE_LIB='/cern/pro/lib/libpacklib.a' EXTRA_LOAD_FLAGS='-L/opt/osxws/lib -lgfortran' >& ../../logs/packlib.bin.log &
$ tail -f ../../logs/packlib.bin.log
$ cd ../pawlib

$ make install.bin HAVE_MOTIF=YES PACKAGE_LIB='/cern/pro/lib/libpawlib.a' EXTRA_INCLUDES='-I/cern/2006/src/pawlib/comis' >& ../../logs/pawlib.bin.log &
$ tail -f ../../logs/pawlib.bin.log
$ cd ../graflib

$ make install.bin HAVE_MOTIF=YES PACKAGE_LIB='/cern/pro/lib/libgraflib.a' >&../../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 PACKAGE_LIB='/cern/pro/lib/libpacklib.a' >& ../../logs/packlib.test.log &
$ tail -f ../../logs/packlib.test.log
ALL TESTS PASSED
$ cd ../mathlib
$ make test PACKAGE_LIB='/cern/pro/lib/libmathlib.a' >& ../../logs/mathlib.test.log &
$ tail -f ../../logs/mathlib.test.log
ALL TESTS PASSED
$ cd ../graflib/higz/examples
$ make higzex PACKAGE_LIB='/cern/pro/lib/libgraflib.a'
$ ./higzex
OK!
$ cd ../../../../src/pawlib/paw/demo
$ paw all.kumac
...
go
...
OK!
$ cd ../../../../work/mclibs
$ FC='gfortran -O0' make test >& ../../logs/mclibs.test.log &
$ tail -f ../../logs/mclibs.test.log
ALL test PASSED
$ cd ../phtools
$ make test >& ../../logs/phtools.test.log &
$ tail -f ../../logs/phtools.test.log
ALL TESTSPASSED
$ cd ../geant321

$ make test EXTRA_LOAD_FLAGS='-undefined dynamic_lookup' >& ../../logs/geant321.test.log &
$ tail -f ../../logs/geant321.test.log
ALL TESTSPASSED

Installing Fink Cernlib And G77 For Mac Os

Installation of Binary Packages

CERNLIB

# apt-get update
# apt-get install cernlib
# apt-get clean

# ln -s 2006 /cern/pro

By default cernlib will be installed under /cern. Add /cern/pro/binto your PATH in order to use PAW, PAW++, etc.

Dis45

# apt-get update
# apt-get install dis45
# apt-get clean

Topdrawer

# apt-get update
# apt-get install tdr
# apt-get clean

or
# apt-get update
# apt-get install topdraw
# apt-get clean

Back to Keisuke Fujii's HEP on X Pagekeisuke.fujii@kek.jp Feb. 20, 2016

Preparation:lapack

To build cernlib from the source files you need to install, the imake command, the motif and the compatibility libraries.
$ su
# apt-get update

# apt-get install imake openMotif-devel Libcompat
# apt-get clean
If you just want to use precompiled binary packages, go directly to Installation subsection.

CERNLIB-2006Building Procedure

Compilation Conditions
MacOS X Release 10.6
gcc-4.5.1-4osx10.6
imake-1.0.2-10.6hepx12c.i386
Libcompat-14.1-10.6hepx12b
openMotif-2.3.0-10.6hepx12c
My gfortran-related changes have been sent to a CERNLIB maintainerand adopted in CERNLIB v.2006 so the building of CERNLIB on MacOS Xis now much easier than before.

[0] Preparation

Fink

In the following, <somewhere> stands for a directory intowhich you downloaded necessary tarballs or patches, while <username> means your login name. Replace them as needed according toyour environment.

# cd /
# rm cern
# mkdir /Users/cernlib
# ln -s /Users/cernlib cern
# cd /cern
# tar -zxvf 2006_src.tar.gz
# ln -s 2006 new

# ln -s 2006 pro
# mkdir -p 2006/work
# chown <user name> 2006/work
# chown <user name> 2006
# cd 2006/src
# patch -p1 -s < <somewhere>/cernlib-2006-macosx10.6-gcc451.patch
where the patch is to work around some minor remaining problems. Then exit the super user mode:
# exit

[1] Build

$ cd /cern/2006/
$ mkdir lib

$ ln -s /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib lib/liblapack3.a
$ ln -s /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib lib/libblas.a

$ cd work

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

$ cp $CVSCOSRC/scripts/cernlib ../bin/
$ $CVSCOSRC/config/imake_boot
$ export PATH=$PATH:/cern/2006/bin
$ 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 PACKAGE_LIB='/cern/pro/lib/libpacklib.a' EXTRA_LOAD_FLAGS='-L/usr/osxws/lib -lgfortran' >& ../../logs/packlib.bin.log &
$ tail -f ../../logs/packlib.bin.log
$ cd ../pawlib

$ make install.bin HAVE_MOTIF=YES PACKAGE_LIB='/cern/pro/lib/libpawlib.a' >&../../logs/pawlib.bin.log &
$ tail -f ../../logs/pawlib.bin.log
$ cd ../graflib

$ make install.bin HAVE_MOTIF=YES PACKAGE_LIB='/cern/pro/lib/libgraflib.a' >&../../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 PACKAGE_LIB='/cern/pro/lib/libpacklib.a' >& ../../logs/packlib.test.log &
$ tail -f ../../logs/packlib.test.log
ALL TESTS PASSED
$ cd ../mathlib
$ make test PACKAGE_LIB='/cern/pro/lib/libmathlib.a' >& ../../logs/mathlib.test.log &
$ tail -f ../../logs/mathlib.test.log
ALL TESTS but C208 and C327 PASSED
$ cd ../graflib/higz/examples
$ make higzex PACKAGE_LIB='/cern/pro/lib/libgraflib.a'
$ ./higzex
OK!
$ cd ../../../../src/pawlib/paw/demo
$ paw all.kumac
...
go
...
OK!
$ cd ../../../../work/mclibs
$ C='gfortran-32 -O0' make test >& ../../logs/mclibs.test.log &
$ tail -f ../../logs/mclibs.test.log
ALL but theISAJET test PASSED
$ cd ../phtools
$ make test >& ../../logs/phtools.test.log &
$ tail -f ../../logs/phtools.test.log
ALL TESTSPASSED
$ cd ../geant321

$ make test EXTRA_LOAD_FLAGS='-undefined dynamic_lookup' >& ../../logs/geant321.test.log &
$ tail -f ../../logs/geant321.test.log
ALL TESTSPASSED
1. Mathlib problem with C208 (quartic equation solver) is new and isdue to csqrt in libm: csqrt selects the solution for the return valueby looking at the sign of the imaginary part of the argument, whichcauses some unexpected behavior like:

where I expect naively that both of z1 and z2 to be (0, 1). Thequartic equation solver (drteq4) returns correct solutions but indifferent order because of this behavior.

2. Mathlib problem with C327 has been there since 10.3, a precisionproblem for modified Bessel functions (tsbvsl).

3. Mclibs problem with isajet has been there since 10.3 butoverseen, since the nonzero exit code from g77's stop statement has notbeen treated as an error unlike gfortran.

Installation of Binary Packages

Installing fink cernlib and g77 for mac osCERNLIB

# apt-get update
# apt-get install cernlib
# apt-get clean

# ln -s 2006 /cern/pro

By default cernlib will be installed under /cern. Add /cern/pro/binto your PATH in order to use PAW, PAW++, etc.

Dis45

# apt-get update
# apt-get install dis45
# apt-get clean

Topdrawer

# apt-get update
# apt-get install tdr
# apt-get clean

or
# apt-get update
# apt-get install topdraw
# apt-get clean

Back to Keisuke Fujii's HEP on X Pagekeisuke.fujii@kek.jp March 08, 2010