View | Details | Raw Unified | Return to bug 159129
Collapse All | Expand All

(-)arpack/Makefile (-9 / +25 lines)
Lines 7-13 Link Here
7
7
8
PORTNAME=	arpack
8
PORTNAME=	arpack
9
PORTVERSION=	96
9
PORTVERSION=	96
10
PORTREVISION=	8
10
PORTREVISION=	9
11
CATEGORIES=	math
11
CATEGORIES=	math
12
MASTER_SITES=	http://www.caam.rice.edu/software/ARPACK/SRC/
12
MASTER_SITES=	http://www.caam.rice.edu/software/ARPACK/SRC/
13
DISTFILES=	${PORTNAME}${PORTVERSION}.tar.gz patch.tar.gz
13
DISTFILES=	${PORTNAME}${PORTVERSION}.tar.gz patch.tar.gz
Lines 17-31 Link Here
17
DIST_SUBDIR=	arpack
17
DIST_SUBDIR=	arpack
18
EXTRACT_ONLY=	${PORTNAME}${PORTVERSION}.tar.gz
18
EXTRACT_ONLY=	${PORTNAME}${PORTVERSION}.tar.gz
19
19
20
PATCH_SITES=	http://mathema.tician.de/news.tiker.net/files/
21
PATCHFILES=	arpack-arscnd-3.patch.gz
22
PATCH_DIST_STRIP=	-p1
23
24
MAINTAINER=	stephen@FreeBSD.org
20
MAINTAINER=	stephen@FreeBSD.org
25
COMMENT=	Argand Library: large eigenvalue subroutines (serial version)
21
COMMENT=	Argand Library: large eigenvalue subroutines (serial version)
26
22
23
OPTIONS=	MANGLE_LAPACK_NAMES "Mangle LAPACK names" Off
24
27
LDFLAGS+=	-L${LOCALBASE}/lib
25
LDFLAGS+=	-L${LOCALBASE}/lib
28
USE_FORTRAN=	yes
26
USE_FORTRAN=	yes
27
FFLAGS+=	-ffixed-line-length-none
29
USE_LDCONFIG=	yes
28
USE_LDCONFIG=	yes
30
WRKSRC =	${WRKDIR}/ARPACK
29
WRKSRC =	${WRKDIR}/ARPACK
31
30
Lines 46-51 Link Here
46
45
47
.include <bsd.port.pre.mk>
46
.include <bsd.port.pre.mk>
48
47
48
.if defined(WITH_MANGLE_LAPACK_NAMES)
49
PATCH_SITES=	http://mathema.tician.de/news.tiker.net/files/
50
PATCHFILES=	arpack-arscnd-3.patch.gz
51
PATCH_DIST_STRIP=	-p1
52
USE_PERL5_BUILD=	yes
53
.endif
54
49
.if exists(${LOCALBASE}/lib/libatlas_r.so)
55
.if exists(${LOCALBASE}/lib/libatlas_r.so)
50
WITH_BLAS?=	atlas
56
WITH_BLAS?=	atlas
51
.else
57
.else
Lines 69-83 Link Here
69
post-extract:
75
post-extract:
70
	@${TAR} -C ${WRKDIR} -xzf ${_DISTDIR}/patch.tar.gz
76
	@${TAR} -C ${WRKDIR} -xzf ${_DISTDIR}/patch.tar.gz
71
	@${GZIP_CMD} ${WRKSRC}/DOCUMENTS/ex-*.doc
77
	@${GZIP_CMD} ${WRKSRC}/DOCUMENTS/ex-*.doc
72
73
post-patch:
78
post-patch:
74
	@${REINPLACE_CMD} -E \
79
	@${REINPLACE_CMD} -E \
75
		-e '/^(home|AR|FC|LDFLAGS|MAKE|PLAT|RANLIB|SHELL)[[:space:]]+=/d' \
80
		-e '/^(home|AR|FC|LDFLAGS|MAKE|PLAT|RANLIB|SHELL)[[:space:]]+=/d' \
76
		-e '/^ARPACKLIB[[:space:]]+=/s/_\$$\(PLAT\)//' \
81
		-e '/^ARPACKLIB[[:space:]]+=/s/_\$$\(PLAT\)//' \
77
		-e '\|^BLASLIB[[:space:]]+=|s|=.*|= ${LDFLAGS} ${BLAS}|' \
82
		-e '\|^BLASLIB[[:space:]]+=|s|=.*|= ${LDFLAGS} ${BLAS}|' \
78
		-e '/^DIRS[[:space:]]+=/s/\$$\(BLASdir\)//' \
83
		-e '/^DIRS[[:space:]]+=/s/\$$\(BLASdir\)//' \
79
		-e '\|^FFLAGS[[:space:]]+=|s|=.*|= ${FFLAGS} $${PICFLAG}|' \
84
		-e '\|^FFLAGS[[:space:]]+=|s|=.*|= ${FFLAGS} $${PICFLAG} -ffixed-line-length-none|' \
80
			${WRKSRC}/ARmake.inc
85
			${WRKSRC}/ARmake.inc
86
.if defined(WITH_MANGLE_LAPACK_NAMES)
87
	@${SETENV} FILESDIR=${FILESDIR} WRKSRC=${WRKSRC} WRKDIR=${WRKDIR} \
88
		${PERL} ${SCRIPTDIR}/mangle-lapack-names.pl
89
.else
90
	@${CP} ${FILESDIR}/arpack.h ${WRKDIR}/
91
.endif
92
.if defined(WITH_MANGLE_LAPACK_NAMES)
93
	@cd ${WRKSRC} && ${PATCH} < ${FILESDIR}/UTIL+arscnd.f-patch
94
.else
95
	@cd ${WRKSRC} && ${PATCH} < ${FILESDIR}/UTIL+second.f-patch
96
.endif
81
	@${CP} -R ${WRKSRC} ${WRKSRC}_SHARED
97
	@${CP} -R ${WRKSRC} ${WRKSRC}_SHARED
82
98
83
do-build:
99
do-build:
Lines 90-96 Link Here
90
		${LD} -Bshareable -o libarpack.so.1 -x -soname libarpack.so.1 --whole-archive libarpack.a
106
		${LD} -Bshareable -o libarpack.so.1 -x -soname libarpack.so.1 --whole-archive libarpack.a
91
107
92
do-install:
108
do-install:
93
	@${INSTALL_DATA} ${FILESDIR}/arpack.h ${PREFIX}/include
109
	@${INSTALL_DATA} ${WRKDIR}/arpack.h ${PREFIX}/include
94
	@${INSTALL_DATA} ${WRKSRC}/libarpack.a ${PREFIX}/lib
110
	@${INSTALL_DATA} ${WRKSRC}/libarpack.a ${PREFIX}/lib
95
	@${INSTALL_DATA} ${WRKSRC}_SHARED/libarpack.so.1 ${PREFIX}/lib
111
	@${INSTALL_DATA} ${WRKSRC}_SHARED/libarpack.so.1 ${PREFIX}/lib
96
	@${LN} -sf libarpack.so.1 ${PREFIX}/lib/libarpack.so
112
	@${LN} -sf libarpack.so.1 ${PREFIX}/lib/libarpack.so
Lines 108-114 Link Here
108
	@cd ${WRKSRC}/EXAMPLES/SIMPLE ; ${SETENV} ${MAKE_ENV} \
124
	@cd ${WRKSRC}/EXAMPLES/SIMPLE ; ${SETENV} ${MAKE_ENV} \
109
		PICFLAG= home="${WRKSRC}" \
125
		PICFLAG= home="${WRKSRC}" \
110
		${MAKE} ${_MAKE_JOBS} ${MAKE_ARGS} simple ; ${SIMPLETESTS:S|^|./|:S|$| ; |}
126
		${MAKE} ${_MAKE_JOBS} ${MAKE_ARGS} simple ; ${SIMPLETESTS:S|^|./|:S|$| ; |}
111
	@cd ${WRKSRC}_SHARED/EXAMPLES/SIMPLE ; ${SETENV} ${MAKE_ENV} \
127
	cd ${WRKSRC}_SHARED/EXAMPLES/SIMPLE ; ${SETENV} ${MAKE_ENV} \
112
		PICFLAG=${PICFLAG}  home="${WRKSRC}_SHARED" \
128
		PICFLAG=${PICFLAG}  home="${WRKSRC}_SHARED" \
113
		${MAKE} ${_MAKE_JOBS} ${MAKE_ARGS} simple ; ${SIMPLETESTS:S|^|./|:S|$| ; |}
129
		${MAKE} ${_MAKE_JOBS} ${MAKE_ARGS} simple ; ${SIMPLETESTS:S|^|./|:S|$| ; |}
114
130
(-)arpack/files/UTIL+arscnd.f-patch (+10 lines)
Line 0 Link Here
1
--- UTIL/arscnd.f.bak	2011-07-20 19:47:43.000000000 -0400
2
+++ UTIL/arscnd.f	2011-07-20 19:48:05.000000000 -0400
3
@@ -21,7 +21,6 @@
4
 *     ..
5
 *     .. External Functions ..
6
       REAL               ETIME
7
-      EXTERNAL           ETIME
8
 *     ..
9
 *     .. Executable Statements ..
10
 *
(-)arpack/files/UTIL+second.f-patch (+10 lines)
Line 0 Link Here
1
--- UTIL/second.f.bak	2011-07-20 19:47:43.000000000 -0400
2
+++ UTIL/second.f	2011-07-20 19:48:05.000000000 -0400
3
@@ -21,7 +21,6 @@
4
 *     ..
5
 *     .. External Functions ..
6
       REAL               ETIME
7
-      EXTERNAL           ETIME
8
 *     ..
9
 *     .. Executable Statements ..
10
 *
(-)arpack/files/patch-UTIL+second.f (-10 lines)
Lines 1-10 Link Here
1
--- UTIL/arscnd.f.bak	2011-07-20 19:47:43.000000000 -0400
2
+++ UTIL/arscnd.f	2011-07-20 19:48:05.000000000 -0400
3
@@ -21,7 +21,6 @@
4
 *     ..
5
 *     .. External Functions ..
6
       REAL               ETIME
7
-      EXTERNAL           ETIME
8
 *     ..
9
 *     .. Executable Statements ..
10
 *
(-)arpack/pkg-descr (-21 / +16 lines)
Lines 1-24 Link Here
1
The package is designed to compute a few eigenvalues and corresponding 
1
ARPACK software is designed to solve symmetric, nonsymmetric, and generalized
2
eigenvectors of a general n by n matrix A. It is most appropriate for large 
2
eigenproblems for sparse matrices.  The software is designed to compute a few
3
sparse or structured matrices A where structured means that a matrix-vector 
3
(k) eigenvalues with user specified features such as those of largest real
4
product w <- Av requires order n rather than the usual order n2 floating point
4
part or largest magnitude. Storage requirements are on the order of n*k
5
operations. This software is based upon an algorithmic variant of the Arnoldi
5
locations. A set of Schur basis vectors for the desired k-dimensional
6
process called the Implicitly Restarted Arnoldi Method (IRAM). When the matrix
6
eigen-space is computed which is numerically orthogonal to working precision.
7
A is symmetric it reduces to a variant of the Lanczos process called the 
7
Numerically accurate eigenvectors are available on request.
8
Implicitly Restarted Lanczos Method (IRLM). These variants may be viewed as a
9
synthesis of the Arnoldi/Lanczos process with the Implicitly Shifted QR
10
technique that is suitable for large scale problems. For many standard 
11
problems, a matrix factorization is not required. Only the action of the matrix
12
on a vector is needed.
13
ARPACK software is capable of solving large scale symmetric, nonsymmetric, 
14
and generalized eigenproblems from significant application areas. The software
15
is designed to compute a few (k) eigenvalues with user specified features 
16
such as those of largest real part or largest magnitude. Storage requirements
17
are on the order of n*k locations. No auxiliary storage is required. A set 
18
of Schur basis vectors for the desired k-dimensional eigen-space is computed
19
which is numerically orthogonal to working precision. Numerically accurate 
20
eigenvectors are available on request.
21
8
22
WWW:	http://www.caam.rice.edu/software/ARPACK/
9
WWW:	http://www.caam.rice.edu/software/ARPACK/
23
10
24
NOTE: You MUST link with BLAS library or a replacement like ATLAS.
11
NOTES
12
1. You MUST link with the BLAS library or a replacement like ATLAS.
13
2. ARPACK is designed to work with lapack version 2, and it provides its own
14
   lapack routines.  If you have to link with lapack version 3 or greater,
15
   it is recommended that you switch on the option MANGLE_LAPACK_NAMES.  This
16
   does two things.  First it uses a patch described at
17
   http://mathema.tician.de/node/373.  Secondly, it mangles all the names of
18
   the LAPACK routines provided in ARPACK by preceding each function or
19
   subroutine name by "AR_".
(-)arpack/scripts/mangle-lapack-names.pl (+43 lines)
Line 0 Link Here
1
$WRKSRC = $ENV{"WRKSRC"} || die;
2
$WRKDIR = $ENV{"WRKDIR"} || die;
3
$FILESDIR = $ENV{"FILESDIR"} || die;
4
$|=1;
5
6
while (<$WRKSRC/LAPACK/*.f>) {
7
  open(FOR,$_);
8
  while (<FOR>) {
9
    push @functions, $1 if /FUNCTION\s+(\w+)/ || /SUBROUTINE\s+(\w+)/;
10
  }
11
  close FOR;
12
}
13
14
print "Mangling LAPACK names.  This may take some time.\n";
15
open(LIST,"find $WRKSRC -type f -name \"*.f\" |");
16
while ($filename = <LIST>) {
17
  print ".";
18
  chomp $filename;
19
  rename $filename, "$filename.bak";
20
  open(IN,"$filename.bak") || die;
21
  $contents = join "", <IN>;
22
  close IN;
23
  foreach (@functions) {
24
    $contents =~ s/\b$_\b/AR_$_/gi;
25
  }
26
  open(OUT,"> $filename") || die;
27
  print OUT $contents;
28
  close OUT;
29
}
30
close LIST;
31
32
print ".";
33
open(IN,"$FILESDIR/arpack.h") || die;
34
$contents = join '',<IN>;
35
close IN;
36
foreach (@functions) {
37
  $_ = lc($_);
38
  $contents =~ s/\b${_}_\b/ar_${_}_/g;
39
}
40
open(OUT,"> $WRKDIR/arpack.h") || die;
41
print OUT $contents;
42
close OUT;
43
print "\nDone mangling.\n";

Return to bug 159129