# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild
# Author: Pablo Escobar Lopez
# Swiss Institute of Bioinformatics
# Biozentrum - University of Basel
# 2019-06-05 John Dey jfdey@fredhutch.org fizwit@github.com - updated for CMake
easyblock = 'CMakeMake'

name = 'NLopt'
version = '2.6.2'

homepage = 'http://ab-initio.mit.edu/wiki/index.php/NLopt'
description = """ NLopt is a free/open-source library for nonlinear optimization,
 providing a common interface for a number of different free optimization routines
 available online as well as original implementations of various other algorithms. """

toolchain = {'name': 'GCCcore', 'version': '10.2.0'}
toolchainopts = {'pic': True}

source_urls = ['https://github.com/stevengj/nlopt/archive']
sources = ['v%(version)s.tar.gz']
checksums = ['cfa5981736dd60d0109c534984c4e13c615314d3584cf1c392a155bfe1a3b17e']

builddependencies = [
    ('CMake', '3.18.4'),
    ('binutils', '2.35'),
]

configopts = [
    '-DBUILD_SHARED_LIBS=ON',
    '-DBUILD_SHARED_LIBS=OFF'
]

sanity_check_paths = {
    'files': ['lib/libnlopt.a', 'lib/libnlopt.%s' % SHLIB_EXT, 'include/nlopt.h'],
    'dirs': ['lib/pkgconfig'],
}

moduleclass = 'numlib'
