2003-07-12 05:11:47 +02:00
|
|
|
# New ports collection makefile for: SuperLU_MT
|
|
|
|
# Date created: 31 Apr 2003
|
|
|
|
# Whom: Pedro Giffuni <giffunip@asme.org>
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
PORTNAME= superlu_mt
|
2008-07-02 04:32:04 +02:00
|
|
|
PORTVERSION= 2.0.20080115
|
2009-09-13 02:08:01 +02:00
|
|
|
PORTREVISION= 2
|
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
|
2008-07-02 04:32:04 +02:00
|
|
|
DISTNAME= ${PORTNAME}_2.0
|
2003-07-12 05:11:47 +02:00
|
|
|
.ifndef NOPORTDOCS
|
2006-06-21 07:53:05 +02:00
|
|
|
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} simax97.ps.gz:doc
|
2003-07-12 05:11:47 +02:00
|
|
|
.endif
|
|
|
|
DIST_SUBDIR= superlu
|
|
|
|
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
|
|
|
|
|
|
|
|
MAINTAINER= ports@FreeBSD.org
|
|
|
|
COMMENT= Routines for performing multithreaded sparse factorization
|
|
|
|
|
2009-08-14 17:01:56 +02:00
|
|
|
BROKEN= checksum mismatch
|
|
|
|
|
2007-07-14 04:56:36 +02:00
|
|
|
USE_FORTRAN= yes
|
2007-01-12 09:18:07 +01:00
|
|
|
|
2008-07-02 04:32:04 +02:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
|
|
|
USE_BLAS?= reference
|
|
|
|
|
|
|
|
.if exists(${LOCALBASE}/lib/libgoto.so)
|
|
|
|
USE_BLAS= gotoblas
|
|
|
|
.elif exists(${LOCALBASE}/lib/libatlas_r.so)
|
|
|
|
USE_BLAS= atlas
|
2007-01-12 09:18:07 +01:00
|
|
|
.endif
|
2008-07-02 04:32:04 +02:00
|
|
|
|
|
|
|
.if ${USE_BLAS} == reference
|
|
|
|
LIB_DEPENDS+= blas.2:${PORTSDIR}/math/blas
|
2007-01-12 09:18:07 +01:00
|
|
|
BLAS_LIBS= -lblas
|
2008-07-02 04:32:04 +02:00
|
|
|
.elif ${USE_BLAS} == gotoblas
|
|
|
|
LIB_DEPENDS+= goto:${PORTSDIR}/math/gotoblas
|
|
|
|
BLAS_LIBS= -lgotop
|
|
|
|
.elif ${USE_BLAS} == atlas
|
|
|
|
LIB_DEPENDS+= atlas:${PORTSDIR}/math/atlas
|
|
|
|
BLAS_LIBS= -lptf77blas -lptcblas -latlas_r
|
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
|
|
|
|
USE_LDCONFIG= yes
|
2008-07-02 07:28:25 +02:00
|
|
|
USE_GMAKE= yes
|
2008-07-02 04:32:04 +02:00
|
|
|
WRKSRC= ${WRKDIR}/SuperLU_MT_2.0
|
|
|
|
WRKSRC_SHARED= ${WRKDIR}/SuperLU_MT_2.0_shared
|
|
|
|
ALL_TARGET= lib
|
|
|
|
SVERSION= 1
|
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 \
|
|
|
|
MAKE_INC/make.pthreads TESTING/MATGEN/Makefile \
|
|
|
|
make.inc SRC/Makefile
|
2004-09-26 05:15:46 +02:00
|
|
|
|
2003-07-12 05:11:47 +02:00
|
|
|
post-patch:
|
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}
|
|
|
|
@${REINPLACE_CMD} -e 's+%%BLAS_LIBS%%+-L${LOCALBASE}/lib ${BLAS_LIBS}+ ; \
|
|
|
|
s+%%CC%%+${CC}+; s+%%FC%%+${FC}+; \
|
|
|
|
s+%%CFLAGS%%+${CFLAGS}+; \
|
|
|
|
s+%%FFLAGS%%+${FFLAGS}+; \
|
2008-07-03 05:53:21 +02:00
|
|
|
s+%%FPIC%%++; \
|
2008-07-02 04:32:04 +02:00
|
|
|
s+%%PTHREAD_CFLAGS%%+${PTHREAD_CFLAGS}+ ; \
|
|
|
|
s+%%PTHREAD_LIBS%%+${PTHREAD_LIBS}+ ' \
|
|
|
|
${WRKSRC}/make.inc
|
|
|
|
|
|
|
|
@${REINPLACE_CMD} -e 's+%%BLAS_LIBS%%+-L${LOCALBASE}/lib ${BLAS_LIBS}+ ; \
|
|
|
|
s+%%CC%%+${CC}+; s+%%FC%%+${FC}+; \
|
2008-07-03 05:53:21 +02:00
|
|
|
s+%%CFLAGS%%+${CFLAGS} ${FPIC}+; \
|
|
|
|
s+%%FFLAGS%%+${FFLAGS} ${FPIC}+; \
|
|
|
|
s+%%FPIC%%+${FPIC}+; \
|
2008-07-02 04:32:04 +02:00
|
|
|
s+%%PTHREAD_CFLAGS%%+${PTHREAD_CFLAGS}+ ; \
|
|
|
|
s+%%PTHREAD_LIBS%%+${PTHREAD_LIBS}+ ' \
|
|
|
|
${WRKSRC_SHARED}/make.inc
|
|
|
|
|
|
|
|
do-build:
|
|
|
|
cd ${WRKSRC} ; ${GMAKE}
|
|
|
|
cd ${WRKSRC_SHARED} ; ${GMAKE}
|
|
|
|
${RM} -rf ${WRKDIR}/tmp_static
|
|
|
|
${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 \;
|
2008-07-02 04:32:04 +02:00
|
|
|
${RM} -rf ${WRKDIR}/tmp_shared
|
|
|
|
${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 \
|
|
|
|
${RM} -f $${i}.so.* $${i}.so ; \
|
|
|
|
ld -Bshareable -o $${i}.so.${SVERSION} -x -soname $${i}.so.${SVERSION} --allow-multiple-definition --whole-archive $${i}.a ;\
|
|
|
|
${LN} -s $${i}.so.${SVERSION} $${i}.so ;\
|
|
|
|
done
|
2003-07-12 05:11:47 +02:00
|
|
|
|
|
|
|
do-install:
|
2008-07-17 03:45:27 +02:00
|
|
|
${INSTALL_DATA} ${WRKDIR}/tmp_static/libsuperlu_mt.a ${PREFIX}/lib
|
|
|
|
${INSTALL_DATA} ${WRKDIR}/tmp_shared/libsuperlu_mt.so.${SVERSION} ${PREFIX}/lib
|
|
|
|
cd ${PREFIX}/lib && ${LN} -s -f libsuperlu_mt.so.${SVERSION} libsuperlu_mt.so
|
2003-07-12 05:11:47 +02:00
|
|
|
${MKDIR} ${PREFIX}/include/${PORTNAME}
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/SRC/*.h ${PREFIX}/include/${PORTNAME}
|
|
|
|
.ifndef NOPORTDOCS
|
|
|
|
@${MKDIR} ${DOCSDIR}
|
2008-07-02 04:32:04 +02:00
|
|
|
# ${INSTALL_DATA} ${WRKSRC}/INSTALL/*.ps ${DOCSDIR}
|
|
|
|
# ${GZIP_CMD} ${DOCSDIR}/*.ps
|
2003-07-12 05:11:47 +02:00
|
|
|
${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/simax97.ps.gz ${DOCSDIR}
|
|
|
|
.endif
|
|
|
|
|
2008-07-02 04:32:04 +02:00
|
|
|
regression-test: do-build
|
2008-07-15 03:25:29 +02:00
|
|
|
@(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} testing)
|
|
|
|
@(cd ${WRKSRC_SHARED} && ${SETENV} ${MAKE_ENV} ${GMAKE} testing)
|
2008-07-02 04:32:04 +02:00
|
|
|
|
|
|
|
.include <bsd.port.post.mk>
|