/net-im/telepathy-gabble/files/

git/freebsd-ports-gnome' title='freebsd-ports-gnome Git repository'/>
aboutsummaryrefslogtreecommitdiffstats
path: root/math/ipopt/Makefile
blob: 77dcf7e96a6759e00381d7d0cf2c14ad1f12f9aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Created by: Pedro Giffuni
# $FreeBSD$

PORTNAME=   Ipopt
DISTVERSION=    3.12.12
PORTREVISION=   1
CATEGORIES= math
MASTER_SITES=   http://www.coin-or.org/download/source/Ipopt/ \
        http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/OLD/:metis \
        http://mumps.enseeiht.fr/:mumps
DISTFILES=  ${DISTNAME}${EXTRACT_SUFX} \
        metis-4.0.3.tar.gz:metis MUMPS_4.10.0.tar.gz:mumps
EXTRACT_ONLY=   ${DISTNAME}${EXTRACT_SUFX}

MAINTAINER= yuri@FreeBSD.org
COMMENT=    Software package for large-scale nonlinear optimization

LICENSE=    EPL

USES=       blaslapack fortran libtool pathfix pkgconfig tar:tgz
GNU_CONFIGURE=  yes
USE_LDCONFIG=   yes
TEST_TARGET=    test
INSTALL_TARGET= install-strip

CONFIGURE_ENV+= PKG_CONFIG_PATH=${PREFIX}/libdata/pkgconfig \
        CXX="${CXX} -B${LOCALBASE}/bin"
CONFIGURE_ARGS= --with-lapack-lib="${LAPACKLIB} -L${LOCALBASE}/lib" \
        --with-blas-lib="${BLASLIB} -L${LOCALBASE}/lib"

CXXFLAGS+=  -ffast-math

OPTIONS_DEFINE= DEBUG DOCS
PORTDOCS=   *

DEBUG_CXXFLAGS= -fomit-frame-pointer

post-extract:
    @(${ECHO} "Extracting Metis and Mumps ThirdParty libraries ..." )
    @(cd ${WRKSRC}/ThirdParty/Metis && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/metis-4.0.3.tar.gz ${EXTRACT_AFTER_ARGS});
    @(${MV} ${WRKSRC}/ThirdParty/Metis/metis-4.0.? ${WRKSRC}/ThirdParty/Metis/metis-4.0);
    @(cd ${WRKSRC}/ThirdParty/Mumps && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/MUMPS_4.10.0.tar.gz ${EXTRACT_AFTER_ARGS});
    @(${MV} ${WRKSRC}/ThirdParty/Mumps/MUMPS_4.10.0 ${WRKSRC}/ThirdParty/Mumps/MUMPS);

pre-patch:
    @(cd ${WRKSRC}/ThirdParty/Mumps && ${PATCH} -p0 < mumps.patch && ${PATCH} -p0 < mumps_mpi.patch )
    @(${MV} ${WRKSRC}/ThirdParty/Mumps/MUMPS/libseq/mpi.h ${WRKSRC}/ThirdParty/Mumps/MUMPS/libseq/mumps_mpi.h);

pre-build: # workaround: configure fails to find the 'rand' function on 12, need to investigate. This patch unbreaks the build.
    @${REINPLACE_CMD} -e 's|.*HAVE_RAND.*|#define HAVE_RAND 1|' ${WRKSRC}/Ipopt/src/Common/config.h

post-install-DOCS-off:
    @${RM} -r ${STAGEDIR}${PREFIX}/share/coin

post-install-DOCS-on:
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/Ipopt/doc/documentation.pdf ${STAGEDIR}${DOCSDIR}
    ${MV} ${STAGEDIR}${PREFIX}/share/coin/doc ${STAGEDIR}${DOCSDIR}
    @${RM} -r ${STAGEDIR}${PREFIX}/share/coin

.include <bsd.port.mk>