aboutsummaryrefslogtreecommitdiff
path: root/math/superlu_mt
diff options
context:
space:
mode:
authorMaho Nakata <maho@FreeBSD.org>2008-07-02 02:32:04 +0000
committerMaho Nakata <maho@FreeBSD.org>2008-07-02 02:32:04 +0000
commit3952097d3287346fdbff2200416c69e6d56e51d5 (patch)
treeb35be0b3a784a8b0404a742e114da73537d2f49d /math/superlu_mt
parente00b4f4c4a9d06fa5d3178e7d89f009f7c77343b (diff)
downloadports-3952097d3287346fdbff2200416c69e6d56e51d5.tar.gz
ports-3952097d3287346fdbff2200416c69e6d56e51d5.zip
Notes
Diffstat (limited to 'math/superlu_mt')
-rw-r--r--math/superlu_mt/Makefile99
-rw-r--r--math/superlu_mt/distinfo6
-rw-r--r--math/superlu_mt/files/patch-SRC+slu_mt_util.h10
-rw-r--r--math/superlu_mt/files/patch-TESTING+pddrive.c14
-rw-r--r--math/superlu_mt/files/patch-TESTING+pdgssv.c16
-rw-r--r--math/superlu_mt/files/patch-TESTING+pdgssvx.c16
-rw-r--r--math/superlu_mt/files/patch-make.inc88
-rw-r--r--math/superlu_mt/pkg-plist16
8 files changed, 199 insertions, 66 deletions
diff --git a/math/superlu_mt/Makefile b/math/superlu_mt/Makefile
index 4a78bd2b040a..8cd4f2adaf7f 100644
--- a/math/superlu_mt/Makefile
+++ b/math/superlu_mt/Makefile
@@ -6,12 +6,11 @@
#
PORTNAME= superlu_mt
-DISTVERSION= 1.0.20050524
-PORTREVISION= 1
+PORTVERSION= 2.0.20080115
CATEGORIES= math
MASTER_SITES= http://crd.lbl.gov/~xiaoye/SuperLU/ \
http://crd.lbl.gov/~xiaoye/:doc
-DISTNAME= ${PORTNAME}_1.0
+DISTNAME= ${PORTNAME}_2.0
.ifndef NOPORTDOCS
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} simax97.ps.gz:doc
.endif
@@ -23,42 +22,98 @@ COMMENT= Routines for performing multithreaded sparse factorization
USE_FORTRAN= yes
-.if exists(${LOCALBASE}/lib/libatlas_r.so) && !defined(WITH_BLAS)
-WITH_ATLAS= yes
+.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
.endif
-.if defined(WITH_ATLAS)
-LIB_DEPENDS+= atlas.2:${PORTSDIR}/math/atlas
-BLAS_LIBS= -lf77blas -latlas
-.else
-LIB_DEPENDS+= blas.2:${PORTSDIR}/math/blas
+
+.if ${USE_BLAS} == reference
+LIB_DEPENDS+= blas.2:${PORTSDIR}/math/blas
BLAS_LIBS= -lblas
+.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
.endif
-WRKSRC= ${WRKDIR}/SuperLU_MT
-ALL_TARGET= superlulib
+.if ${ARCH} == "sparc64" || ${ARCH} == "amd64"
+FPIC= -fPIC
+.else
+FPIC= -fpic
+.endif
+USE_LDCONFIG= yes
+CFLAGS_SHARED=${CFLAGS} ${FPIC}
+FFLAGS_SHARED=${CFLAGS} ${FPIC}
+WRKSRC= ${WRKDIR}/SuperLU_MT_2.0
+WRKSRC_SHARED= ${WRKDIR}/SuperLU_MT_2.0_shared
+ALL_TARGET= lib
+SVERSION= 1
-ARCH2FIX= CBLAS/Makefile make.alpha make.exemplar TESTING/MATGEN/Makefile \
- make.origin make.inc make.pthreads SRC/Makefile
+ARCH2FIX= CBLAS/Makefile MAKE_INC/make.openmp MAKE_INC/make.exemplar \
+ MAKE_INC/make.pthreads TESTING/MATGEN/Makefile \
+ make.inc SRC/Makefile
post-patch:
- @${REINPLACE_CMD} -e 's+%%BLAS_LIBS%%+-L${LOCALBASE}/lib ${BLAS_LIBS}+ ; \
- s+%%PTHREAD_CFLAGS%%+${PTHREAD_CFLAGS}+ ; \
- s+%%PTHREAD_LIBS%%+${PTHREAD_LIBS}+ ' \
- ${WRKSRC}/make.inc
.for fmk in ${ARCH2FIX}
@${REINPLACE_CMD} -e 's|^ARCH *.= ar|ARCMD = ar| ; \
s|\$$(ARCH)|$$(ARCMD)|' ${WRKSRC}/${fmk}
.endfor
+ ${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}+; \
+ 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}+; \
+ s+%%CFLAGS%%+${CFLAGS_SHARED}+; \
+ s+%%FFLAGS%%+${FFLAGS_SHARED}+; \
+ 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
+ ${FIND} ${WRKSRC} -name "*\.a" -exec ${MV} {} ${WRKDIR}/tmp_static \;
+ ${RM} -rf ${WRKDIR}/tmp_shared
+ ${MKDIR} ${WRKDIR}/tmp_shared
+ ${FIND} ${WRKSRC_SHARED} -name "*\.a" -exec ${MV} {} ${WRKDIR}/tmp_shared \;
+
+post-build:
+ @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
do-install:
- ${INSTALL_DATA} ${WRKSRC}/libsuperlu_mt.* ${PREFIX}/lib
+ ${INSTALL_DATA} ${WRKDIR}/tmp_shared/libsuperlu_mt.* ${PREFIX}/lib
+ ${INSTALL_DATA} ${WRKDIR}/tmp_static/libsuperlu_mt.* ${PREFIX}/lib
${MKDIR} ${PREFIX}/include/${PORTNAME}
${INSTALL_DATA} ${WRKSRC}/SRC/*.h ${PREFIX}/include/${PORTNAME}
.ifndef NOPORTDOCS
@${MKDIR} ${DOCSDIR}
- ${INSTALL_DATA} ${WRKSRC}/INSTALL/*.ps ${DOCSDIR}
- ${GZIP_CMD} ${DOCSDIR}/*.ps
+# ${INSTALL_DATA} ${WRKSRC}/INSTALL/*.ps ${DOCSDIR}
+# ${GZIP_CMD} ${DOCSDIR}/*.ps
${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/simax97.ps.gz ${DOCSDIR}
.endif
-.include <bsd.port.mk>
+regression-test: do-build
+ @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} testing)
+ @(cd ${WRKSRC}/TESTING && ./plintstd pdtest.csh)
+
+.include <bsd.port.post.mk>
diff --git a/math/superlu_mt/distinfo b/math/superlu_mt/distinfo
index c49b4ceb2e21..19d8528d07ad 100644
--- a/math/superlu_mt/distinfo
+++ b/math/superlu_mt/distinfo
@@ -1,6 +1,6 @@
-MD5 (superlu/superlu_mt_1.0.tar.gz) = 6b46b77515418e2f71da93918356099e
-SHA256 (superlu/superlu_mt_1.0.tar.gz) = 38642865396bb05024e650c25f77d582f29534a996d45f1ad12a5a5065cce5cc
-SIZE (superlu/superlu_mt_1.0.tar.gz) = 562244
+MD5 (superlu/superlu_mt_2.0.tar.gz) = ff126187f28f24ecc7db298d27746cf1
+SHA256 (superlu/superlu_mt_2.0.tar.gz) = cd097028e3699717a344ec05090ca1bad02802cbadbb73524d59d7d1826b85be
+SIZE (superlu/superlu_mt_2.0.tar.gz) = 1309683
MD5 (superlu/simax97.ps.gz) = 728451cbf49c2961249da054e90b6ecd
SHA256 (superlu/simax97.ps.gz) = 8f8ae10e28dfdeda2fed58b0bcec1bf96f10fa7b1d055aff160d77d7aeb8a983
SIZE (superlu/simax97.ps.gz) = 158724
diff --git a/math/superlu_mt/files/patch-SRC+slu_mt_util.h b/math/superlu_mt/files/patch-SRC+slu_mt_util.h
new file mode 100644
index 000000000000..daf2a8cf9bef
--- /dev/null
+++ b/math/superlu_mt/files/patch-SRC+slu_mt_util.h
@@ -0,0 +1,10 @@
+--- SRC/slu_mt_util.h~ 2008-01-09 08:28:56.000000000 +0900
++++ SRC/slu_mt_util.h 2008-07-02 09:54:31.000000000 +0900
+@@ -12,6 +12,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <pthread.h>
+
+ /* Macros */
+ #ifndef USER_ABORT
diff --git a/math/superlu_mt/files/patch-TESTING+pddrive.c b/math/superlu_mt/files/patch-TESTING+pddrive.c
new file mode 100644
index 000000000000..52f92404b7e0
--- /dev/null
+++ b/math/superlu_mt/files/patch-TESTING+pddrive.c
@@ -0,0 +1,14 @@
+--- TESTING/pddrive.c.orig 2008-06-18 22:06:40.000000000 -0500
++++ TESTING/pddrive.c 2008-06-18 22:08:38.000000000 -0500
+@@ -9,6 +9,11 @@
+ #define FMT2 "%10s:fact=%d, trans=%d, refact=%d, equed=%d, n=%d, imat=%d, test(%d)=%12.5g\n"
+ #define FMT3 "%10s:info=%d, izero=%d, n=%d, nrhs=%d, imat=%d, nfail=%d\n"
+
++/* SuperLU compatibility */
++#define DN SLU_DN
++#define _D SLU_D
++#define GE SLU_GE
++#define NC SLU_NC
+
+ main(int argc, char *argv[])
+ {
diff --git a/math/superlu_mt/files/patch-TESTING+pdgssv.c b/math/superlu_mt/files/patch-TESTING+pdgssv.c
new file mode 100644
index 000000000000..926ed0a98863
--- /dev/null
+++ b/math/superlu_mt/files/patch-TESTING+pdgssv.c
@@ -0,0 +1,16 @@
+--- TESTING/pdgssv.c.orig 2008-06-18 22:09:01.000000000 -0500
++++ TESTING/pdgssv.c 2008-06-18 22:10:18.000000000 -0500
+@@ -1,6 +1,13 @@
+ #include "pdsp_defs.h"
+ #include "util.h"
+
++/* SuperLU compatibility */
++#define DN SLU_DN
++#define _D SLU_D
++#define GE SLU_GE
++#define NC SLU_NC
++#define NR SLU_NR
++
+ void
+ pdgssv(int nprocs, SuperMatrix *A, int *perm_c, int *perm_r,
+ SuperMatrix *L, SuperMatrix *U, SuperMatrix *B, int *info )
diff --git a/math/superlu_mt/files/patch-TESTING+pdgssvx.c b/math/superlu_mt/files/patch-TESTING+pdgssvx.c
new file mode 100644
index 000000000000..8a09843b89ff
--- /dev/null
+++ b/math/superlu_mt/files/patch-TESTING+pdgssvx.c
@@ -0,0 +1,16 @@
+--- TESTING/pdgssvx.c.orig 2008-06-18 22:10:35.000000000 -0500
++++ TESTING/pdgssvx.c 2008-06-18 22:11:10.000000000 -0500
+@@ -1,6 +1,13 @@
+ #include "pdsp_defs.h"
+ #include "util.h"
+
++/* SuperLU compatibility */
++#define DN SLU_DN
++#define _D SLU_D
++#define GE SLU_GE
++#define NC SLU_NC
++#define NR SLU_NR
++
+ void
+ pdgssvx(int nprocs, pdgstrf_options_t *pdgstrf_options, SuperMatrix *A,
+ int *perm_c, int *perm_r, equed_t *equed, double *R, double *C,
diff --git a/math/superlu_mt/files/patch-make.inc b/math/superlu_mt/files/patch-make.inc
index 31ec2aa36745..c1b389011630 100644
--- a/math/superlu_mt/files/patch-make.inc
+++ b/math/superlu_mt/files/patch-make.inc
@@ -1,46 +1,62 @@
---- make.inc.orig Thu Sep 2 15:47:13 1999
-+++ make.inc Tue May 27 19:32:12 2003
-@@ -14,14 +14,15 @@
+--- make.inc.orig 2008-01-18 05:53:51.000000000 +0900
++++ make.inc 2008-07-02 09:44:04.000000000 +0900
+@@ -16,13 +16,13 @@
#
# The machine (platform) identifier to append to the library names
#
--PLAT = _SOLARIS
+-PLAT = _sp
+PLAT = _PTHREAD
- # Common Libraries
--TMGLIB = tmglib$(PLAT).a
--SUPERLULIB = superlu_mt$(PLAT).a
--BLASLIB = ../blas$(PLAT).a
-+TMGLIB = libtmg.a
-+SUPERLULIB = libsuperlu_mt.a
-+BLASDEF = -DUSE_VENDOR_BLAS
-+BLASLIB = %%BLAS_LIBS%%
- MATHLIB = -lm
--MPLIB = -lthread
-+MPLIB = %%PTHREAD_LIBS%%
+ #
+ # The name of the libraries to be created/linked to
+ #
+-TMGLIB = libtmglib.a
+-SUPERLULIB = libsuperlu_mt$(PLAT).a
++TMGLIB = libtmg.a
++SUPERLULIB = libsuperlu_mt.a
+ #
+ # If you don't have ESSL, you can use the following blaslib instead:
+@@ -30,10 +30,10 @@
+ # which may be slower than ESSL
#
- # The archiver and the flag(s) to use when building archive (library)
-@@ -32,18 +33,18 @@
- RANLIB = ranlib
+ BLASDEF = -DUSE_VENDOR_BLAS
+-BLASLIB = -lessl
++BLASLIB = %%BLAS_LIBS%%
+ #BLASLIB = ../lib/libblas$(PLAT).a
+ MATHLIB = -lm
+-MPLIB = -lpthread
++MPLIB = %%PTHREAD_LIBS%%
- # for Solaris 2.x
--CC = cc
-+CC ?= cc
- #
- # Definitions used by CPP:
- PREDEFS = -D$(PLAT)
- #
--CFLAGS = $(PREDEFS) -xO3 -xcg92 $(DBG)
-+CFLAGS += $(PREDEFS) %%PTHREAD_CFLAGS%%
- NOOPTS =
- BLASOPTS =
- LOADER = cc
- LOADOPTS = -O
--FORTRAN = f77
--FFLAGS = -O
-+FORTRAN ?= f77
-+FFLAGS ?= -O
+ # The archiver and the flag(s) to use when building archive (library)
+ # If your system has no ranlib, set RANLIB = echo.
+@@ -46,12 +46,12 @@
+ PREDEFS = -D_PTHREAD
+ #
+-CC = xlc_r
+-CFLAGS = -qarch=pwr5 -qalias=allptrs $(PREDEFS) -DPRNTlevel=0 -O3
+-FORTRAN = xlf
+-FFLAGS = -O3 -qarch=pwr5
+-LOADER = xlc_r
+-LOADOPTS = -bmaxdata:0x80000000
++CC = %%CC%%
++CFLAGS = $(PREDEFS) %%CFLAGS%% %%PTHREAD_CFLAGS%%
++FORTRAN = %%FC%%
++FFLAGS = %%FFLAGS%%
++LOADER = %%FC%%
++LOADOPTS = -O
+ #
+ # C preprocessor defs for compilation for the Fortran interface
+ # (-DNoChange, -DAdd_, -DAdd__, or -DUpCase)
+
+--- make.inc~ 2008-07-02 09:54:57.000000000 +0900
++++ make.inc 2008-07-02 09:57:28.000000000 +0900
+@@ -56,6 +56,6 @@
+ # C preprocessor defs for compilation for the Fortran interface
+ # (-DNoChange, -DAdd_, -DAdd__, or -DUpCase)
#
- # C preprocessor defs for compilation (-DNoChange, -DAdd_, or -DUpCase)
+-CDEFS = -DNoChange
++CDEFS = -DAdd_
+
+
diff --git a/math/superlu_mt/pkg-plist b/math/superlu_mt/pkg-plist
index d75d88b0b190..4503f4c26bfa 100644
--- a/math/superlu_mt/pkg-plist
+++ b/math/superlu_mt/pkg-plist
@@ -1,12 +1,18 @@
-include/superlu_mt/Cnames.h
include/superlu_mt/colamd.h
-include/superlu_mt/machines.h
+include/superlu_mt/pcsp_defs.h
include/superlu_mt/pdsp_defs.h
+include/superlu_mt/pssp_defs.h
include/superlu_mt/pxgstrf_synch.h
+include/superlu_mt/pzsp_defs.h
+include/superlu_mt/slu_dcomplex.h
+include/superlu_mt/slu_mt_Cnames.h
+include/superlu_mt/slu_mt_machines.h
+include/superlu_mt/slu_mt_util.h
+include/superlu_mt/slu_scomplex.h
include/superlu_mt/supermatrix.h
-include/superlu_mt/util.h
-lib/libsuperlu_mt.a
@dirrm include/superlu_mt
+lib/libsuperlu_mt.a
+lib/libsuperlu_mt.so
+lib/libsuperlu_mt.so.1
%%PORTDOCS%%%%DOCSDIR%%/simax97.ps.gz
-%%PORTDOCS%%%%DOCSDIR%%/ug.ps.gz
%%PORTDOCS%%@dirrm %%DOCSDIR%%