Notes for Apple M2 with Ventura 13.5

Some attempts have been made on this system to install GIPSY but none of them with any success. Even the creation of a GIPSY set fails due to a problem with the GDS server. Some notes for the curious. Perhaps you see options for improvement:
xcode-select -p   # shows /Applications/Xcode.app/Contents/Developer
xcdodebuild -license  # Needed to be allowed to start gcc

gcc --version

sudo port -v install Xaw3d
sudo port -v install xorg-server
sudo port -v install xterm      # (as a test application)
sudo port -v install xclock     # (as a test application)
sudo port -v install wget       # (to get kapteynpackage.src)
sudo port -v install xorg-fonts

sudo port -v install mg
sudo port -v install nano       # Alternative editor

sudo port -v install geany      # Alternative editor

sudo port install gcc13

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install gfortran

Download anaconda3 (2023.07) from: https://www.anaconda.com/download#downloads Note that there are x86_64 and arm64 versions. For the M1 and M2 you need the arm64 version! Run the sh file you did download. We selected /opt/anaconda3 as installation path which fits a multi user environment.

Older versions

Preparation for macOS 10.14 Mojave

Installing GIPSY on macOS may be complicated by the fact that software can be obtained from various places e.g. Homebrew, Fink, MacPorts, etc. Also software which has already been installed may interfere.

Xcode

We did an installation on a clean Mac with Mojave, Version 10.14.4
GIPSY needs to be compiled from source so one needs an developers environment. For the Mac, this can be installed with 'Xcode' which can be obtained from the Apple store.

It is a big file so you have to be a bit patient. Verify that you've successfully installed Xcode Command Line Tools:

$ xcode-select -p
/Library/Developer/CommandLineTools
Just to be certain, verify that gcc is installed:
$ gcc --version
A GIPSY user mailed the following: Apparently on Mac OS Mojave, the command line tools can not be updated/installed with the old way i.e. xcode-selectb install
If you type this it will say everything is installed, but it is not and gcc will not compile even a small .c program. Here is the link to the solution I found and which worked for me: https://stackoverflow.com/questions/19580758/gcc-fatal-error-stdio-h-no-such-file-or-directory/20150282#20150282 under Mac OS Mojave. Basically this should be entered on the command line:
> cd /Library/Developer/CommandLineTools/Packages/
> open macOS_SDK_headers_for_macOS_10.14.pkg
and it will open an installation wizard.

Installing MacPorts

GIPSY uses a couple of libraries that are not part of Xcode. We also need to setup an X server for display because a number of applications are based on X11. To install these we need a package manager like Fink, Homebrew or MacPorts. We used MacPorts because it installs its software in /opt so we do not interfere with the system software. When installing MacPorts, your environment variable PATH will be cganhed to support MacPorts

Download macOS Mojave v10.14 from macports.org and install it.

$ sudo port -v install Xaw3d
$ sudo port -v install xorg-server
$ sudo port -v install xterm  (as a test application)
$ sudo port -v install xclock (as a test application)
$ sudo port -v install wget   (to get kapteynpackage.src)
$ sudo port -v install xorg-fonts
Now reboot your system. After that, applications like xclock start the X11 server automatically. There is no need to set a DISPLAY variable.

Most probably you need to edit files on the command line. For those who don't like vi also the more verbose nano is available. Users of MicroEmacs can install mg with:

sudo port -v install mg
If you need an editor to develop code, you can install for example 'Geany' with:
sudo port -v install geany
The GIPSY64 distribution can be downloaded from a browser but if you want to access the files through FTP, you can download 'ncftp' with:
sudo port -v install ncftp

gfortran

Xcode does not install a Fortran compiler. We need gfortran. It was reported that the following command can be used to install it:
sudo port install gcc8

Alternative

Before this was available, we were not able to find able to find a Fortran compiler that matched the current gcc compiler so we decided to install the latest versions of gcc by overwriting the system version. The compilers were found at: hpc.sourceforge.net. We downloaded the file gcc-8.3-bin.tar.gz and installed it with:
sudo tar -xvf gcc-8.3-bin.tar -C /
This installs gcc and gfortran as your system compilers. If you don't want to replace the system compilers, you need to find another solution to install gfortran. We would prefer to install the gcc/gfortan compilers through MacPorts but could not yet find a proper solution. If you have suggestions, please let us know (gipsy[AT]astro[DOT]rug[DOT]nl).

Python Environment

We are in favour installing the Anaconda3 distribution to provide Python and the packages required for GIPSY. We Migrated code to Python 3 and this version will be maintained in the future. So install the latest version of Anaconda3 from https://www.anaconda.com/distribution The installation alters the PATH variable in your .bash_profile file so that the Anaconda version of Python will be found first. One can maintain multiple versions of Python by manipulating this PATH variable.
July 10, 2019
updated: July 11, 2019; Nov 29, 2019
GIPSY