2013-09-20 22:55:04 +02:00
|
|
|
# Created by: Pedro Giffuni <giffunip@asme.org>
|
2003-07-12 05:11:47 +02:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= superlu_mt
|
2017-06-17 10:34:19 +02:00
|
|
|
PORTVERSION= 3.1.20160319
|
2003-07-12 05:11:47 +02:00
|
|
|
CATEGORIES= math
|
|
|
|
MASTER_SITES= http://crd.lbl.gov/~xiaoye/SuperLU/ \
|
2006-06-21 07:53:05 +02:00
|
|
|
http://crd.lbl.gov/~xiaoye/:doc
|
2017-06-17 10:34:19 +02:00
|
|
|
DISTNAME= ${PORTNAME}_3.1
|
2006-06-21 07:53:05 +02:00
|
|
|
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} simax97.ps.gz:doc
|
2009-09-26 08:13:16 +02:00
|
|
|
DIST_SUBDIR= superlu2
|
2003-07-12 05:11:47 +02:00
|
|
|
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
|
|
|
|
|
2016-06-27 23:30:34 +02:00
|
|
|
MAINTAINER= ports@FreeBSD.org
|
2003-07-12 05:11:47 +02:00
|
|
|
COMMENT= Routines for performing multithreaded sparse factorization
|
|
|
|
|
2017-06-17 10:34:19 +02:00
|
|
|
LICENSE= BSD3CLAUSE
|
|
|
|
LICENSE_FILE= ${WRKSRC}/License.txt
|
|
|
|
|
2017-05-03 00:23:52 +02:00
|
|
|
BROKEN_aarch64= fails to build: undefined reference to sbrk
|
2017-06-17 10:34:19 +02:00
|
|
|
BROKEN_sparc64= Does not link on sparc64
|
2017-05-03 00:23:52 +02:00
|
|
|
|
2014-02-16 18:15:31 +01:00
|
|
|
USES= fortran gmake
|
2007-01-12 09:18:07 +01:00
|
|
|
|
2014-07-15 18:23:08 +02:00
|
|
|
OPTIONS_DEFINE= DOCS
|
|
|
|
|
2008-07-02 04:32:04 +02:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2010-02-16 07:24:38 +01:00
|
|
|
.if exists(${LOCALBASE}/lib/libgoto2.so)
|
2011-11-22 12:14:10 +01:00
|
|
|
WITH_BLAS?= gotoblas
|
|
|
|
.elif exists(${LOCALBASE}/lib/libatlas.so)
|
|
|
|
WITH_BLAS?= atlas
|
|
|
|
.else
|
|
|
|
WITH_BLAS?= reference
|
2007-01-12 09:18:07 +01:00
|
|
|
.endif
|
2008-07-02 04:32:04 +02:00
|
|
|
|
2011-11-22 12:14:10 +01:00
|
|
|
.if ${WITH_BLAS} == reference
|
2016-04-01 16:16:16 +02:00
|
|
|
LIB_DEPENDS+= libblas.so:math/blas
|
2010-02-16 07:24:38 +01:00
|
|
|
BLAS= -lblas
|
2011-11-22 12:14:10 +01:00
|
|
|
.elif ${WITH_BLAS} == gotoblas
|
2016-04-01 16:16:16 +02:00
|
|
|
LIB_DEPENDS+= libgoto2.so:math/gotoblas
|
2010-02-16 07:24:38 +01:00
|
|
|
BLAS= -lgoto2p
|
|
|
|
BROKEN= Build stops while testing
|
2011-11-22 12:14:10 +01:00
|
|
|
.elif ${WITH_BLAS} == atlas
|
2016-04-01 16:16:16 +02:00
|
|
|
LIB_DEPENDS+= libatlas.so:math/atlas
|
2011-11-22 12:14:10 +01:00
|
|
|
BLAS= -lptf77blas
|
2006-06-21 07:53:05 +02:00
|
|
|
.endif
|
2003-07-12 05:11:47 +02:00
|
|
|
|
2008-07-02 04:32:04 +02:00
|
|
|
.if ${ARCH} == "sparc64" || ${ARCH} == "amd64"
|
|
|
|
FPIC= -fPIC
|
|
|
|
.else
|
|
|
|
FPIC= -fpic
|
|
|
|
.endif
|
2011-08-05 05:05:18 +02:00
|
|
|
|
2008-07-02 04:32:04 +02:00
|
|
|
USE_LDCONFIG= yes
|
2017-06-17 10:34:19 +02:00
|
|
|
WRKSRC= ${WRKDIR}/SuperLU_MT_3.1
|
|
|
|
WRKSRC_SHARED= ${WRKDIR}/SuperLU_MT_3.1_shared
|
2008-07-02 04:32:04 +02:00
|
|
|
ALL_TARGET= lib
|
2017-06-17 10:34:19 +02:00
|
|
|
SVERSION= 3
|
2003-07-12 05:11:47 +02:00
|
|
|
|
2008-07-02 04:32:04 +02:00
|
|
|
ARCH2FIX= CBLAS/Makefile MAKE_INC/make.openmp MAKE_INC/make.exemplar \
|
2017-06-17 10:34:19 +02:00
|
|
|
make.inc SRC/Makefile TESTING/MATGEN/Makefile
|
2004-09-26 05:15:46 +02:00
|
|
|
|
2017-06-17 10:34:19 +02:00
|
|
|
do-configure:
|
2004-09-27 09:31:01 +02:00
|
|
|
.for fmk in ${ARCH2FIX}
|
|
|
|
@${REINPLACE_CMD} -e 's|^ARCH *.= ar|ARCMD = ar| ; \
|
|
|
|
s|\$$(ARCH)|$$(ARCMD)|' ${WRKSRC}/${fmk}
|
|
|
|
.endfor
|
2008-07-02 04:32:04 +02:00
|
|
|
${CP} -r ${WRKSRC} ${WRKSRC_SHARED}
|
2010-02-16 07:24:38 +01:00
|
|
|
@${REINPLACE_CMD} -e 's+%%BLAS%%+-L${LOCALBASE}/lib ${BLAS}+ ; \
|
2008-07-02 04:32:04 +02:00
|
|
|
s+%%CC%%+${CC}+; s+%%FC%%+${FC}+; \
|
2014-02-16 18:15:31 +01:00
|
|
|
s+%%CPPFLAGS%%+${CPPFLAGS}+; \
|
2008-07-02 04:32:04 +02:00
|
|
|
s+%%CFLAGS%%+${CFLAGS}+; \
|
|
|
|
s+%%FFLAGS%%+${FFLAGS}+; \
|
2014-02-16 18:15:31 +01:00
|
|
|
s+%%LDFLAGS%%+${LDFLAGS}+; \
|
2015-03-25 08:37:15 +01:00
|
|
|
s+%%FPIC%%++ ' \
|
2008-07-02 04:32:04 +02:00
|
|
|
${WRKSRC}/make.inc
|
|
|
|
|
2010-02-16 07:24:38 +01:00
|
|
|
@${REINPLACE_CMD} -e 's+%%BLAS%%+-L${LOCALBASE}/lib ${BLAS}+ ; \
|
2008-07-02 04:32:04 +02:00
|
|
|
s+%%CC%%+${CC}+; s+%%FC%%+${FC}+; \
|
2014-02-16 18:15:31 +01:00
|
|
|
s+%%CPPFLAGS%%+${CPPFLAGS}+; \
|
2008-07-03 05:53:21 +02:00
|
|
|
s+%%CFLAGS%%+${CFLAGS} ${FPIC}+; \
|
|
|
|
s+%%FFLAGS%%+${FFLAGS} ${FPIC}+; \
|
2014-02-16 18:15:31 +01:00
|
|
|
s+%%LDFLAGS%%+${LDFLAGS}+; \
|
2015-03-25 08:37:15 +01:00
|
|
|
s+%%FPIC%%+${FPIC}+ ' \
|
2008-07-02 04:32:04 +02:00
|
|
|
${WRKSRC_SHARED}/make.inc
|
|
|
|
|
|
|
|
do-build:
|
2014-06-25 07:35:31 +02:00
|
|
|
cd ${WRKSRC} ; ${MAKE_CMD} LDFLAGS="${LDFLAGS}"
|
|
|
|
cd ${WRKSRC_SHARED} ; ${MAKE_CMD} LDFLAGS="${LDFLAGS}"
|
2016-10-21 14:51:40 +02:00
|
|
|
${RM} -r ${WRKDIR}/tmp_static
|
2008-07-02 04:32:04 +02:00
|
|
|
${MKDIR} ${WRKDIR}/tmp_static
|
|
|
|
cd ${WRKDIR}/tmp_static
|
2008-07-09 05:03:56 +02:00
|
|
|
${FIND} ${WRKSRC} -name "*\.a" -exec ${CP} {} ${WRKDIR}/tmp_static \;
|
2016-10-21 14:51:40 +02:00
|
|
|
${RM} -r ${WRKDIR}/tmp_shared
|
2008-07-02 04:32:04 +02:00
|
|
|
${MKDIR} ${WRKDIR}/tmp_shared
|
2008-07-09 05:03:56 +02:00
|
|
|
${FIND} ${WRKSRC_SHARED} -name "*\.a" -exec ${CP} {} ${WRKDIR}/tmp_shared \;
|
2008-07-02 04:32:04 +02:00
|
|
|
@cd ${WRKDIR}/tmp_shared ; for i in `ls *.a | ${SED} 's/\.a//' `; do \
|
2016-10-21 14:51:40 +02:00
|
|
|
${RM} $${i}.so.* $${i}.so ; \
|
2016-04-01 15:18:17 +02:00
|
|
|
${FC} ${CFLAGS} ${FPIC} ${LDFLAGS} -shared -o $${i}.so.${SVERSION} \
|
2014-07-08 16:11:30 +02:00
|
|
|
-Wl,-soname,$${i}.so.${SVERSION} -Wl,--allow-multiple-definition \
|
|
|
|
-Wl,--whole-archive $${i}.a -Wl,--no-whole-archive -Wl,--as-needed; \
|
2008-07-02 04:32:04 +02:00
|
|
|
${LN} -s $${i}.so.${SVERSION} $${i}.so ;\
|
|
|
|
done
|
2003-07-12 05:11:47 +02:00
|
|
|
|
|
|
|
do-install:
|
2017-06-17 10:34:19 +02:00
|
|
|
${INSTALL_DATA} ${WRKDIR}/tmp_static/libsuperlu_mt_*.a ${STAGEDIR}${PREFIX}/lib
|
|
|
|
${INSTALL_LIB} ${WRKDIR}/tmp_shared/libsuperlu_mt_*.so.${SVERSION} ${STAGEDIR}${PREFIX}/lib
|
|
|
|
${RLN} ${STAGEDIR}${PREFIX}/lib/libsuperlu_mt_PTHREAD.so.${SVERSION} \
|
|
|
|
${STAGEDIR}${PREFIX}/lib/libsuperlu_mt_PTHREAD.so
|
|
|
|
${RLN} ${STAGEDIR}${PREFIX}/lib/libsuperlu_mt_PTHREAD.so.${SVERSION} \
|
|
|
|
${STAGEDIR}${PREFIX}/lib/libsuperlu_mt.so
|
2014-07-08 16:11:30 +02:00
|
|
|
${MKDIR} ${STAGEDIR}${PREFIX}/include/${PORTNAME}
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/SRC/*.h ${STAGEDIR}${PREFIX}/include/${PORTNAME}
|
|
|
|
.if ${PORT_OPTIONS:MDOCS}
|
|
|
|
@${MKDIR} ${STAGEDIR}${DOCSDIR}
|
2017-06-17 10:34:19 +02:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/DOC/*.pdf ${STAGEDIR}${DOCSDIR}
|
2014-07-08 16:11:30 +02:00
|
|
|
${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/simax97.ps.gz ${STAGEDIR}${DOCSDIR}
|
2003-07-12 05:11:47 +02:00
|
|
|
.endif
|
|
|
|
|
2017-06-17 10:34:19 +02:00
|
|
|
.ifdef MAINTAINER_MODE
|
2008-07-02 04:32:04 +02:00
|
|
|
regression-test: do-build
|
2014-06-25 07:35:31 +02:00
|
|
|
@(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} testing)
|
|
|
|
@(cd ${WRKSRC_SHARED} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} testing)
|
2017-06-17 10:34:19 +02:00
|
|
|
.endif
|
2008-07-02 04:32:04 +02:00
|
|
|
|
|
|
|
.include <bsd.port.post.mk>
|