aboutsummaryrefslogtreecommitdiffstats
path: root/math
diff options
context:
space:
mode:
authormaho <maho@FreeBSD.org>2007-01-07 06:18:51 +0800
committermaho <maho@FreeBSD.org>2007-01-07 06:18:51 +0800
commit50960988ecbd469b047472667f64211d3d38230a (patch)
treeddfbd3960a46e6035f42b0b0f59ab20123b3d7e1 /math
parent191916650d789c81c8de68028d1978796b8e70c9 (diff)
downloadfreebsd-ports-gnome-50960988ecbd469b047472667f64211d3d38230a.tar.gz
freebsd-ports-gnome-50960988ecbd469b047472667f64211d3d38230a.tar.zst
freebsd-ports-gnome-50960988ecbd469b047472667f64211d3d38230a.zip
* Migrate to gfortran.
* portlint. * (option) Installing benchmark tests for real FLOPS. * Bump portrevision.
Diffstat (limited to 'math')
-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
-rw-r--r--math/atlas/Makefile60
-rw-r--r--math/atlas/files/Makefile.test35
-rw-r--r--math/atlas/files/patch-config.c15
-rw-r--r--math/atlas/pkg-plist49
9 files changed, 319 insertions, 33 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%%
diff --git a/math/atlas/Makefile b/math/atlas/Makefile
index 5625f37aea05..613caa4891bb 100644
--- a/math/atlas/Makefile
+++ b/math/atlas/Makefile
@@ -10,6 +10,7 @@
PORTNAME= atlas
PORTVERSION= 3.6.0
+PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= math
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
@@ -19,18 +20,31 @@ DISTNAME= ${PORTNAME}${PORTVERSION}
MAINTAINER= maho@FreeBSD.org
COMMENT= Automatically Tuned Linear Algebra Software (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>
-.if ${OSVERSION} < 501000 && ${ARCH} == "alpha"
-USE_GCC=3.4
+#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
+.elif ${OSVERSION} < 501000 && ${ARCH} == "alpha"
+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
# only affects for lapack sub project
@@ -48,6 +62,7 @@ post-patch:
.endif
@${REINPLACE_CMD} -e 's+%%PTHREAD_CFLAGS%%+${PTHREAD_CFLAGS}+g' \
-e 's+%%PTHREAD_LIBS%%+${PTHREAD_LIBS}+g' \
+ -e 's+%%LOCALBASE%%+${LOCALBASE}+g' \
${WRKSRC}/config.c
.if defined(PORTS_ARCH)
@${REINPLACE_CMD} -e 's+%%PORTS_ARCH%%+${PORTS_ARCH}+g' \
@@ -56,11 +71,11 @@ post-patch:
@${REINPLACE_CMD} -e 's+%%PORTS_ARCH%%+0+g' \
-e 's+%%HAVE_ARCH%%+0+g' ${WRKSRC}/config.c
.endif
-.if (${MACHINE_ARCH} == "alpha")
+.if (${ARCH} == "alpha")
EXTRA_PATCHES+= ${FILESDIR}/alpha-patch
.endif
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${ARCH} == "sparc64"
PICFLAG?= -fPIC
.else
PICFLAG?= -fpic
@@ -69,7 +84,7 @@ PICFLAG?= -fpic
ANSWER_i386?= ${PRINTF} "\n\n\n\n\n\n\n\n\n\n"
ANSWER_ia64?= ${PRINTF} "\n\n\n2\n\n\n\n\nf77\n-O2 -static\n\n"
-.if defined(PACKAGE_BUILDING) && (${MACHINE_ARCH} == "i386")
+.if defined(PACKAGE_BUILDING) && (${ARCH} == "i386")
PORTS_ARCH=IntP5
.endif
@@ -84,9 +99,14 @@ EXTRA_PATCHES+= ${FILESDIR}/timing_tolerance-patch
.endif
.if defined(WITH_STATICLIB)
-PLIST_SUB= WITH_STATICLIB=""
+PLIST_SUB+= WITH_STATICLIB=""
+.else
+PLIST_SUB+= WITH_STATICLIB="@comment "
+.endif
+.if defined(WITH_TESTS)
+PLIST_SUB+= WITH_TESTS=""
.else
-PLIST_SUB= WITH_STATICLIB="@comment "
+PLIST_SUB+= WITH_TESTS="@comment "
.endif
pre-configure:
@@ -122,12 +142,12 @@ pre-configure:
do-configure:
@(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} xconfig && \
- ${ANSWER} | ./xconfig -N 1 -c ${CC} -f ${FC} -m ${CC} -g ${CC} -x ${CC} -a NON_THREADED && \
- ${ANSWER} | ./xconfig -N 1 -c ${CC} -f ${FC} -m ${CC} -g ${CC} -x ${CC} -a NON_THREADED_PIC -C '${PICFLAG} -DPIC' -F f '${PICFLAG} -DPIC -O' )
+ ${ANSWER} | ./xconfig -N 1 -c ${CCOMPILER} -f ${FC} -m ${CCOMPILER} -g ${CCOMPILER} -x ${CCOMPILER} -a NON_THREADED && \
+ ${ANSWER} | ./xconfig -N 1 -c ${CCOMPILER} -f ${FC} -m ${CCOMPILER} -g ${CCOMPILER} -x ${CCOMPILER} -a NON_THREADED_PIC -C '${PICFLAG} -DPIC' -F f '${PICFLAG} -DPIC -O' )
@(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/thread-patch && \
${MAKE_ENV} ${MAKE} xconfig && \
- ${ANSWER} | ./xconfig -c ${CC} -f ${FC} -m ${CC} -g ${CC} -x ${CC} -a THREADED && \
- ${ANSWER} | ./xconfig -c ${CC} -f ${FC} -m ${CC} -g ${CC} -x ${CC} -a THREADED_PIC -C '${PICFLAG} -DPIC' -F f '${PICFLAG} -DPIC -O' )
+ ${ANSWER} | ./xconfig -c ${CCOMPILER} -f ${FC} -m ${CCOMPILER} -g ${CCOMPILER} -x ${CCOMPILER} -a THREADED && \
+ ${ANSWER} | ./xconfig -c ${CCOMPILER} -f ${FC} -m ${CCOMPILER} -g ${CCOMPILER} -x ${CCOMPILER} -a THREADED_PIC -C '${PICFLAG} -DPIC' -F f '${PICFLAG} -DPIC -O' )
ATLAS_LIBS1=libalapack libatlas libcblas libf77blas libtstatlas
ATLAS_LIBS2=libptcblas libptf77blas
@@ -150,6 +170,9 @@ do-build:
@(cd ${WRKSRC}; ${MAKE} ${.MAKEFLAGS} "ARCH=NON_THREADED" install arch=NON_THREADED)
@(cd ${WRKSRC}; ${MAKE} ${.MAKEFLAGS} "ARCH=THREADED" install arch=THREADED)
.endif
+.if defined(WITH_TESTS)
+ @${MAKE} test
+.endif
post-build:
.if defined(WITH_STATICLIB)
@@ -239,5 +262,14 @@ do-install:
@${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/doc/* ${DOCSDIR}
.endif
-
+.if defined(WITH_TESTS)
+ ${MKDIR} ${EXAMPLESDIR}
+ @for i in ${ALLTESTS} ; do \
+ cd ${WRKDIR}/ATLAS/bin/NON_THREADED_PIC ; ${INSTALL_PROGRAM} $${i} ${EXAMPLESDIR} ; \
+ done
+ @for i in ${ALLTESTS_PT} ; do \
+ cd ${WRKDIR}/ATLAS/bin/THREADED_PIC ; ${INSTALL_PROGRAM} $${i} ${EXAMPLESDIR} ; \
+ done
+.endif
+.include <${FILESDIR}/Makefile.test>
.include <bsd.port.post.mk>
diff --git a/math/atlas/files/Makefile.test b/math/atlas/files/Makefile.test
new file mode 100644
index 000000000000..34c74c9711fd
--- /dev/null
+++ b/math/atlas/files/Makefile.test
@@ -0,0 +1,35 @@
+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
+#builderrors?
+# xsl1blastst_pt xdl1blastst_pt xcl1blastst_pt xzl1blastst_pt \
+# xsl2blastst_pt xdl2blastst_pt xcl2blastst_pt xzl2blastst_pt \
+
+test:
+ @for i in ${ALLTESTS} ; do \
+ ${ECHO_CMD} "Making $${i}" ; \
+ cd ${WRKDIR}/ATLAS/bin/NON_THREADED_PIC/ ; ${GMAKE} ${.MAKEFLAGS} "ARCH=NON_THREADED_PIC" $${i} ; \
+ done
+ @for i in ${ALLTESTS_PT} ; do \
+ ${ECHO_CMD} "Making $${i}" ; \
+ cd ${WRKDIR}/ATLAS/bin/THREADED_PIC ; ${GMAKE} ${.MAKEFLAGS} "ARCH=THREADED_PIC" $${i} ; \
+ done
+ @for i in ${ALLTESTS} ; do \
+ ${ECHO_CMD} "Benchmarking $${i}" ; \
+ cd ${WRKDIR}/ATLAS/bin/NON_THREADED_PIC ; ./$${i} ; \
+ done
+ @for i in ${ALLTESTS_PT} ; do \
+ ${ECHO_CMD} "Benchmarking $${i}" ; \
+ cd ${WRKDIR}/ATLAS/bin/THREADED_PIC ; ./$${i} ; \
+ done
+
+
+
diff --git a/math/atlas/files/patch-config.c b/math/atlas/files/patch-config.c
index 3ac9303830e7..c7417d2ff76c 100644
--- a/math/atlas/files/patch-config.c
+++ b/math/atlas/files/patch-config.c
@@ -165,3 +165,18 @@
if (OS == OSAIX) fprintf(fpout, " -DIBM_PT_ERROR");
if (OS == OSIRIX) fprintf(fpout, " -D_POSIX_C_SOURCE=199506L");
}
+--- config.c.orig Sat Jan 6 21:07:32 2007
++++ config.c Sun Jan 7 06:06:08 2007
+@@ -4177,9 +4177,9 @@
+ fprintf(fpout, "# ------------------------------------\n");
+ fprintf(fpout, "# Reference and system libraries\n");
+ fprintf(fpout, "# ------------------------------------\n");
+- fprintf(fpout, " BLASlib = %s\n", BLASlib);
+- fprintf(fpout, " FBLASlib = \n");
+- fprintf(fpout, " FLAPACKlib = \n");
++ fprintf(fpout, " BLASlib = -L%%LOCALBASE%%/lib -lblas\n");
++ fprintf(fpout, " FBLASlib = -L%%LOCALBASE%%/lib -lblas\n");
++ fprintf(fpout, " FLAPACKlib = -L%%LOCALBASE%%/lib -llapack\n");
+ fprintf(fpout, " LIBS = %s\n\n", LIBS);
+
+ fprintf(fpout,
diff --git a/math/atlas/pkg-plist b/math/atlas/pkg-plist
index 2eefb616bc66..10d5f4af292e 100644
--- a/math/atlas/pkg-plist
+++ b/math/atlas/pkg-plist
@@ -54,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%%