forked from Lainports/freebsd-ports
116 lines
3.3 KiB
Makefile
116 lines
3.3 KiB
Makefile
# New ports collection makefile for: fflas-ffpack
|
|
# Date created: 5 Oct 2011
|
|
# Whom: b.f. <bf@FreeBSD.org>
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
PORTNAME= fflas-ffpack
|
|
PORTVERSION= 1.4.3
|
|
CATEGORIES= math
|
|
MASTER_SITES= http://linalg.org/ LOCAL/bf
|
|
|
|
MAINTAINER= bf@FreeBSD.org
|
|
COMMENT= A library for dense linear algebra over word-size finite fields
|
|
|
|
LICENSE= LGPL20
|
|
|
|
LIB_DEPENDS= gmp.10:${PORTSDIR}/math/gmp
|
|
|
|
GNU_CONFIGURE= yes
|
|
CONFIGURE_ARGS = --with-gmp="${LOCALBASE}"
|
|
|
|
.if defined(PACKAGE_BUILDING)
|
|
OPTIMIZATION_DEFAULT= off
|
|
.else
|
|
OPTIMIZATION_DEFAULT= on
|
|
.endif
|
|
|
|
OPTIONS= DOCS "build HTML documents (requires doxygen)" off \
|
|
OPTIMIZATION "optimize for the build machine" ${OPTIMIZATION_DEFAULT}
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
.if ${LOCALBASE} == "/usr/local"
|
|
CPPFLAGS+= -I${LOCALBASE}/include
|
|
LDFLAGS+= -L${LOCALBASE}/lib
|
|
.endif
|
|
|
|
.if defined(MAINTAINER_MODE)
|
|
CONFIGURE_ARGS+= --with-givaro="${LOCALBASE}"
|
|
LIB_DEPENDS+= givaro.3:${PORTSDIR}/math/givaro
|
|
.else
|
|
CONFIGURE_ARGS+= --with-givaro=no
|
|
.endif
|
|
|
|
#a C interface to BLAS is needed
|
|
WITH_BLAS?= gsl
|
|
|
|
.if ${WITH_BLAS} == "gotoblas"
|
|
CONFIGURE_ARGS+= --with-gotoblas2="${LOCALBASE}" --with-lapack=blas
|
|
LIB_DEPENDS+= goto2p:${PORTSDIR}/math/gotoblas
|
|
USE_FORTRAN= yes
|
|
.elif ${WITH_BLAS} == "atlas"
|
|
CONFIGURE_ARGS+= --with-cblas="${LOCALBASE}" --with-lapack=blas
|
|
LIB_DEPENDS+= cblas.2:${PORTSDIR}/math/atlas
|
|
USE_FORTRAN= yes
|
|
.elif ${WITH_BLAS} == "gsl"
|
|
CONFIGURE_ARGS+= --with-gsl="${LOCALBASE}"
|
|
LIB_DEPENDS+= gslcblas.0:${PORTSDIR}/math/gsl
|
|
.else
|
|
IGNORE = unknown value of WITH_BLAS: ${WITH_BLAS}
|
|
.endif
|
|
|
|
.if defined(WITH_DOCS) && !defined(NOPORTDOCS)
|
|
BUILD_DEPENDS += doxygen:${PORTSDIR}/devel/doxygen
|
|
CONFIGURE_ARGS+= --enable-doc --with-docdir="${DOCSDIR}"
|
|
.elifndef(NOPORTDOCS)
|
|
NOPORTDOCS= yes
|
|
.endif
|
|
|
|
.if defined(WITH_OPTIMIZATION)
|
|
MANUAL_PACKAGE_BUILD= : optimizes for the build machine
|
|
.else
|
|
CONFIGURE_ARGS+= --disable-optimization
|
|
.endif
|
|
|
|
post-patch:
|
|
${REINPLACE_CMD} -e '/DEFAULT_CFLAGS=/{s/-O2 //;s/-pipe//;}' \
|
|
-e '/DEBUG_CFLAGS=.*-DNDEBUG/s/$${DEBUG_CFLAGS} //' \
|
|
-e '/^WARN_CFLAGS="-Wall"/d' \
|
|
-e '/if test "x$$WARN" = "xyes"/s/$$/ WARN_CFLAGS="-Wall" ;/' \
|
|
-e 's/\(-lgoto2\)\( -pthread\)\{0,1\}/\1p/g' -e 's/libgoto2/&p/g' \
|
|
-e '/"GOTO2")/{N; s/LAPACK_LIBS=""/LAPACK_LIBS="-lgoto2p"/; }' \
|
|
-e 's/liblapack_atlas/libalapack/g' \
|
|
-e 's/$${LAPACK_LIBS} -llapack_atlas/-lalapack -lf77blas -lcblas/g' \
|
|
${WRKSRC}/configure
|
|
#Unfortunately, we must leave stdint.h --> cstdint unresolved when not using
|
|
#lang/gcc4*, or switch to TR1 headers, due to our aging base system libstdc++
|
|
${REINPLACE_CMD} -E \
|
|
-e 's/(#include[[:blank:]]+<)(std)(arg|def|io|lib)(\.h>)/\1c\2\3>/' \
|
|
${WRKSRC}/fflas-ffpack/field/nonzero-randiter.h \
|
|
${WRKSRC}/fflas-ffpack/field/modular-randiter.h \
|
|
${WRKSRC}/fflas-ffpack/utils/args-parser.h \
|
|
${WRKSRC}/fflas-ffpack/utils/debug.h \
|
|
${WRKSRC}/fflas-ffpack/utils/Matio.h \
|
|
${WRKSRC}/utils/args-parser.h \
|
|
${WRKSRC}/utils/debug.h \
|
|
${WRKSRC}/utils/Matio.h
|
|
.if defined(WITH_DOCS) && !defined(NOPORTDOCS)
|
|
@${REINPLACE_CMD} -e 's/sed -i/& ""/' ${WRKSRC}/doc/Makefile.in
|
|
.endif
|
|
|
|
.if defined(WITH_DOCS) && !defined(NOPORTDOCS)
|
|
post-install:
|
|
@${TOUCH} ${DOCSDIR}/fflas-ffpack-dev-html/.keep-me
|
|
|
|
.endif
|
|
|
|
.if defined(MAINTAINER_MODE)
|
|
check regression-test test: build
|
|
@cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${_MAKE_JOBS} \
|
|
${MAKE_ARGS} check
|
|
|
|
.endif
|
|
|
|
.include <bsd.port.post.mk>
|