aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/nqueens/Makefile
blob: 6c59879d19a252320ec713176f46fde80f9c1a53 (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
# Created by: NAKAJI Hiroyuki <nakaji@jp.freebsd.org>
# $FreeBSD$

PORTNAME=   nqueens
PORTVERSION=    1.0
CATEGORIES= benchmarks
MASTER_SITES=   http://www.arch.cs.titech.ac.jp/~kise/nq/package/
DISTNAME=   qn24b-version${PORTVERSION}
EXTRACT_SUFX=   .tgz

MAINTAINER= nakaji@jp.freebsd.org
COMMENT=    N-queens benchmark

WRKSRC=     ${WRKDIR}/version${PORTVERSION}

OPTIONS_DEFINE= MPI STATIC OPTIMIZED_CFLAGS
MPI_DESC=   Build distributed MPI version
STATIC_DESC=    Link resulting binaries statically

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS}
CFLAGS+=    -O3 -pipe -s -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations
.endif
.if ${PORT_OPTIONS:MSTATIC}
CFLAGS+=    -static
.endif

PROGS=      qn24b_base

.if ${PORT_OPTIONS:MMPI}
MPICC?=     ${LOCALBASE}/mpich/bin/mpicc
BUILD_DEPENDS=  ${MPICC}:net/mpich
PROGS+=     qn24b_mpi
.endif

post-extract:
    @${RM} -f ${WRKSRC}/qn24b_base

do-build:
    cd ${WRKSRC} && \
    ${CC} ${CFLAGS} -o qn24b_base base/queens.c
do-build-MPI-on:
    cd ${WRKSRC} && \
    ${MPICC} ${CFLAGS} -o qn24b_mpi mpi/main.c

PLIST_FILES=    ${PROGS:S/^/bin\//}

do-install:
.for p in ${PROGS}
    ${INSTALL_PROGRAM} ${WRKSRC}/${p} ${STAGEDIR}${PREFIX}/bin/
.endfor

.include <bsd.port.mk>