Skip to content

Instantly share code, notes, and snippets.

@doubleotoo
Created November 19, 2012 17:45
Show Gist options
  • Save doubleotoo/4112229 to your computer and use it in GitHub Desktop.
Save doubleotoo/4112229 to your computer and use it in GitHub Desktop.
Quick and dirty script to automate the installation of HPCToolkit
#!/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
##
## Default HPCToolkit $HOME
##
: ${HPCTOOLKIT_HOME:="${HOME}/opt/hpctoolkit"}
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