Building Starlink on macOS

Dependencies

This is the list of dependencies that must be installed on a totally new macOS machine before you can build Starlink. These were derived from a Yosemite install upgraded from a clean Snow Leopard install in April 2015

You will need to ensure that your path contains all of these; in most cases this will be set-up by the normal software installation procedure.

Running the Install

The basic Starlink install consists of running the following commands after setting up the appropriate environment:

./bootstrap
make configure-deps
./configure -C
make world
cd thirdparty/perlsys/perlmods
./build-modules.sh

However, setting up the correct build environemnt

Here is an example sh script. It was adapted from our Jenkins configuration, and a version of this was used to produce the star-2015A release.

#! /usr/env bash

# Set the location of produced Starlink build
export STARLINK_DIR=/stardev 

# Set the location for cpan logs/building.
export PERL_CPANM_HOME=~/cpanm


# Unset some variables that can cause trouble.
unset STARLINK
unset INSTALL
unset CFLAGS
unset CXXFLAGS
unset FFLAGS


# Set up compiler flags.
export LC_ALL=C
export FC=gfortran
export F77=gfortran
export CC=gcc
export CXX=g++


# build for  multiple versions of mac osx
export LDFLAGS="-mmacosx-version-min=10.6"
export CFLAGS="-mmacosx-version-min=10.6"
export CXXFLAGS="-mmacosx-version-min=10.6"

export STARCONF_DEFAULT_STARLINK=${STARLINK_DIR}
export STARCONF_DEFAULT_PREFIX=${STARLINK_DIR}


export PATH=${STARCONF_DEFAULT_PREFIX}/buildsupport/bin:${STARCONF_DEFAULT_PREFIX}/bin:${PATH}
export DYLD_LIBRARY_PATH=$STARCONF_DEFAULT_STARLINK/lib

# Print out lines to screen
set -x

# Remove whole directory as we would get a failure with manifests/* if it were empty.
rm -rf ${STARCONF_DEFAULT_STARLINK}/manifests

# Ensure submodules don't have anything in them.
git submodule foreach git clean -fdx
git submodule foreach git reset --hard HEAD

# BOOTSTRAP -- 1st stage of build!
./bootstrap

# Remove symbolic link which can cause problems on MacOS if it still exists
rm -f ${STARCONF_DEFAULT_PREFIX}/lib/iwidgets

# BUILD stages 2 & 3!
make configure-deps
./configure -C

# Remove more symbolic links which are troublesome on MacOS
rm -f ${STARCONF_DEFAULT_PREFIX}/include/vtk

# BUILD STAGE 4!
make world

# BUILD STAGE 5!
cd thirdparty/perlsys/perlmods
./build-modules.sh

Starlink: BuildingStarlinkOnOSX (last edited 2023-04-11 23:15:55 by GrahamBell)