PortSystem 1.0
PortGroup  mpi 1.0

name		optpp
version		2.4
revision        1
categories	math
platforms	darwin
maintainers	nomaintainer
license     LGPL
description	C++ library for non-linear optimization
long_description	\
	OPT++ is a C++ library for non-linear optimization.

homepage	https://software.sandia.gov/opt++/
distname	optpp-${version}
master_sites	${homepage}/downloads/
checksums   md5     7bd39f389c19ef16c3f62bc6ffa06234 \
            sha1    089fb515f2f2e8632d603f2d1306d39aa355e9f0 \
            rmd160  1f554c4702dedc24150f198e1a1df35ad1bf9a19

compilers.choose cc cxx
mpi.setup

patchfiles patch-acx_blas.m4.diff
use_autoconf yes
configure.ldflags	"-framework vecLib"
configure.args --includedir=${prefix}/include/OPT++ --with-blas

pre-configure {
    if {[mpi_variant_isset]} {
        configure.args-append --enable-mpi
        configure.env-append MPICC=${mpi.cc} \
                             MPICXX=${prefix}/lib/openmpi/bin/mpic++
    }
}

livecheck.type  regex
livecheck.url   ${master_sites}
livecheck.regex ${name}-(\[0-9.\]+)\\.tar\\.gz