aboutsummaryrefslogtreecommitdiffstats
path: root/math/sdpa/Makefile
blob: 1d212f2dd2814218623e67ce5b7e88b4ec5b4e16 (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
62
63
64
65
66
67
# New ports collection makefile for:    sdpa
# Date created:                         October 4 2003
# Whom:                                 NAKATA, Maho <maho@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   sdpa
PORTVERSION=    7.3.0
CATEGORIES= math
MASTER_SITES=   http://sdpa.indsys.chuo-u.ac.jp/sdpa/files/
DISTFILES=  ${SRCFILE} ${MANUALFILE}
DIST_SUBDIR=    sdpa
EXTRACT_ONLY=   ${SRCFILE}

MAINTAINER= maho@FreeBSD.org
COMMENT=    SDPA(SemiDefinite Programming Algorithm) Very efficent SDP Solver

.include <bsd.port.pre.mk>

SRCDATE=    20090321
MANDATE=    20080618
MANUALVER=  7.1.1
SRCFILE=    ${PORTNAME}.${PORTVERSION}.src.${SRCDATE}.tar.gz
MANUALFILE= ${PORTNAME}.${MANUALVER}.manual.${MANDATE}.pdf
USE_FORTRAN=    yes
GNU_CONFIGURE=  yes
USE_GMAKE=  yes
WRKSRC=     ${WRKDIR}/${PORTNAME}.${PORTVERSION}
USE_BLAS?=  reference

.if exists(${LOCALBASE}/lib/libgoto.so)
USE_BLAS=     gotoblas
.elif exists(${LOCALBASE}/lib/libatlas_r.so)
USE_BLAS=     atlas
.endif

. if ${USE_BLAS} == reference
LIB_DEPENDS+=   blas.2:${PORTSDIR}/math/blas
LIB_DEPENDS+=   lapack.4:${PORTSDIR}/math/lapack
BLAS=       -lblas
LAPACK=     -llapack
.elif ${USE_BLAS} == gotoblas
LIB_DEPENDS+=   goto:${PORTSDIR}/math/gotoblas
LIB_DEPENDS+=   lapack.4:${PORTSDIR}/math/lapack
BLAS=       -lgotop
LAPACK=     -lgotop -llapack
.elif ${USE_BLAS} == atlas
LIB_DEPENDS+=   atlas:${PORTSDIR}/math/atlas
BLAS=       -lptf77blas -lptcblas -latlas_r
LAPACK=     -lalapack_r
.endif

CONFIGURE_ARGS+=--with-blas="-L${LOCALBASE}/lib ${BLAS}" --with-lapack="-L${LOCALBASE}/lib ${LAPACK}"

PLIST_SUB+= MANUALFILE=${MANUALFILE}

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/sdpa ${PREFIX}/bin
    @${MKDIR} ${DATADIR}
    ${INSTALL_DATA}    ${WRKSRC}/param.sdpa ${DATADIR}
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
    ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/${MANUALFILE} ${DOCSDIR}
.endif

.include <bsd.port.post.mk>