easyblock = 'MakeCp'

name = 'Triangle'
version = '1.6'

homepage = 'http://www.cs.cmu.edu/~quake/triangle.html'
description = """Triangle generates exact Delaunay triangulations, constrained Delaunay triangulations,
 conforming Delaunay triangulations, Voronoi diagrams, and high-quality triangular meshes.
 The latter can be generated with no small or large angles,
 and are thus suitable for finite element analysis."""

toolchain = {'name': 'intel', 'version': '2017a'}
toolchainopts = {'pic': True}

source_urls = ['http://www.netlib.org/voronoi/']
sources = ['%(namelower)s.zip']
checksums = [('md5', '10aff8d7950f5e0e2fb6dd2e340be2c9')]

patches = ['%(name)s-%(version)s_makefile.patch']

buildopts = 'triangle trilibrary'

files_to_copy = [
    (['triangle', 'tricall'], 'bin'),
    (['triangle.h'], 'include'),
    (['libtriangle.a'], 'lib'),
]

sanity_check_paths = {
    'files': ['bin/triangle', 'bin/tricall', 'include/triangle.h', 'lib/libtriangle.a'],
    'dirs': []
}

moduleclass = 'numlib'
