aboutsummaryrefslogtreecommitdiffstats
path: root/math/libocas/Makefile
blob: d84cc79336d1e75e967597736eefc11ef0d56117 (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
# New ports collection makefile for:    libocas
# Date created:     5 Oct 2011
# Whom:     b.f. <bf@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   libocas
PORTVERSION=    0.96
CATEGORIES= math
MASTER_SITES=   http://cmp.felk.cvut.cz/~xfrancv/ocas/ LOCAL/bf
DISTNAME=   ${PORTNAME}_v${PORTVERSION:S/.//}

MAINTAINER= bf@FreeBSD.org
COMMENT=    Efficient training of SVM classifiers

LICENSE=    GPLv3

USE_GMAKE=  yes
USE_LDCONFIG=   yes
USE_ZIP=    yes

ALL_TARGET= clean libocas.so.1 svmocas msvmocas linclassif
CLIBS=      -lm ${PTHREAD_LIBS}
MAKE_ENV=   CLIBS="${CLIBS}" MEXDETECTED=no

PLIST_FILES=    bin/linclassif bin/msvmocas bin/svmocas lib/libocas.so \
        lib/libocas.so.1

.include <bsd.port.pre.mk>

.if ${ARCH} == sparc64
PICFLAG=    -fPIC
.else
PICFLAG=    -fpic
.endif

CFLAGS+=    ${PICFLAG} ${PTHREAD_CFLAGS}

post-patch:
    @${REINPLACE_CMD} \
        -e '\|:=|d' \
        -e 's|libocas\.so|&.1|' \
        -e '\|$$(CC) $$(CFLAGS) -o|{s|$$(CFLAGS)|& ${LDFLAGS}|;}' \
        ${WRKSRC}/Makefile

do-install:
.for p in linclassif msvmocas svmocas
    @${INSTALL_PROGRAM} ${WRKSRC}/${p} ${PREFIX}/bin
.endfor
    @${INSTALL_LIB} ${WRKSRC}/libocas.so.1 ${PREFIX}/lib
    @${LN} -sf libocas.so.1 ${PREFIX}/lib/libocas.so

check regression-test test: build
    ${WRKSRC}/msvmocas -c 10 -v 1 ${WRKSRC}/data/example4_train.light \
        ${WRKSRC}/data/msvmocas.model
    ${WRKSRC}/linclassif -e -v 1 -o ${WRKSRC}/data/example4_test.pred \
        ${WRKSRC}/data/example4_test.light ${WRKSRC}/data/msvmocas.model
    ${WRKSRC}/svmocas -c 10 -b 1 -v 1 ${WRKSRC}/data/riply_trn.light \
        ${WRKSRC}/data/svmocas.model
    ${WRKSRC}/linclassif -e -v 1 -o ${WRKSRC}/data/riply_tst.pred \
        ${WRKSRC}/data/riply_tst.light ${WRKSRC}/data/svmocas.model

.include <bsd.port.post.mk>