aboutsummaryrefslogtreecommitdiff
path: root/math/atlas-devel
diff options
context:
space:
mode:
authorMaho Nakata <maho@FreeBSD.org>2007-01-06 22:18:51 +0000
committerMaho Nakata <maho@FreeBSD.org>2007-01-06 22:18:51 +0000
commit6d395117efa4858db1a02ec0fd24ca54d09c05ab (patch)
tree5a569117726353c4f1394a7bbab9478e918ca18a /math/atlas-devel
parentc1168dd28a268ff86c8a43ea6c187818376d2356 (diff)
downloadports-6d395117efa4858db1a02ec0fd24ca54d09c05ab.tar.gz
ports-6d395117efa4858db1a02ec0fd24ca54d09c05ab.zip
Notes
Diffstat (limited to 'math/atlas-devel')
-rw-r--r--math/atlas-devel/Makefile77
-rw-r--r--math/atlas-devel/files/Makefile.test34
-rw-r--r--math/atlas-devel/files/patch-CONFIG+src+SpewMakeInc.c15
-rw-r--r--math/atlas-devel/files/thread-patch12
-rw-r--r--math/atlas-devel/pkg-plist55
5 files changed, 174 insertions, 19 deletions
diff --git a/math/atlas-devel/Makefile b/math/atlas-devel/Makefile
index deb06f43da23..3cf2e44070fc 100644
--- a/math/atlas-devel/Makefile
+++ b/math/atlas-devel/Makefile
@@ -10,6 +10,7 @@
PORTNAME= atlas
PORTVERSION= 3.7.24
+PORTREVISION= 1
CATEGORIES= math
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= math-atlas
@@ -19,19 +20,31 @@ DISTNAME= ${PORTNAME}${PORTVERSION}
MAINTAINER= maho@FreeBSD.org
COMMENT= Development version of math/atlas
-NO_PACKAGE= "Optimizes for the local machine, so a package is not generally useful. Set FORCE_PACKAGE to override"
+NO_PACKAGE= Optimizes for the local machine, so a package is not generally useful. Set FORCE_PACKAGE to override
CONFLICTS= elmer-mathlibs-1*
USE_BZIP2= yes
WRKSRC= ${WRKDIR}/ATLAS
-INSTALLS_SHLIB= yes
+USE_LDCONFIG= yes
.include <bsd.port.pre.mk>
NOT_FOR_ARCHS= alpha
-#GCC4 produces slower code...
-USE_GCC= 3.2+
+
+#to compile the ATLAS kernel we use gcc3. See ATLAS/INSTALL.txt for details.
+WANT_FORTRAN= yes
+USE_GCC=4.2+
+.if ${OSVERSION} > 700000
+BUILD_DEPENDS+= gcc34:${PORTSDIR}/lang/gcc34
+CCOMPILER= gcc34
+.else
+CCOMPILER:= cc
+.endif
+.if defined(WITH_TESTS)
+LIB_DEPENDS+= blas.1:${PORTSDIR}/math/blas
+LIB_DEPENDS+= lapack.3:${PORTSDIR}/math/lapack
+.endif
.if ${ARCH} == "sparc64"
PICFLAG?= -fPIC
@@ -47,11 +60,15 @@ FFLAGS+= -mtune=${CPUTYPE} -pipe -O2 -ffast-math -fomit-frame-pointer
FFLAGS+= -pipe -O2 -ffast-math -fomit-frame-pointer
.endif
.endif
-
.if defined(WITH_STATICLIB)
-PLIST_SUB= WITH_STATICLIB=""
+PLIST_SUB+= WITH_STATICLIB=""
.else
-PLIST_SUB= WITH_STATICLIB="@comment "
+PLIST_SUB+= WITH_STATICLIB="@comment "
+.endif
+.if defined(WITH_TESTS)
+PLIST_SUB+= WITH_TESTS=""
+.else
+PLIST_SUB+= WITH_TESTS="@comment "
.endif
post-extract:
@@ -62,9 +79,11 @@ post-extract:
.endif
pre-configure:
- @${REINPLACE_CMD} -e "s|%%CC%%|${CC}|g" \
+ @${REINPLACE_CMD} -e "s|%%CC%%|${CCOMPILER}|g" \
-e "s|%%FC%%|${FC}|g" ${WRKSRC}/CONFIG/src/atlcomp.txt
@${REINPLACE_CMD} -e "s|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g" \
+ -e "s|%%PTHREAD_LIBS%%|${PTHREAD_CFLAGS}|g" \
+ -e "s|%%LOCALBASE%%|${LOCALBASE}|g" \
${WRKSRC}/CONFIG/src/SpewMakeInc.c
do-configure:
@@ -72,10 +91,11 @@ do-configure:
../configure -t 0
${MKDIR} ${WRKSRC}/THREADED ; cd ${WRKSRC}/THREADED ; \
../configure -t 0 -Fa al '${PTHREAD_CFLAGS} '
+ cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/thread-patch
${MKDIR} ${WRKSRC}/NON_THREADED_PIC ; cd ${WRKSRC}/NON_THREADED_PIC ; \
- ../configure -t -1 -Fa al '${PICFLAG} -DPIC'
+ ../configure -Fa al '${PICFLAG} -DPIC'
${MKDIR} ${WRKSRC}/THREADED_PIC ; cd ${WRKSRC}/THREADED_PIC ; \
- ../configure -t -1 -Fa al '${PTHREAD_CFLAGS} ${PICFLAG} -DPIC'
+ ../configure -Fa al '${PTHREAD_CFLAGS} ${PICFLAG} -DPIC'
do-build:
# make lapack
@@ -95,8 +115,12 @@ do-build:
.endif
(cd ${WRKSRC}/NON_THREADED_PIC ; ${MAKE})
(cd ${WRKSRC}/THREADED_PIC ; ${MAKE})
+.if defined(WITH_TESTS)
+ @${MAKE} test
+.endif
-ATLAS_LIBS=libalapack libatlas libcblas libf77blas libtstatlas
+ATLAS_LIBS1=libalapack libatlas libcblas libf77blas libtstatlas
+ATLAS_LIBS2=libptcblas libptf77blas
post-build:
.if defined(WITH_STATICLIB)
@@ -141,32 +165,43 @@ post-build:
ranlib ../THREADED_PIC/lib/libalapack.a )
# make atlas shared library
-.for i in ${ATLAS_LIBS}
+.for i in ${ATLAS_LIBS1}
( cd ${WRKSRC}/NON_THREADED_PIC/lib ; \
ld -Bshareable -o ${i}.so.1 -x -soname ${i}.so.1 ${i}.a )
.endfor
# make atlas shared (thread safe) library
-.for i in ${ATLAS_LIBS}
+.for i in ${ATLAS_LIBS1}
( cd ${WRKSRC}/THREADED_PIC/lib ; \
ld -Bshareable -o ${i}_r.so.1 -x -soname ${i}_r.so.1 ${i}.a )
.endfor
-
+.for i in ${ATLAS_LIBS2}
+ ( cd ${WRKSRC}/THREADED_PIC/lib ; \
+ ld -Bshareable -o ${i}.so.1 -x -soname ${i}.so.1 ${i}.a )
+.endfor
do-install:
-.for i in ${ATLAS_LIBS}
+.for i in ${ATLAS_LIBS1}
.if defined(WITH_STATICLIB)
@${INSTALL_DATA} ${WRKSRC}/NON_THREADED/lib/${i}.a ${PREFIX}/lib
.endif
@${INSTALL_DATA} ${WRKSRC}/NON_THREADED_PIC/lib/${i}.so.1 ${PREFIX}/lib
@${LN} -sf ${i}.so.1 ${PREFIX}/lib/${i}.so
.endfor
-.for i in ${ATLAS_LIBS}
+.for i in ${ATLAS_LIBS1}
.if defined(WITH_STATICLIB)
@${INSTALL_DATA} ${WRKSRC}/THREADED/lib/${i}.a ${PREFIX}/lib/${i}_r.a
.endif
@${INSTALL_DATA} ${WRKSRC}/THREADED_PIC/lib/${i}_r.so.1 ${PREFIX}/lib/${i}_r.so.1
@${LN} -sf ${i}_r.so.1 ${PREFIX}/lib/${i}_r.so
.endfor
+.for i in ${ATLAS_LIBS2}
+.if defined(WITH_STATICLIB)
+ @${INSTALL_DATA} ${WRKSRC}/THREADED/lib/${i}.a ${PREFIX}/lib
+.endif
+ @${INSTALL_DATA} ${WRKSRC}/THREADED_PIC/lib/${i}.so.1 ${PREFIX}/lib
+ @${LN} -sf ${i}.so.1 ${PREFIX}/lib/${i}.so
+.endfor
+
@${INSTALL_DATA} ${WRKSRC}/include/cblas.h ${PREFIX}/include
@${INSTALL_DATA} ${WRKSRC}/include/clapack.h ${PREFIX}/include
@${INSTALL_DATA} ${FILESDIR}/blas.h ${PREFIX}/include
@@ -175,5 +210,15 @@ do-install:
@${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/doc/* ${DOCSDIR}
.endif
+.if defined(WITH_TESTS)
+ ${MKDIR} ${EXAMPLESDIR}
+ @for i in ${ALLTESTS} ; do \
+ cd ${WRKDIR}/ATLAS/NON_THREADED_PIC/bin ; ${INSTALL_PROGRAM} $${i} ${EXAMPLESDIR} ; \
+ done
+ @for i in ${ALLTESTS_PT} ; do \
+ cd ${WRKDIR}/ATLAS/THREADED_PIC/bin ; ${INSTALL_PROGRAM} $${i} ${EXAMPLESDIR} ; \
+ done
+.endif
+.include <${FILESDIR}/Makefile.test>
.include <bsd.port.post.mk>
diff --git a/math/atlas-devel/files/Makefile.test b/math/atlas-devel/files/Makefile.test
new file mode 100644
index 000000000000..829fb2960b32
--- /dev/null
+++ b/math/atlas-devel/files/Makefile.test
@@ -0,0 +1,34 @@
+ALLTESTS = xsl3blastst xdl3blastst xcl3blastst xzl3blastst \
+ xsl2blastst xdl2blastst xcl2blastst xzl2blastst \
+ xsl1blastst xdl1blastst xcl1blastst xzl1blastst \
+ xslutst xslutstF xdlutst xdlutstF xclutst xclutstF \
+ xzlutst xzlutstF xsllttst xsllttstF xdllttst xdllttstF \
+ xcllttst xcllttstF xzllttst xzllttstF
+
+ALLTESTS_PT = xsl3blastst_pt xdl3blastst_pt xcl3blastst_pt xzl3blastst_pt \
+ xslutst_pt xslutstF_pt xdlutst_pt xdlutstF_pt xclutst_pt xclutstF_pt \
+ xzlutst_pt xzlutstF_pt xsllttst_pt xsllttstF_pt xdllttst_pt \
+ xdllttstF_pt xcllttst_pt xcllttstF_pt xzllttst_pt xzllttstF_pt
+#build errors?
+# xsl2blastst_pt xdl2blastst_pt xcl2blastst_pt xzl2blastst_pt \
+# xsl1blastst_pt xdl1blastst_pt xcl1blastst_pt xzl1blastst_pt \
+test:
+ @for i in ${ALLTESTS} ; do \
+ ${ECHO_CMD} "Making $${i}" ; \
+ cd ${WRKDIR}/ATLAS/NON_THREADED_PIC/bin ; ${GMAKE} $${i} ; \
+ done
+ @for i in ${ALLTESTS_PT} ; do \
+ ${ECHO_CMD} "Making $${i}" ; \
+ cd ${WRKDIR}/ATLAS/THREADED_PIC/bin ; ${GMAKE} $${i} ; \
+ done
+ @for i in ${ALLTESTS} ; do \
+ ${ECHO_CMD} "Benchmarking $${i}" ; \
+ cd ${WRKDIR}/ATLAS/NON_THREADED_PIC/bin ; ./$${i} ; \
+ done
+ @for i in ${ALLTESTS_PT} ; do \
+ ${ECHO_CMD} "Benchmarking $${i}" ; \
+ cd ${WRKDIR}/ATLAS/THREADED_PIC/bin ; ./$${i} ; \
+ done
+
+
+
diff --git a/math/atlas-devel/files/patch-CONFIG+src+SpewMakeInc.c b/math/atlas-devel/files/patch-CONFIG+src+SpewMakeInc.c
index 961a7078682f..2c69025a738e 100644
--- a/math/atlas-devel/files/patch-CONFIG+src+SpewMakeInc.c
+++ b/math/atlas-devel/files/patch-CONFIG+src+SpewMakeInc.c
@@ -1,6 +1,15 @@
---- CONFIG/src/SpewMakeInc.c~ Tue Dec 19 06:47:11 2006
-+++ CONFIG/src/SpewMakeInc.c Wed Dec 27 17:05:12 2006
-@@ -588,7 +588,7 @@
+--- CONFIG/src/SpewMakeInc.c.orig Sat Jan 6 13:57:34 2007
++++ CONFIG/src/SpewMakeInc.c Sat Jan 6 13:58:21 2007
+@@ -582,13 +582,13 @@
+ fprintf(fpout, "# ------------------------------------\n");
+ fprintf(fpout, "# Reference and system libraries\n");
+ fprintf(fpout, "# ------------------------------------\n");
+- fprintf(fpout, " BLASlib = \n");
+- fprintf(fpout, " FBLASlib = \n");
+- fprintf(fpout, " FLAPACKlib = ");
++ fprintf(fpout, " BLASlib = -L%%LOCALBASE%%/lib -lblas\n");
++ fprintf(fpout, " FBLASlib = -L%%LOCALBASE%%/lib -lblas\n");
++ fprintf(fpout, " FLAPACKlib = -L%%LOCALBASE%%/lib -llapack");
if (flapack) fprintf(fpout, "%s", flapack);
fprintf(fpout, "\n");
if (THREADS)
diff --git a/math/atlas-devel/files/thread-patch b/math/atlas-devel/files/thread-patch
new file mode 100644
index 000000000000..693b6e56979c
--- /dev/null
+++ b/math/atlas-devel/files/thread-patch
@@ -0,0 +1,12 @@
+--- CONFIG/src/SpewMakeInc.c~ Sat Jan 6 13:50:21 2007
++++ CONFIG/src/SpewMakeInc.c Sat Jan 6 13:51:54 2007
+@@ -311,7 +311,8 @@
+ &mhz, &ptrbits, &ncpu, comps, &outfile, &srcdir, &blddir, &USEDEFL1,
+ &USEARCHDEF, &nof77, &f2cdefs, &cdefs, &pmake, &flapack,
+ &smaflags, &dmaflags, &l2size, &targ);
+- if (ncpu > 1) THREADS = 1;
++/* if (ncpu > 1) THREADS = 1; */
++ THREADS = 1;
+ if (!outfile)
+ fpout = stdout;
+ else
diff --git a/math/atlas-devel/pkg-plist b/math/atlas-devel/pkg-plist
index 744a7f6b6a94..bef990df7c72 100644
--- a/math/atlas-devel/pkg-plist
+++ b/math/atlas-devel/pkg-plist
@@ -26,6 +26,12 @@ lib/libf77blas.so
%%WITH_STATICLIB%%lib/libf77blas_r.a
lib/libf77blas_r.so.1
lib/libf77blas_r.so
+%%WITH_STATICLIB%%lib/libptcblas.a
+lib/libptcblas.so.1
+lib/libptcblas.so
+%%WITH_STATICLIB%%lib/libptf77blas.a
+lib/libptf77blas.so.1
+lib/libptf77blas.so
%%WITH_STATICLIB%%lib/libtstatlas.a
lib/libtstatlas.so.1
lib/libtstatlas.so
@@ -48,3 +54,52 @@ lib/libtstatlas_r.so
%%PORTDOCS%%share/doc/atlas/f77blasqref.ps
%%PORTDOCS%%share/doc/atlas/lapackqref.ps
%%PORTDOCS%%@dirrm share/doc/atlas
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xcl1blastst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xcl2blastst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xcl3blastst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xcl3blastst_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xcllttst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xcllttstF
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xcllttstF_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xcllttst_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xclutst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xclutstF
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xclutstF_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xclutst_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xdl1blastst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xdl2blastst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xdl3blastst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xdl3blastst_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xdllttst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xdllttstF
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xdllttstF_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xdllttst_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xdlutst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xdlutstF
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xdlutstF_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xdlutst_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xsl1blastst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xsl2blastst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xsl3blastst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xsl3blastst_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xsllttst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xsllttstF
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xsllttstF_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xsllttst_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xslutst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xslutstF
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xslutstF_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xslutst_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xzl1blastst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xzl2blastst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xzl3blastst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xzl3blastst_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xzllttst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xzllttstF
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xzllttstF_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xzllttst_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xzlutst
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xzlutstF
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xzlutstF_pt
+%%WITH_TESTS%%%%EXAMPLESDIR%%/xzlutst_pt
+%%WITH_TESTS%%@dirrm %%EXAMPLESDIR%%