These notes apply to the installation of February 1,
2024 under MacOS Version Sonoma 14.3.1 The test machine
was a MacBook Air with the M2 Apple Silicon chip.
These instructions should apply to other MacOS
versions.
Next we need the compilers and other software. We will get these using both Homebrew and MacPorts
sudo port install gv sudo port install xv sudo port install ImageMagick
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Refer to the HomeBrew website to ensure that this command line is uptodate. Now install the following packages:
brew install wget brew install gcc brew install make This will give the GNU make brew install xfig brew install gawk brew install ghostscript brew install ffmpeg brew install gmt brew install graphicsmagick brew install --cask mactex This will give LaTex for document creation
The reason for downloading from the two sources is that a package missing from one may be in the other. The other, less obvious reason, is that distribution may not work as desired. For example, I use the ImageMagick convert program to convert the Computer Programs in Seismology (CPS) EPS files to PNG for display on the weband inclusion in documenbts and presentations. The CPS program plotnps -EPS determines the boundingbox of a figure, and uses it by placing the line %%BoundingBox: (atend) at the top of the EPS file and then placing at the second last line the exact dimensions, for example %%BoundingBox: 47 45 585 321. I found that the Imagemagick 7.1.1-8 downloaded from HomeBrew did not recognize this but that the ImageMagick 6.9.11-60 downloaded from MacPorts did recognize this. The effect was that the 7.1.1-8 version yielded a cropped bit graphic image, which was not desired. Note: HomeBrew does have a link to download a Version 6 of ImageMagick.
Not all packages are required to compile CPS. I have selected the following items in order to be productive:
convert -trim t.eps -background white -alpha remove -alpha off t.png
All of these installations will create an entry in the .zprofile in the login directory to point to the location of these executables
sudo ln -s /opt/homebrew/bin/gcc-13 /opt/homebrew/bin/gccIf the compiler was installed using MacPorts. You may have to do something like
cd /usr/local/bin
sudo ln -s /opt/local/bin/gcc-mp-11 gcc
sudo ln -s /opt/local/bin/gfortran-mp-11 gfortran
(The mp-11 means MacPorts gcc6 was installed. This how MacPorts distinguishes the different versions)
OPATH=$PATH PATH=:.:$HOME/bin:$HOME/PROGRAMS.330/bin:$OPATH (This assumes that you installed CPS in your login directory)
cd PROGRAMS.330 ./Setup OSX40 ./C 2>&1 C.txtIf you have the newer Macs with the M1/M2 chip,
cd PROGRAMS.330 ./Setup OSXM ./C 2>&1 C.txt
ls bin/* | wcIf you do not see on the order of 150 programs, then examine the C.txt to determine what failed. This is the file to send to the Email address given on the main page if there are problems.