# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           legacysupport 1.1
PortGroup           mpi 1.0
PortGroup           github 1.0

# For now only for wrappers:
# ipopt_sens(55357) malloc: *** error for object 0xa04dc754: pointer being freed was not allocated
legacysupport.newest_darwin_requires_legacy 0
legacysupport.redirect_bins ipopt ipopt_sens

github.setup        coin-or ipopt 3.14.19 releases/
revision            0
categories          math
license             Eclipse

maintainers         nomaintainer

homepage            https://coin-or.github.io/Ipopt
description         COIN-OR Interior Point Optimizer IPOPT
long_description    {*}${description}

checksums           rmd160  92f25e2c5916e5588ddee8ad0f5423e850daafa5 \
                    sha256  b3eb84a23812b53a3325bcd2c599de2b0f5df45a18ed251f9e3c1cd893136287 \
                    size    1876140
github.tarball_from archive

mpi.setup           require

# See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1111549
patchfiles-append   a36b5d36179c9357310aa9ec3102819eb66570af.patch

depends_build-append \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  path:lib/libopenblas.dylib:OpenBLAS \
                    port:asl \
                    port:mumps \
                    port:scalapack \
                    port:spral

configure.args-append \
                    --disable-java \
                    --disable-silent-rules \
                    --without-dot \
                    --without-hsl \
                    --without-pardiso

# OpenBLAS
configure.args-append \
                    --with-lapack-lflags=-lopenblas

# Enforce usage system's Mumps
configure.args-append \
                    --with-mumps-lflags="-lmumps_common -lesmumps -lsmumps -ldmumps -lcmumps -lzmumps -lpord"

# Enforce usage system's ASL
configure.args-append \
                    --with-asl-cflags=-I${prefix}/include/asl \
                    --with-asl-lflags=-lasl

compiler.cxx_standard 2011
