Skip to content

Instantly share code, notes, and snippets.

@justintoo
Last active December 6, 2016 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justintoo/7abde1bcecf207a2a507be293bf0b82c to your computer and use it in GitHub Desktop.
Save justintoo/7abde1bcecf207a2a507be293bf0b82c to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Usage: [HPCTOOLKIT_HOME=/path/for/hpctoolkit/home] ./install-hpctoolkit.sh
#
# Environment Variables
#
# HPCTOOLKIT_HOME (Optional) To specify a location to build and
# install the HPCToolkit software.
# Default: $HOME/opt/hpctoolkit
# Author: Justin Too <justin@doubleotoo.com>
# Gist URL: https://gist.github.com/justintoo
##
## Default HPCToolkit $HOME
##
: ${HPCTOOLKIT_HOME:="$(cd "$(dirname "$0")" && pwd)"}
echo "Creating HPCTOOLKIT_HOME: '${HPCTOOLKIT_HOME}'"
mkdir -p "${HPCTOOLKIT_HOME}" || exit 1
HPCTOOLKIT_HOME="$(cd $HPCTOOLKIT_HOME && pwd)"
##
## Useful variables
##
VERSION=5.3.1-r3921
VERSION_VIEWERS=5.3.0-r1424
HPCTOOLKIT_WORKSPACE="${HPCTOOLKIT_HOME}/workspace"
HPCTOOLKIT_INSTALL="${HPCTOOLKIT_HOME}/${VERSION}"
##
## Create directories
##
echo "Creating workspace '${HPCTOOLKIT_WORKSPACE}'"
mkdir -p "$HPCTOOLKIT_WORKSPACE" || exit 1
echo "Creating workspace '${HPCTOOLKIT_INSTALL}'"
mkdir -p "$HPCTOOLKIT_INSTALL" || exit 1
##
## Download software
##
echo "Stage 1 of 5: Downloading software tarballs to $HPCTOOLKIT_WORKSPACE"
cd "$HPCTOOLKIT_WORKSPACE"
wget --no-check-certificate \
https://outreach.scidac.gov/frs/download.php/832/hpctoolkit-${VERSION}.tar.gz || exit 1
wget --no-check-certificate \
https://outreach.scidac.gov/frs/download.php/833/hpctoolkit-externals-${VERSION}.tar.gz || exit 1
wget --no-check-certificate \
https://outreach.scidac.gov/frs/download.php/810/hpcviewer-${VERSION_VIEWERS}-linux.gtk.x86_64.tgz || exit 1
wget --no-check-certificate \
https://outreach.scidac.gov/frs/download.php/806/hpctraceviewer-${VERSION_VIEWERS}-linux.gtk.x86_64.tgz || exit 1
##
## Install external dependencies
##
echo "Stage 2 of 5: Installing hpctoolkit external dependencies to $HPCTOOLKIT_INSTALL"
cd "$HPCTOOLKIT_WORKSPACE"
tar xzvf hpctoolkit-externals-${VERSION}.tar.gz
cd hpctoolkit-externals-${VERSION}
mkdir build_tree
cd build_tree
../configure --prefix="${HPCTOOLKIT_INSTALL}/externals"
make -j24 install
##
## Install core software
##
echo "Stage 3 of 5: Installing hpctoolkit core to $HPCTOOLKIT_INSTALL"
cd "$HPCTOOLKIT_WORKSPACE"
tar xzvf hpctoolkit-${VERSION}.tar.gz
cd hpctoolkit-${VERSION}
mkdir build_tree
cd build_tree
../configure --prefix="${HPCTOOLKIT_INSTALL}/core" --with-externals="${HPCTOOLKIT_INSTALL}/externals"
make -j24 install
##
## Install hpctraceviewer
##
echo "Stage 4 of 5: Installing hpctraceviewer to $HPCTOOLKIT_INSTALL"
cd "$HPCTOOLKIT_WORKSPACE"
tar xzvf hpctraceviewer-${VERSION_VIEWERS}-linux.gtk.x86_64.tgz
cd hpctraceviewer
./install "${HPCTOOLKIT_INSTALL}/core"
##
## Install hpcviewer
##
echo "Stage 5 of 5: Installing hpcviewer to $HPCTOOLKIT_INSTALL"
cd "$HPCTOOLKIT_WORKSPACE"
tar xzvf hpcviewer-${VERSION_VIEWERS}-linux.gtk.x86_64.tgz
cd hpcviewer
./install "${HPCTOOLKIT_INSTALL}/core"
echo "HPCToolkit successfully installed to ${HPCTOOLKIT_INSTALL}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment