Skip to content

Latest commit

 

History

History
474 lines (377 loc) · 18.1 KB

INSTALL.md

File metadata and controls

474 lines (377 loc) · 18.1 KB

Installing OpenCoarrays

GitHub release Github All Releases Download as PDF

Download this file as a PDF document here.

End-User Installation

Most users will find it easiest and fastest to use package management software to install OpenCoarrays. Package management options for macOS (formerly known as OS X), Windows, and Linux are described first below. Also described below are options for installing via the Sourcery Institute virtual machine or the OpenCoarrays installation script.

top

macOS

homebrew

macOS users may use the Homebrew or MacPorts package management systems to install OpenCoarrays. We recommend Homebrew.

Basic Homebrew installation steps:

brew update
brew install opencoarrays

OpenCoarrays also ships with a Brewfile that will make it easier to install opencoarrays using MPICH built with GCC. To install using the Brewfile with MPICH wrapping GCC, follow these steps:

brew tap homebrew/bundle
brew update
brew bundle

MacPorts installation steps:

sudo port selfupdate
sudo port upgrade outdated
sudo port install opencoarrays

where the sudo command requires administrator privileges. If you install using MacPorts, please also install the mpstats port as follows:

sudo port install mpstats

which supports future OpenCoarrays development by providing download data the OpenCoarrays team uses in proposals for research grants and development contracts.

top

Windows

Windows users may run the windows-install.sh script inside the Windows Subsystem for Linux (WSL).

Requirements:

  • WSL release 14936 or later,
  • Windows Insider Preview, and
  • "Fast" updates option.

Steps:

 do-release-upgrade
./windows-install.sh

where the first command above updates the default Ubuntu 14.04 to 16.04 and the second command must be executed with the present working directory set to the top level of the OpenCoarrays source tree.

The windows-install.sh installation script uses Ubuntu's apt-get package manager to build GCC 5.4.0, CMake, and MPICH. Windows users who desire a newer version of GCC are welcome to submit a request via our Issues page and suggest a method for updating. Previously attempted upgrade methods are described in the discussion thread starting with commit comment 20539810.

top

Linux

Access OpenCoarrays on Linux via any of the following package managers or pre-installed copies:

  • The linuxbrew package manager installs OpenCoarrays on all Linux distributions.
  • Debian-based distributions such as Ubuntu provide an "open-coarrays" APT package.
  • Arch Linux provides an aur package.
  • HPCLinux includes a pre-installed copy of OpenCoarrays.
  • EasyBuild, a software build and installation framework, can install OpenCoarrays on Linux distributions
  • Spack, a multiplatform package manager, can also install OpenCoarrays on Linux distributions

linuxbrew does not require sudo privileges and will generally provide the most up-to-date OpenCoarrays release because linxubrew pulls directly from macOS homebrew, which updates automatically.

EasyBuild can be used to install OpenCoarrays with the following bash commands:

# Search available specification files (also known as easyconfigs) for OpenCoarrays
eb --search OpenCoarrays

# Automatically download prerequisites (with the --robot flag) and install OpenCoarrays
# with the desired easyconfig, e.g., OpenCoarrays-1.9.0-gompi-2017a.eb
eb OpenCoarrays-1.9.0-gompi-2017a.eb --robot

Once installed, OpenCoarrays can be used by loading the newly created environment module OpenCoarrays/1.9.0-gompi-2017a.

module load OpenCoarrays/1.9.0-gompi-2017a

Spack can be used to install OpenCoarrays with the following bash commands:

# Check build information for OpenCoarrays in the default specification file
spack spec opencoarrays

# To automatically download prerequisites and install OpenCoarrays with the default specification.
# (Note: In addition to its own prerequisites, Spack requires gfortran compiler
# to be installed to compile OpenMPI)
spack install opencoarrays

# Or, To install with customisations (e.g., to install OpenCoarrays [version 1.9.0]
# with MPICH [version default] and GCC [version 7.1.0]).
spack install opencoarrays@1.9.0 ^mpich %gcc@7.1.0

In the previous example, it was assumed that GCC [version 7.1.0] is already installed, and is available as a compiler to Spack. Otherwise, add a new compiler to Spack. Once installed, OpenCoarrays can be used by loading the environment modules with Spack, e.g.

spack module loads --dependencies opencoarrays

top

FreeBSD

A FreeBSD Port is available for installing OpenCoarrays. FreeBSD users can now simply do the following as root:

pkg install opencoarrays

For more information, please review the FreeBSD ports/packages installation information.

top

Virtual machine

Users of macOS, Windows, or Linux have the option to use OpenCoarrays by installing the Lubuntu Linux virtual machine from the Sourcery Institute Store. The virtual machine boots inside the open-source VirtualBox virtualization package. In addition to containing GCC, MPICH, and OpenCoarrays, the virtual machine contains dozens of other open-source software packages that support modern Fortran software development. See the download and installation instructions for a partial list of the included packages.

top

Installation Script

If the above package management or virtualization options are infeasible or unavailable, Linux and macOS users may also install OpenCoarrays by downloading and uncompressing our latest release and running our installation script in the top-level OpenCoarrays source directory (see above for the corresponding Windows script):

tar xvzf OpenCoarrays-x.y.z.tar.gz
cd OpenCoarrays-x.y.z
./install.sh

where x.y.z should be replaced with the appropriate version numbers. For a scripted or unattended build, use ./install.sh -y or equivalently ./install.sh --yes-to-all, which will assume affirmative answers to all user prompts and will only prompt the user if an installation directory is chosen that requires sudo privelenges (by passing -i or equivalently --install-prefix).

Before installing OpenCoarrays, the above bash script will attempt to detect the presence of the default prerequisite packages: GCC, MPICH , and CMake. For additional details, see the Prerequisites section. If any of the installation script cannot find the prerequisite packages, the install.sh script will attempt to download, build, and install any missing packages after asking permission to do so. The script has been tested on Linux and OS X. Please submit any related problems or questions to our Issues page.

A complete installation should result in the creation of the following directories inside the installation path (.e.g, inside build in the above example):

  • bin: contains the compiler wrapper (caf) and program launcher (cafun).
  • mod: contains the opencoarrays.mod module file for use with non-OpenCoarrays-aware compilers
  • lib: contains the libcaf_mpi.a static library to which codes link for CAF support

top

Advanced Installation from Source

Prerequisites

The prerequisites below and their dependencies are recommended for the broadest coverage of CAF features. If a prerequisite is missing or outdated, the install.sh script will prompt the user for permission to download, compile, and install it. Before doing so, install.sh will verify whether that prerequisite's prerequisites are present and will recursively traverse the dependency tree until reaching an acceptable prerequisite or reaching the end of a branch.

opencoarrays
├── cmake-3.4.0
└── mpich-3.2
    └── gcc-6.1.0
        ├── flex-2.6.0
        │   └── bison-3.0.4
        │       └── m4-1.4.17
        ├── gmp
        ├── mpc
        └── mpfr

If using the advanced CMake or Make builds detailed below, please ensure that these dependencies are met before attempting to build and install OpenCoarrays.

top

CMake scripts

N.B.

As of OpenCoarrays 1.7.6, passing FC=mpi_fortran_wrapper and CC=mpi_c_wrapper is DEPRECATED. Please pass FC=/path/to/gfortran and CC=/path/to/gcc. If you are experimenting with the source to source translation capabilities, then please point FC and CC to your Fortran and C compilers of choice. In the case of Cray, or a compiler in which MPI is built-in to the compiler, you still pass the FC and CC as the Fortran and C compiler, even though MPI is built-in.

CMake is the preferred build system. CMake is a cross-platform Makefile generator that includes the testing tool CTest. To avoid cluttering or clobbering the source tree, our CMake setup requires that your build directory be any directory other than the top-level OpenCoarrays source directory. In a bash shell, the following steps should build OpenCoarrays, install OpenCoarrays, build the tests, run the tests, and report the test results:

tar xvzf opencoarrays.tar.gz
cd opencoarrays
mkdir opencoarrays-build
cd opencoarrays-build
CC=gcc FC=gfortran cmake .. -DCMAKE_INSTALL_PREFIX=${HOME}/packages/
make
ctest
make install

where the the first part of the cmake line sets the CC and FC environment variables and the final part of the same line defines the installation path as the packages directory in the current user's $HOME directory. Please report any test failures via the OpenCoarrays Issues page. Please note that you need a recent GCC/GFortran, and a recent MPI-3 implementation. If CMake is having trouble finding the MPI implementation, or is finding the wrong MPI implementation, you can try setting the MPI_HOME environment variable to point to the installation you wish to use. If that fails, you can also try passing the -DMPI_Fortran_COMPILER=/path/to/mpi/fortran/wrapper/script and -DMP_C_COMPILER=/path/to/mpi/c/wrapper/script options to CMake.

Advanced options (most users should not use these):

-DMPI_HOME=/path/to/mpi/dir  # try to force CMake to find your preferred MPI implementation
        # OR
-DMPI_C_COMPILER=/path/to/c/wrapper
-DMPI_Fortran_COMPILER=/path/to/fortran/wrapper

-DLEGACY_ARCHITECTURE=OFF    # enables the use of FFT libraries that employ AVX instructions
-DHIGH_RESOLUTION_TIMER=ON   # enables timers that tick once per clock cycle
-DCOMPILER_SUPPORTS_ATOMICS  # enables support for the proposed-Fortran 2015 events
                             # feature
-DUSE_EXTENSIONS             # builds the opencoarrays module for use-with non-
                             # OpenCoarrays-aware compilers
-DCOMPILER_PROVIDES_MPI      # is set automatically when building with-the Cray
                             # Compiler Environment

The fourth and fifth flags above are not portable and the sixth enables code that is incomplete as of release 1.0.0. The eighth is set automatically by the CMake scripts based on the compiler identity and version.

top

Make

Unlike the Makefiles that CMake generates automatically for the chosen platform, static Makefiles require a great deal more maintenance and are less portable. Also, the static Makefiles provided with OpenCoarrays lack several important capabilities. In particular, they will not build the tests; they will not build any of the infrastructure for compiling CAF source with non-OpenCoarrays-aware compilers (that infrastructure includes the opencoarrays module, the caf compiler wrapper, and the cafrun program launcher); nor do the static Makefiles provide a make install option so you will need to manually move the desired library from the corresponding source directory to your intended installation location as shown below.

If CMake is unavailable, build and install with Make using steps such as the following:

tar xvzf opencoarrays.tar.gz
cd opencoarray/src
make
mv mpi/libcaf_mpi.a <installation-path>

For the above steps to succeed, you might need to edit the make.inc file to match your system settings. For example, you might need to remove the -Werror option from the compiler flags or name a different compiler. In order to activate efficient strided-array transfer support, uncomment the -DSTRIDED flag inside the make.inc file.

top

Obtaining GCC, MPICH, and CMake

GFortran Binaries binary builds are available at https://gcc.gnu.org/wiki/GFortranBinaries.

To build all prerequisites from source, including the current development branch of GCC, you might first try the running the provided install.sh script as described above in the Installation Script section or try building each prerequisite from source inside a bash shell as follows:

export gcc_install_path=/desired/installation/destination
./install.sh --package gcc --install-prefix "${gcc_install_path}"
./install.sh --package mpich \
   --with-fortran "${gcc_install_path}"/bin/gfortran \
   --with-c       "${gcc_install_path}"/bin/gcc      \
   --with-cxx     "${gcc_install_path}"/bin/g++
./install.sh --pacakge cmake \
   --with-fortran "${gcc_install_path}"/bin/gfortran \
   --with-c       "${gcc_install_path}"/bin/gcc      \
   --with-cxx     "${gcc_install_path}"/bin/g++

top


GitHub forks GitHub stars GitHub watchers Twitter URL