easyblock = "Toolchain"

name = 'foss'
version = '2015g'

homepage = '(none)'
description = """GNU Compiler Collection (GCC) based local_compiler toolchain, including
 OpenMPI for MPI support, OpenBLAS (BLAS and LAPACK support), FFTW and ScaLAPACK."""

toolchain = SYSTEM

local_gccver = '4.9.3'
local_local_binutilsver = '2.25'
local_tcver = '%s-local_binutils-%s' % (local_gccver, local_local_binutilsver)

local_blaslib = 'OpenBLAS'
local_blasver = '0.2.14'
local_blas = '%s-%s' % (local_blaslib, local_blasver)
local_blaslocal_suff = '-LAPACK-3.5.0'

# toolchain used to build foss dependencies
local_comp_mpi_tc_name = 'gompi'
local_comp_mpi_tc_ver = "%s" % version
local_comp_mpi_tc = (local_comp_mpi_tc_name, local_comp_mpi_tc_ver)

# local_compiler toolchain depencies
# we need GCC and OpenMPI as explicit dependencies instead of gompi toolchain
# because of toolchain preperation functions
# For local_binutils, stick to http://wiki.osdev.org/Cross-Compiler_Successful_Builds
dependencies = [
    ('GCC', local_gccver, '-local_binutils-%s' % local_local_binutilsver),
    ('binutils', local_local_binutilsver, '', ('GCC', local_tcver)),
    ('OpenMPI', '1.8.8', '', ('GNU', '%s-%s' % (local_gccver, local_local_binutilsver))),
    (local_blaslib, local_blasver, local_blaslocal_suff, ('GNU', '%s-%s' % (local_gccver, local_local_binutilsver))),
    ('FFTW', '3.3.4', '', local_comp_mpi_tc),
    ('ScaLAPACK', '2.0.2', '-%s%s' % (local_blas, local_blaslocal_suff), local_comp_mpi_tc),
]

moduleclass = 'toolchain'
