Building and Installing Software

Similar documents
COUCHDB - INSTALLATION

cget Documentation Release Paul Fultz II

FOLLOW ALONG WITH THE EXAMPLES

Linux Software Installation Exercises 2 Part 1. Install PYTHON software with PIP

XIV Seminar on Software for Nuclear, Subnuclear and Applied Physics Alghero (ITALY) June Geant4 Installation.

How to install and build an application

CNRS ANF PYTHON Packaging & Life Cycle

Build a Geant4 application

The Edit-Compile-Run Cycle. EECS 211 Winter 2017

Cybernetics Oriented Programming (CYBOP)

Compiling and Installing Your Own Software

Documentation of the chemistry-transport model. [version 2017r4] July 25, How to install required libraries under GNU/Linux

Introduction to HPC Programming 4. C and FORTRAN compilers; make, configure, cmake. Valentin Pavlov

MAKING CONTAINERS EASIER WITH HPC CONTAINER MAKER. Scott McMillan September 2018

5.3 Install grib_api for OpenIFS

PROJECT INFRASTRUCTURE AND BASH INTRODUCTION MARKUS PILMAN<

Mixed Python/C programming with Cython September /14. Mixed Python/C programming with Cython Ben Dudson, 22nd September 2017

Dalton/LSDalton Installation Guide

SCALABLE HYBRID PROTOTYPE

Compiling Software on UNIX. System Administration Decal Spring 2009 Lecture #4 George Wu Slides prepared by Joshua Kwan

Beyond Makefiles: Autotools and the GNU Build System

Building, installing and running software

CSC BioWeek 2018: Using Taito cluster for high throughput data analysis

CS Students Linux User's Guide

Installing the new LOFAR Software on a fresh Ubuntu 14.04

1. Make sure you have home-brew installed. brew.sh

NetCDF Build and Test System. Ed Hartnett, 1/25/8

ESTABLISHED Paul Kunz SLAC. Overview. Examples. Expose the downsides. Benefits. Risks and Costs. Building with Automake 1 Paul F.

CSC BioWeek 2016: Using Taito cluster for high throughput data analysis

Make was originally a Unix tool from 1976, but it has been re-implemented several times, notably as GNU Make.

GNU Automake. For version , 1 February David MacKenzie Tom Tromey Alexandre Duret-Lutz

This tutorial helps the professionals aspiring to make a career in Big Data and NoSQL databases, especially the documents store.

EE458 - Embedded Systems Lecture 2 RTEMS Installation

COMP 2400 UNIX Tools

Configure Error No Acceptable C Compiler Found In Xcode Installed

MRCP. Installation Manual. Developer Guide. Powered by Universal Speech Solutions LLC

Installing SW4 version 2.0

Ganglia is monitring system for high performance computing systems. We have two node potter.isb.ots.com and harry.isb.ots.com both are HPC nodes.

Software Building (Sestavování aplikací)

Lab 1 Introduction to UNIX and C

Installation guide for Escript and Finley

Linux Software Installation Session 2. Qi Sun Bioinformatics Facility

GNU-AVR Building the GNU AVR Toolchain for Mac OS X and Linux

Creating a Project Using an Existing Build System

Installing Snort 3 Alpha 4 on opensuse Leap bits

PyPI to 0install Documentation

Introduction to Linux

Using Jails in FreeNAS to set up Backblaze B2

Autoconf Tutorial. Mark Galassi

July 8, 2007 Jim Huang (jserv)

Distil Documentation. Release Vinay Sajip

Sunday, February 19, 12

EXPERIMENTAL SETUP: MOSES

Generic TriBITS Project, Build, Test, and Install Reference Guide

Movidius Neural Compute Stick

If you had a freshly generated image from an LCI instructor, make sure to set the hostnames again:

Installing CEA on an Intel Mac

CMPT 300. Operating Systems. Brief Intro to UNIX and C

Mills HPC Tutorial Series. Mills HPC Basics

These steps may include:

Introduction to Linux Scripting (Part 2) Brett Milash and Wim Cardoen CHPC User Services

Dedalus Project Documentation. Dedalus Collaboration

Dedalus Project Documentation. Keaton Burns, Jeffrey S. Oishi, Geoff Vasil, Ben Brown, Daniel Lec

simplevisor Documentation

The build2 Toolchain Installation and Upgrade

Site presentation: CSCS

Using the Unix system. UNIX Introduction

CS11 Advanced C++ Fall Lecture 4

COSE222 Computer Architecture

Embedded Systems Programming

Autotools Tutorial. Mengke HU. ASPITRG Group Meeting. ECE Department Drexel University

Deploying (community) codes. Martin Čuma Center for High Performance Computing University of Utah

Supported platforms & compilers Required software Where to download the packages Geant4 toolkit installation (release 10.1.p02)

Installing CEA on an Intel Mac

Installation Caffe on Argon Cluster

How to install sngrep on your VoipNow server

C++ Binary Dependency Management with Gradle. Hugh Greene

Revision Control and GIT

catkin_tools Documentation

Chris Calloway for Triangle Python Users Group at Caktus Group December 14, 2017

CS 261 Recitation 1 Compiling C on UNIX

Maintain the NetBSD Base System Using pkg * Tools

Linux Clusters Institute:

Installing Python Modules

CMake & Ninja. by István Papp

Running LAMMPS on CC servers at IITM

Containers. Pablo F. Ordóñez. October 18, 2018

Overview. What are community packages? Who installs what? How to compile and install? Setup at FSU RCC. Using RPMs vs regular install

Lab #1 Installing a System Due Friday, September 6, 2002

CSE 390a Lecture 2. Exploring Shell Commands, Streams, and Redirection

Installation Guide for sundials v2.6.2

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

Using the MaRC2 HPC Cluster

Compile and run RAPID on the Microsoft Azure Cloud

Install your scientific software stack easily with Spack

Nexus Application Development - SDK

CSE 15L Winter Midterm :) Review

a. puppet should point to master (i.e., append puppet to line with master in it. Use a text editor like Vim.

NEMO-RELOC Documentation

Linux Software Installation Part 2

Transcription:

Building and Installing Software On UD HPC Community Clusters William Totten Network & Systems Services

Conventions when Installing Software Installation base directory /opt/shared /home/work/ lab/sw/name/version Keep the source code somewhere safe /opt/shared/ name/attic /home/work/ lab/sw/name/attic Software name conventions Don't change the name unless you have to do so All lowercase letters Use prefixes like "python-", "r-", "perl-", etc. if language specific collisions occur Software version conventions Use the author's version whenever possible For collections, use the date collected (e.g. 20160414)

Methods of Installing Software Prepared Installers Simple step-by-step instructions Compile with make and GNU Autoconf Compile with CMake Build java code with ant Add on packages for existing software Python Perl R Site-specific conventions and wrappers RPM UD s udbuild wrapper on Farber cluster

What is GNU Autoconf Autoconf is used by programmers to create a script called configure It is designed to support variants of C, Fortran, and Erlang Configure looks at the system and figures out how it works Configure writes a file config.h out for programmers to use Configure writes a Makefile for you to build the software You compile and install the software using the program make $ PREFIX=/home/work/lab/sw/pkg/1.3 $./configure --help more $./configure --prefix=$prefix checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands $ make $ make test $ make install $

Common GNU Autoconf Options Command-line parameters --help --prefix=/path/to/install --enable-feature --with-package=[path] Get a list of the configure script s options and environment variables Use this option to specify the directory in which the products will be installed Use this option to enable feature or change how the software is compiled Use this option to select a package to link against, often you can specify the install location of those packages Environment variables CC=gcc CFLAGS= -O Specify the C compiler to use Specify options to the C compiler which may be needed

Let s install HDF5 $ workgroup --cd --group it_nss $ cd sw $ mkdir hdf5; cd hdf5; mkdir attic; cd attic $ wget http://www.hdfgroup.org/ftp/hdf5/current/src/hdf5-1.8.16.tar.bz2 $ cd.. $ mkdir 1.8.16; cd 1.8.16 $ PREFIX=$PWD $ tar xjf../attic/hdf5-1.8.16.tar.bz2 $ mv hdf5-1.8.16 src $ cd src $./configure --help $ vpkg_list szip $ vpkg_devrequire szip $./configure --prefix=$prefix --with-szlib=$szip_prefix --enable-fortran --enable-cxx $ make $ make test $ make install $ cd $PREFIX $ ls *

HDF5 setup.sh script /home/work/it_nss/sw/hdf5/1.8.16/src/setup.sh #!/bin/bash -l PKGNAME=hdf5 VERSION=1.8.16 PREFIX=/home/work/it_nss/sw/$PKGNAME/$VERSION vpkg_devrequire szip./configure --prefix=$prefix --with-szlib=$szip_prefix --enable-fortran --enable-cxx make && make test && make install

What is CMake CMake is used by developers to manage the software build process natively on UNIX like and Windows operating systems It is designed to extensible beyond C and Fortran CMake likes to work out of a private build directory CMake writes a Makefile for you to build the software You compile and install the software using the program make CMake has a menu system to help select build parameters "ccmake" $ PREFIX=/home/work/lab/sw/pkg/1.3 $ mkdir build; cd build $ cmake -DCMAKE_INSTALL_PREFIX=$PREFIX.. -- The C compiler identification is GNU 4.4.7 -- The CXX compiler identification is GNU 4.4.7 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Configuring done -- Generating done -- Build files have been written to: /home/work/lab/... $ make $ make test $ make install $

Common CMake Options Command-line parameters -G Generator -DPARAM=value -DCMAKE_INSTALL_PREFIX=... Specify a pre-configured environment generator if available Use this option to define build parameters Specify the installation directory Environment variables CC=gcc CFLAGS= -O PKG_INSTALL=/path Specify the C compiler to use Specify options to the C compiler which may be needed Convention to specify install location of PKG (different packages use different conventions here, PKG_HOME, PKG_ROOT,...)

Let s install HDF5 $ workgroup --cd --group it_nss $ cd sw $ mkdir hdf5; cd hdf5; mkdir attic; cd attic $ wget http://www.hdfgroup.org/ftp/hdf5/current/src/hdf5-1.8.16.tar.bz2 $ cd.. $ mkdir 1.8.16; cd 1.8.16 $ PREFIX=$PWD $ tar xjf../attic/hdf5-1.8.16.tar.bz2 $ mv hdf5-1.8.16 src $ cd src $ less CMakeLists.txt $ vpkg_list cmake $ vpkg_list szip $ vpkg_devrequire cmake/3.3 szip $ export SZIP_INSTALL=$SZIP_PREFIX $ mkdir build; cd build $ cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -DHDF5_ENABLE_SZIP_SUPPORT=1 \ -DHDF5_ENABLE_SZIP_ENCODING=1 -DHDF5_BUILD_FORTRAN=1 -DHDF5_BUILD_CPP_LIB=1.. $ make $ make test $ make install $ cd $PREFIX $ ls * You can use: ccmake.. Here to set these via a menu system

HDF5 setup.sh script /home/work/it_nss/sw/hdf5/1.8.16/src/setup.sh #!/bin/bash -l PKGNAME=hdf5 VERSION=1.8.16 PREFIX=/home/work/it_nss/sw/$PKGNAME/$VERSION vpkg_devrequire cmake/3.3 szip export SZIP_INSTALL=$SZIP_PREFIX mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DHDF5_ENABLE_SZIP_SUPPORT=1 -HDF5_ENABLE_SZIP_ENCODING=1 \ -DHDF5_BUILD_FORTRAN=1 -DHDF5_BUILD_CPP_LIB=1 \.. make && make test && make install

Python setup.py Python developed it's own method for building python modules Some python modules are pure-python and are very easy to build, others have portions in compiled languages like C You can manually build using the standard "setup.py" file Additional tools like easy_install and pip can simplify the build process even more pip and easy_install sometimes force you to upgrade other packages $ PREFIX=/home/work/lab/sw/python/add-ons/python2.7.8/pkg/1.3 $ python setup.py build running build running build_py creating build creating build/lib.linux-x86_64-2.7 $ python setup.py test running test running build_py running build_ext $ PYTHONPATH= $PREFIX/lib/python2.7/site-package:$PYTHONPATH $ python setup.py install -O2 --prefix=$prefix running install running bdist_egg running egg_info $

Common setup.py Options Command-line parameters -O2 --prefix=/path Create optimized/compiled files ".pyo" Specify the install location Environment variables CC=gcc CFLAGS= -O PYTHONPATH=/path/.../site-package Specify the C compiler to use Specify options to the C compiler which may be needed It is very important to the python installer that it can load the package after installation. Make sure this is set.

Let s install H5PY $ workgroup --cd --group it_nss $ cd sw $ vpkg_require python python-six python-numpy python-cython python-setuptools $ which python $ mkdir -p python/add-ons/python2.7.8; cd python/add-ons/python2.7.8 $ mkdir h5py; cd h5py; mkdir attic; cd attic $ wget https://pypi.python.org/packages/source/h/h5py/h5py-2.5.0.tar.gz $ cd.. $ mkdir 2.5.0; cd 2.5.0 $ PREFIX=$PWD $ tar xzf../attic/h5py-2.5.0.tar.gz $ mv h5py-2.5.0 src $ cd src $ vpkg_devrequire szip $ export LDFLAGS="-L/home/work/it_nss/sw/hdf5/1.8.16/lib $LDFLAGS" $ export LD_LIBRARY_PATH="/home/work/it_nss/sw/hdf5/1.8.16/lib:$LD_LIBRARY_PATH" $ export CPATH="/home/work/it_nss/sw/hdf5/1.8.16/include:$CPATH" $ PYTHONPATH="$PREFIX/lib/python2.7/site-packages:$PYTHONPATH" $ python setup.py build $ python setup.py install -O2 --prefix=$prefix $ cd $PREFIX $ python -c 'import h5py'

H5PY setup.sh script /home/work/it_nss/sw/python/add-ons/python2.7.8/h5py/2.5.0/src/setup.sh #!/bin/bash -l PKGNAME=h5py VERSION=2.5.0 HDF5=/home/work/it_nss/sw/hdf5/1.8.16 vpkg_devrequire szip vpkg_devrequire python python-{six,numpy,cython,setuptools} PREFIX=/home/work/it_nss/sw/python/add-ons/python$PYTHON_VERSION_LONG/$PKGNAME/$VERSION export LDFLAGS="-L$HDF5/lib $LDFLAGS" export LD_LIBRARY_PATH="$HDF5/lib:$LD_LIBRARY_PATH" export CPATH="$HDF5/include:$CPATH" PYTHONPATH="$PREFIX/lib/python2.7/site-packages:$PYTHONPATH" python setup.py build python setup.py install -O2 --prefix=$prefix

Installing h5py with pip $ workgroup --cd --group it_nss $ cd sw $ vpkg_require python python-six python-numpy python-cython python-setuptools python-pip $ which python $ mkdir -p python/add-ons/python2.7.8; cd python/add-ons/python2.7.8 $ mkdir h5py; cd h5py $ mkdir 2.5.0; cd 2.5.0 $ PREFIX=$PWD $ vpkg_devrequire szip $ export LDFLAGS="-L/home/work/it_nss/sw/hdf5/1.8.16/lib $LDFLAGS" $ export LD_LIBRARY_PATH="/home/work/it_nss/sw/hdf5/1.8.16/lib:$LD_LIBRARY_PATH" $ export CPATH="/home/work/it_nss/sw/hdf5/1.8.16/include:$CPATH" $ pip install --compile --prefix="$prefix" h5py $ python -c 'import h5py'

What is udbuild A small set shell functions to make writing install scripts easier It is designed to help when the same package must be installed with different dependencies, compilers, configurations, or versions It only exists on the Farber HPC Community Cluster Using udbuild is not required It automatically sets your PREFIX variable for you It helps with package naming standards Environment variables can be conditionally updated based on valet packages or the current package version Helps monitor what is updated upon installation

udbuild Requirements and Conventions Variables (set prior to init_udbuildenv) PKGNAME VERSION UDBUILD_HOME This should be an all lowercase version of the package name and will be the first part of the install directory The version of the package to be installed, this is used by the "version" function described later, and is the second part of the install directory This should be set to the software install home for your workgroup, by default it would try to install to /opt/shared, and you don't have access to do that Conventions vpkg_devrequire init_udbuildenv Call the "devrequire" valet command to load udbuild and any packages needed to install the software which should not be part of the install directory name Any package which should be part of the install directory name should be added to your init_udbuildenv line, they will loaded with "vpkg_devrequire" for you

udbuild Functions init_udbuildenv Initialize the udbuild environment, set the PREFIX environment variable, set auto export, set standard compile variables, and set exit-on-error udbuildcapture udbuildmon valet version ifvalet ifversion Store all of the output from the build in a file called "udbuildcap.log" for later review, this file is appended to if run multiple times Store all the files opened for write in a file called "udbuildmon.log" using a system program called "strace" Test if a valet package is loaded into the current environment Test if the version of software currently being installed is at a particular level A quick way to call "if valet pkg; then command; fi" A quick way to call "if version number; then command; fi"

HDF5 udbuild script /home/work/it_nss/sw/hdf5/1.8.16/src/udbuild #!/bin/bash -l PKGNAME=hdf5 VERSION=1.8.16 UDBUILD_HOME=/home/work/it_nss/sw vpkg_devrequire udbuild szip init_udbuildenv #init_udbuildenv openmpi/1.10.2-gcc-4.9.3 if valet openmpi; then CONFIGURE_FLAGS='--enable-fortran --enable-parallel' CFLAGS="-L$OPENMPI_PREFIX/lib -I$OPENMPI_PREFIX/include" CC=mpicc CXX=mpicxx FC=mpif77 else CONFIGURE_FLAGS='--enable-fortran --enable-cxx' fi./configure --prefix=$prefix --with-szlib=$szip_prefix $CONFIGURE_FLAGS make udbuildmon make install

H5PY udbuild script /home/work/it_nss/sw/python/add-ons/python2.7.8/h5py/2.5.0/src/udbuild #!/bin/bash -l PKGNAME=h5py VERSION=2.5.0 PY_VERS=2.7.8 HDF5=/home/work/it_nss/sw/hdf5/1.8.16 vpkg_devrequire udbuild szip vpkg_devrequire python/$py_vers python-{six,numpy,cython,setuptools}/python$py_vers init_udbuildenv python-addon export LDFLAGS="-L$HDF5/lib $LDFLAGS" export LD_LIBRARY_PATH="$HDF5/lib:$LD_LIBRARY_PATH" export CPATH="$HDF5/include:$CPATH" python setup.py build udbuildmon python setup.py install -O2 --prefix=$prefix

Notes on Installing Software Read the author's website first for instructions Look for a file with instructions after you unpack the source bundle INSTALL, INSTALL.txt, README, README.txt, READ.ME, README.1ST Make sure you have all the dependencies installed first Look at the install options before beginning (configure --help, CMakeLists.txt, etc) The Internet is your friend, try to find the real error message The author's site Google Stack Overflow Use the software's forum or author email links if you are having trouble

Questions and Open Forum