Building Starlink on OS X
Dependencies
This is the list of dependencies that must be installed on a totally new OS X build before you can build Starlink. These were derived from a yosemite install upgraded from a clean Snow Leopard install in April 2015
XQuartz X11 http://xquartz.macosforge.org to provide an X11 environment.
- XCode and the XCode command line tools
Homebrew package manager http://brew.sh/. This provides an easy way to install the libraries needed for the build. Follow the instructions at that site to install.
- Then use homebrew to install gcc (to get gfortran) and imagemagick (and their dependencies)
brew install gcc and brew install imagemagick
- (If building Star java: install java)
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
Starlink
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 adapated from Graham Bell's Jenkins config git repo, and a version of this currently 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