Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
abstract:caviness:install_software [2018-07-09 16:43] – external edit 127.0.0.1 | abstract:caviness:install_software [2018-08-23 10:26] (current) – removed anita | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== UDBUILD Software Deployment ===== | ||
- | The software installed and deployed on the Caviness cluster each has it's own | ||
- | methods for compiling and installing. | ||
- | has a set of standards and technology used to reduce complexity and bring | ||
- | consistency to the process. | ||
- | Software is built, installed, and accessed using the | ||
- | [[software: | ||
- | developed a set of software helper functions which can be access using VALET | ||
- | by importing the '' | ||
- | |||
- | This page describes the filesystem layout used by IT, and the anatomy of the | ||
- | '' | ||
- | it is helpful to have an understanding of how to use | ||
- | [[software: | ||
- | environment. | ||
- | |||
- | ==== Filesystem ==== | ||
- | Software is deployed to ''/ | ||
- | The '' | ||
- | location. | ||
- | environment variable before initializing the ubuild environment. | ||
- | value for this environment variable for workgroup software is | ||
- | '' | ||
- | '' | ||
- | |||
- | Beneath this directory should be an '' | ||
- | software bundles, optionally an '' | ||
- | optional add-ons, and one sub-directory for each package installed. | ||
- | These sub-directories should always be in all lower-case letter. | ||
- | layer down should be a directory for each version of the software installed. | ||
- | It is important understand that on a complex cluster like Caviness, the same | ||
- | release of a software package may have multiple installations due to various | ||
- | compiler and dependency package requirements. | ||
- | software installation roots. | ||
- | |||
- | Underneath the installation root should be a directory called '' | ||
- | is the un-packed source bundle. | ||
- | '' | ||
- | |||
- | An illustrated example of the software directory structure is as such: | ||
- | |||
- | * opt | ||
- | * shared | ||
- | * atlas | ||
- | * 3.10.2 | ||
- | * lib | ||
- | * include | ||
- | * src | ||
- | * '' | ||
- | * 3.10.2-intel64 | ||
- | * attic | ||
- | * python | ||
- | * 2.7.8 | ||
- | * bin | ||
- | * include | ||
- | * lib | ||
- | * share | ||
- | * src | ||
- | * '' | ||
- | * 3.2.5 | ||
- | * add-ons | ||
- | * python2.7.8 | ||
- | * numpy | ||
- | * 1.8.2 | ||
- | * bin | ||
- | * lib | ||
- | * src | ||
- | * '' | ||
- | * ipython | ||
- | * python3.2.5 | ||
- | * attic | ||
- | |||
- | |||
- | ==== Building ==== | ||
- | When building software, the base directory structure (including the '' | ||
- | directory) should be created by you before proceeding further. | ||
- | You should download the software source bundle into '' | ||
- | unpack the software bundle and rename the directory to '' | ||
- | above. | ||
- | '' | ||
- | |||
- | Examples of builds are provided below (after the udbuild function | ||
- | documentation). | ||
- | |||
- | === udbuild functions === | ||
- | |||
- | == init_udbuildenv == | ||
- | This function initializes the udbuild environment. It ensures that you have | ||
- | the required '' | ||
- | not have VALET packages loaded before '' | ||
- | might affect your build), sets compiler variables like CC, FC, etc., then | ||
- | finally sets your '' | ||
- | command-line. | ||
- | |||
- | * none - This is equivalent to not supplying any parameters | ||
- | * python-addon - Ensure a python VALET package is loaded, and set PREFIX \ | ||
- | appropriately for that python version' | ||
- | * r-addon - Ensure an R VALET package is loaded, and set PREFIX \ | ||
- | appropriately for that R version' | ||
- | * Any other arguments are treated as the names of VALET packages which are \ | ||
- | loaded and added to the '' | ||
- | |||
- | After all of this, your '' | ||
- | |||
- | ${UDBUILD_HOME: | ||
- | |||
- | == valet == | ||
- | This function takes either the name of a package (e.g. '' | ||
- | package name/ | ||
- | is a VALET package loaded to satisfy this dependency, and false otherwise. | ||
- | |||
- | This function can be used along with any other shell constructs, such as | ||
- | '' | ||
- | |||
- | == version == | ||
- | This function takes a string and validates that it exists as a complete | ||
- | entry (i.e. starts, stops, or is bounded by hyphens) in the VERSION string. | ||
- | |||
- | This function can be used along with any other shell constructs, such as | ||
- | '' | ||
- | |||
- | == ifvalet == | ||
- | This function is shorthand for '' | ||
- | to make udbuild scripts simple to read and code. | ||
- | |||
- | == ifversion == | ||
- | This function is shorthand for '' | ||
- | to make udbuild scripts simple to read and code. | ||
- | |||
- | == udbuildcapture == | ||
- | Put all screen output into a capture file. The main purpose of this is to | ||
- | log questions answered during an interactive isntall, to document what | ||
- | choices were made. | ||
- | |||
- | == udbuildmon == | ||
- | This script is helpful to be run during the install phase of a build, for | ||
- | example: | ||
- | |||
- | udbuildmon make install | ||
- | |||
- | It will log all '' | ||
- | a file named '' | ||
- | build did not write any files to unknown locations. | ||
- | be necessary with [[http:// | ||
- | store this information in an '' | ||
- | |||
- | === udbuild script examples === | ||
- | |||
- | == simple == | ||
- | In this example, an easy-to-install software package called cmake is built | ||
- | and isntalled. | ||
- | '' | ||
- | open source software packages. | ||
- | |||
- | To prepare for this build, you would want to create the following directories: | ||
- | |||
- | |||
- | <file sh udbuild> | ||
- | #/bin/bash -l | ||
- | |||
- | PKGNAME=cmake | ||
- | VERSION=3.0.1 | ||
- | |||
- | vpkg_devrequire udbuild | ||
- | init_udbuildenv | ||
- | |||
- | ./configure --prefix=$PREFIX | ||
- | #having to define your own PREFIX | ||
- | #variable, because ' | ||
- | #that for you. | ||
- | |||
- | make #normal make commands | ||
- | |||
- | udbuildmon make install | ||
- | #' | ||
- | #and directories were changed. | ||
- | </ | ||
- | |||
- | It is imperitive to start udbuild scripts with the string ''# | ||
- | because this instructs bash to setup the VALET system. | ||
- | |||
- | == medium == | ||
- | <file sh udbuild> | ||
- | #!/bin/bash -l | ||
- | |||
- | PKGNAME=cdo | ||
- | VERSION=1.6.4 | ||
- | |||
- | vpkg_devrequire udbuild | ||
- | vpkg_devrequire netcdf/ | ||
- | init_udbuildenv | ||
- | |||
- | ./configure --prefix=" | ||
- | --with-szlib=" | ||
- | --with-hdf5=" | ||
- | --with-netcdf=" | ||
- | --with-grib_api=" | ||
- | --with-proj=" | ||
- | --with-udunits2=" | ||
- | --with-threads=yes | ||
- | --with-curl=yes | ||
- | --with-libxml=yes | ||
- | |||
- | make | ||
- | |||
- | udbuildmon make install | ||
- | </ | ||
- | |||
- | In this example, we use '' | ||
- | needed to build the '' | ||
- | to ''/ | ||
- | |||
- | == complex == | ||
- | <file sh udbuild> | ||
- | #!/bin/bash -l | ||
- | |||
- | PKGNAME=hdf4 | ||
- | VERSION=4.2.10 | ||
- | |||
- | vpkg_devrequire udbuild szip/2.1 | ||
- | init_udbuildenv intel64 | ||
- | |||
- | CFLAGS=" | ||
- | CONFIGURE_FLAGS='' | ||
- | |||
- | ifvalet intel64 | ||
- | |||
- | ifversion sansnetcdf | ||
- | |||
- | # Make shared libraries (sans fortran support): | ||
- | ./configure --prefix=" | ||
- | --with-szlib=$SZIP_PREFIX $CONFIGURE_FLAGS | ||
- | |||
- | udbuildmon make install | ||
- | |||
- | make clean | ||
- | |||
- | # Make fortran enabled HDF4: | ||
- | |||
- | ./configure --prefix=" | ||
- | --with-szlib=$SZIP_PREFIX $CONFIGURE_FLAGS | ||
- | |||
- | udbuildmon make install | ||
- | </ | ||
- | |||
- | In this more complicated example, we still need dependencies, | ||
- | one of them will affect the '' | ||
- | be used, and PREFIX will be set to ''/ | ||
- | |||
- | Furthermore, | ||
- | This example also illustrates how the '' | ||
- | we would set additional flags for the '' | ||
- | string were set to '' | ||
- | to build multiple versions of a package, and with only minor changes near | ||
- | the top of the script (namely to the '' | ||
- | '' | ||
- | |||
- | Another interesting thing we do here is to make sure the installation is | ||
- | as complete as possible. | ||
- | fortran libraries. | ||
- | then we enable fortran and ensure the full compliment of archive '' | ||
- | are present. | ||
- | |||
- | == python == | ||
- | <file sh udbuild> | ||
- | #!/bin/bash -l | ||
- | |||
- | UDBUILD_HOME=$WORKDIR/ | ||
- | PKGNAME=netcdf | ||
- | # Change this to the version of netcdf | ||
- | VERSION=1.1.7.1 | ||
- | # Change this to the version of python | ||
- | PY_VERS=2.7.8 | ||
- | |||
- | # Load the udbuild package | ||
- | vpkg_devrequire udbuild | ||
- | |||
- | # These are all the dependencies for netcdf specifying the | ||
- | # particular python version based on PY_VERS environment variable | ||
- | vpkg_devrequire python/ | ||
- | vpkg_devrequire python-numpy/ | ||
- | vpkg_devrequire netcdf/4.3 | ||
- | |||
- | # This initializes the environment for the build based on the | ||
- | vpkg_devrequire python-numpy/ | ||
- | vpkg_devrequire netcdf/4.3 | ||
- | |||
- | # This initializes the environment for the build based on the | ||
- | # package name and version, and we use the install option | ||
- | # for a python add-on (python-addon) | ||
- | init_udbuildenv python-addon | ||
- | |||
- | # These are environment variables needed for the install - hints for | ||
- | # what might be needed can be found in the setup.cfg.template file | ||
- | export HDF5_DIR=${HDF5_PREFIX} | ||
- | export NETCDF4_DIR=${NETCDF_PREFIX} | ||
- | export HDF4_DIR=${HDF4_PREFIX} | ||
- | |||
- | # Standard install is ' | ||
- | # the correct version of python we are building the add-on for as defined | ||
- | # above rather than a default system version | ||
- | $PYTHON setup.py build | ||
- | |||
- | $PYTHON setup.py install --prefix=$PREFIX | ||
- | |||
- | </ | ||
- | |||
- | The python example above is used to install the netcdf library version 1.1.7.1 add-on for python version 2.7.8 in the shared research software directory '' | ||
- | |||
- | <file sh python-netcdf.vpkg_json> | ||
- | # | ||
- | # This is the python-netcdf package for VALET 2.0 | ||
- | # supporting json package style. | ||
- | # | ||
- | { | ||
- | " | ||
- | # Change to your install location (i.e. < | ||
- | " | ||
- | " | ||
- | " | ||
- | |||
- | " | ||
- | |||
- | " | ||
- | " | ||
- | |||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | |||
- | } | ||
- | ], | ||
- | |||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | }, | ||
- | |||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | ] | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | ] | ||
- | } | ||
- | } | ||
- | } | ||
- | } | ||
- | </ |