aboutsummaryrefslogtreecommitdiff
path: root/math/atlas/Makefile
diff options
context:
space:
mode:
authorMaho Nakata <maho@FreeBSD.org>2006-02-14 02:30:16 +0000
committerMaho Nakata <maho@FreeBSD.org>2006-02-14 02:30:16 +0000
commit28171a1dc8d9ec69b270cbf75dc704adc83a776a (patch)
tree2b41a9f297f2d4d2ed486c5440811c77d4c67230 /math/atlas/Makefile
parent270cf8d38cb285c3e5196d41d55eb63275cfaa03 (diff)
downloadports-28171a1dc8d9ec69b270cbf75dc704adc83a776a.tar.gz
ports-28171a1dc8d9ec69b270cbf75dc704adc83a776a.zip
Notes
Diffstat (limited to 'math/atlas/Makefile')
-rw-r--r--math/atlas/Makefile80
1 files changed, 68 insertions, 12 deletions
diff --git a/math/atlas/Makefile b/math/atlas/Makefile
index 8210beaeddeb..33be516f3d11 100644
--- a/math/atlas/Makefile
+++ b/math/atlas/Makefile
@@ -19,7 +19,7 @@ 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"
USE_BZIP2= yes
WRKSRC= ${WRKDIR}/ATLAS
@@ -34,7 +34,7 @@ USE_GCC=3.4
# only affects for lapack sub project
.if defined(WITH_OPTIMIZED_FLAGS)
-FFLAGS+=-pipe -O3 -ffast-math
+FFLAGS+=-pipe -O3 -ffast-math -funroll-all-loops -fpeel-loops -ftracer -funswitch-loops -funit-at-a-time
.endif
post-patch:
@@ -44,8 +44,15 @@ post-patch:
@${REINPLACE_CMD} -e 's+%%PTHREAD_CFLAGS%%+${PTHREAD_CFLAGS}+g' \
-e 's+%%PTHREAD_LIBS%%+${PTHREAD_LIBS}+g' \
${WRKSRC}/config.c
+.if defined(PORTS_ARCH)
+ @${REINPLACE_CMD} -e 's+%%PORTS_ARCH%%+${PORTS_ARCH}+g' \
+ -e 's+%%HAVE_ARCH%%+1+g' ${WRKSRC}/config.c
+.else
+ @${REINPLACE_CMD} -e 's+%%PORTS_ARCH%%+0+g' \
+ -e 's+%%HAVE_ARCH%%+0+g' ${WRKSRC}/config.c
+.endif
.if (${MACHINE_ARCH} == "alpha")
- @(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/alpha-patch)
+EXTRA_PATCHES+= ${FILESDIR}/alpha-patch
.endif
.if ${MACHINE_ARCH} == "sparc64"
@@ -57,12 +64,57 @@ 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")
+PORTS_ARCH=IntP5
+.endif
+
.if !defined(ANSWER_${ARCH})
ANSWER= ${ANSWER_i386}
.else
ANSWER= ${ANSWER_${ARCH}}
.endif
+.if defined(TIMING_TOLERANCE)
+EXTRA_PATCHES+= ${FILESDIR}/timing_tolerance-patch
+.endif
+
+.if defined(WITH_STATICLIB)
+PLIST_SUB= WITH_STATICLIB=""
+.else
+PLIST_SUB= WITH_STATICLIB="@comment "
+.endif
+
+pre-configure:
+ @${ECHO_MSG} "Warning:"
+ @${ECHO_MSG} "Building this port can take long time"
+ @${ECHO_MSG} "for slow computers (over 1 day)."
+ @${ECHO_MSG} "And sometimes stop building for Athlon."
+ @${ECHO_MSG} "In this case please retype make or rebuild whole atlas."
+ @${ECHO_MSG}
+.if !defined(PORTS_ARCH)
+ @${ECHO_MSG} "Warning:"
+ @${ECHO_MSG} "If your arch is not correctly detected, you can specify"
+ @${ECHO_MSG} "by yourself."
+ @${ECHO_MSG} "for example : make PORTS_ARCH=P5Int"
+ @${ECHO_MSG} "Available architectures for x86 are:"
+ @${ECHO_MSG} "IntP5, IntP5MMX, IntPPRO, IntPII, IntPIII, IntP4, IntP4E"
+ @${ECHO_MSG} "IntP4E64, TMEff, AmdAthlon,AmdHammer32, AmdHammer64"
+ @${ECHO_MSG}
+.endif
+.if !defined(TIMING_TOLERANCE)
+ @${ECHO_MSG} "If your install dies with unable to get timings in tolerance"
+ @${ECHO_MSG} "First please refer http://math-atlas.sourceforge.net/errata.html#tol"
+ @${ECHO_MSG} "and you can build with"
+ @${ECHO_MSG} "make clean; make -DTIMING_TOLERANCE"
+ @${ECHO_MSG} "if your build still dies, you can type make again, (and again...)"
+ @${ECHO_MSG}
+.endif
+.if !defined(WITH_STATICLIB)
+ @${ECHO_MSG} "You can build static libraries with"
+ @${ECHO_MSG} "make -DWITH_STATICLIB"
+ @${ECHO_MSG}
+.endif
+
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 && \
@@ -75,13 +127,6 @@ do-configure:
ATLAS_LIBS1=libalapack libatlas libcblas libf77blas libtstatlas
ATLAS_LIBS2=libptcblas libptf77blas
-pre-build:
- @${ECHO_MSG} "Warning:"
- @${ECHO_MSG} "Building this port can take long time"
- @${ECHO_MSG} "for slow computers (over 1 day)."
- @${ECHO_MSG} "And sometimes stop building for Athlon."
- @${ECHO_MSG} "In this case please retype make or rebuild whole atlas."
-
do-build:
# make lapack
.if ! exists(${WRKDIR}/lapack/Makefile)
@@ -94,11 +139,15 @@ do-build:
@${CP} ${PORTSDIR}/math/lapack/pkg-descr ${WRKDIR}/lapack
@cd ${WRKDIR}/lapack ; ${MAKE} "FFLAGS=${FFLAGS}" FC="${FC}" build WRKDIRPREFIX=""
.endif
- @(cd ${WRKSRC}; ${MAKE} ${.MAKEFLAGS} "ARCH=NON_THREADED" install arch=NON_THREADED)
@(cd ${WRKSRC}; ${MAKE} ${.MAKEFLAGS} "ARCH=NON_THREADED_PIC" install arch=NON_THREADED_PIC)
- @(cd ${WRKSRC}; ${MAKE} ${.MAKEFLAGS} "ARCH=THREADED" install arch=THREADED)
@(cd ${WRKSRC}; ${MAKE} ${.MAKEFLAGS} "ARCH=THREADED_PIC" install arch=THREADED_PIC)
+.if defined(WITH_STATICLIB)
+ @(cd ${WRKSRC}; ${MAKE} ${.MAKEFLAGS} "ARCH=NON_THREADED" install arch=NON_THREADED)
+ @(cd ${WRKSRC}; ${MAKE} ${.MAKEFLAGS} "ARCH=THREADED" install arch=THREADED)
+.endif
+
post-build:
+.if defined(WITH_STATICLIB)
# make atlas enhanced lapack (static ver)
(cd ${WRKSRC}; ${MKDIR} tmp1 ; \
${CP} ${WRKDIR}/lapack/work/LAPACK/SRC/liblapack.a tmp1 ;\
@@ -115,6 +164,7 @@ post-build:
ar x ../lib/THREADED/liblapack.a ;\
ar r ../lib/THREADED/libalapack.a *.o ;\
ranlib ../lib/THREADED/libalapack.a )
+.endif
# make atlas enhanced lapack (shared ver)
( cd ${WRKSRC}; ${MKDIR} tmp3 ;\
${TAR} --exclude "*.f" --exclude "*.po" --exclude "*.o" -cf - -C ${WRKDIR}/lapack/work/LAPACK/SRC . | ${TAR} xf - -C tmp3 ;\
@@ -156,17 +206,23 @@ post-build:
do-install:
.for i in ${ATLAS_LIBS1}
+.if defined(WITH_STATICLIB)
@${INSTALL_DATA} ${WRKSRC}/lib/NON_THREADED/${i}.a ${PREFIX}/lib
+.endif
@${INSTALL_DATA} ${WRKSRC}/lib/NON_THREADED_PIC/${i}.so.1 ${PREFIX}/lib
@${LN} -sf ${i}.so.1 ${PREFIX}/lib/${i}.so
.endfor
.for i in ${ATLAS_LIBS1}
+.if defined(WITH_STATICLIB)
@${INSTALL_DATA} ${WRKSRC}/lib/THREADED/${i}.a ${PREFIX}/lib/${i}_r.a
+.endif
@${INSTALL_DATA} ${WRKSRC}/lib/THREADED_PIC/${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}/lib/THREADED/${i}.a ${PREFIX}/lib
+.endif
@${INSTALL_DATA} ${WRKSRC}/lib/THREADED_PIC/${i}.so.1 ${PREFIX}/lib
@${LN} -sf ${i}.so.1 ${PREFIX}/lib/${i}.so
.endfor