easyblock = 'MakeCp'

name = 'SPRNG'
version = '2.0b'

homepage = 'http://www.sprng.org/'
description = "Scalable Parallel Pseudo Random Number Generators Library"

toolchain = {'name': 'goolf', 'version': '1.4.10'}
toolchainopts = {'usempi': True}

source_urls = ['http://www.sprng.org/Version2.0/']
sources = ['%(namelower)s%(version)s.tar.gz']

patches = ['SPRNG-2.0_fix-metropolis-test.patch']

dependencies = [('GMP', '5.1.3')]

buildopts = 'PLAT=INTEL MPIDEF="-DSPRNG_MPI" CC="$CC" F77="$F77" PMLCGDEF="-DUSE_PMLCG" GMPLIB="-L$EBROOTGMP/lib -lgmp" FFXN="-DAdd_"'

# does not support parallel build
parallel = 1

files_to_copy = [
    (['lib/libsprng.a'], 'lib'),
    (['include/interface.h', 'include/sprng.h', 'include/sprng_f.h'], 'include'),
]

sanity_check_paths = {
    'files': ["lib/libsprng.a"],
    'dirs': [],
}

moduleclass = 'lib'
