diff options
author | Maho Nakata <maho@FreeBSD.org> | 2006-02-11 09:11:24 +0000 |
---|---|---|
committer | Maho Nakata <maho@FreeBSD.org> | 2006-02-11 09:11:24 +0000 |
commit | 25ea124ad7fd370ca774b67c54e656772226cefc (patch) | |
tree | 8f616e107e2302b3b1cc33f3f49e031996fbfa2f /math | |
parent | Add some missed distfiles. (diff) |
o Do not build static libraries in default setting; this reduce the
build time by half.
o Add support for Pentium D
o timing_torerance patch is now activated via knob; this significantly
reduce the build time.
A lot of discussion with: "Pedro F. Giffuni" <giffunip@yahoo.com>
Notes
Notes:
svn path=/head/; revision=155725
Diffstat (limited to 'math')
-rw-r--r-- | math/atlas-devel/Makefile | 70 | ||||
-rw-r--r-- | math/atlas-devel/files/patch-config.c | 30 | ||||
-rw-r--r-- | math/atlas-devel/files/timing_tolerance-patch (renamed from math/atlas-devel/files/patch-tune+sysinfo+getSysSum.c) | 0 | ||||
-rw-r--r-- | math/atlas-devel/pkg-plist | 24 |
4 files changed, 81 insertions, 43 deletions
diff --git a/math/atlas-devel/Makefile b/math/atlas-devel/Makefile index 07c45cc45ea3..64242ef98464 100644 --- a/math/atlas-devel/Makefile +++ b/math/atlas-devel/Makefile @@ -51,7 +51,7 @@ post-patch: -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" @@ -63,8 +63,9 @@ 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" -#for ports build cluster -#PORTS_ARCH=IntP5 +.if defined(PACKAGE_BUILDING) && (${MACHINE_ARCH} == "i386") +PORTS_ARCH=IntP5 +.endif .if !defined(ANSWER_${ARCH}) ANSWER= ${ANSWER_i386} @@ -72,24 +73,17 @@ ANSWER= ${ANSWER_i386} ANSWER= ${ANSWER_${ARCH}} .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 && \ - ${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' ) - @(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' ) - -ATLAS_LIBS1=libalapack libatlas libcblas libf77blas libtstatlas -ATLAS_LIBS2=libptcblas libptf77blas +.if defined(TIMING_TOLERANCE) +EXTRA_PATCHES+= ${FILESDIR}/timing_tolerance-patch +.endif -pre-build: +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" @@ -98,6 +92,37 @@ pre-build: @${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 && \ + ${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' ) + @(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' ) + +ATLAS_LIBS1=libalapack libatlas libcblas libf77blas libtstatlas +ATLAS_LIBS2=libptcblas libptf77blas +.if defined(WITH_STATICLIB) +PLIST_SUB= WITH_STATICLIB="" +.else +PLIST_SUB= WITH_STATICLIB="@comment " .endif do-build: @@ -112,11 +137,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 ;\ @@ -133,6 +162,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 ;\ @@ -174,17 +204,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 diff --git a/math/atlas-devel/files/patch-config.c b/math/atlas-devel/files/patch-config.c index b4d966ac20db..cb8770f5fa2f 100644 --- a/math/atlas-devel/files/patch-config.c +++ b/math/atlas-devel/files/patch-config.c @@ -1,5 +1,5 @@ ---- config.c.orig Sun Apr 24 22:31:53 2005 -+++ config.c Tue Jun 28 16:46:54 2005 +--- config.c.orig Sun Aug 21 22:30:17 2005 ++++ config.c Thu Jan 5 18:49:36 2006 @@ -686,7 +686,10 @@ { if (strstr(ln2, "Apple Computer")) @@ -12,7 +12,7 @@ if (*major != -1) { *minor = GetIntVers(ln2+j, &i); j += i; -@@ -1044,6 +1044,8 @@ +@@ -1041,6 +1044,8 @@ { if (strstr(ln, "x86_64")) iret = 1; @@ -21,7 +21,7 @@ else if (strstr(ln, "ppc64")) iret = 2; } -@@ -1229,7 +1232,9 @@ +@@ -1240,7 +1245,9 @@ switch(OS) { case OSOSX: /* don't know answer */ @@ -32,7 +32,7 @@ case OSLinux: break; case OSSunOS: -@@ -1494,9 +1499,9 @@ +@@ -1505,9 +1512,9 @@ if (THREADS && OS == OSFreeBSD) { if (which == CPF77) @@ -44,7 +44,7 @@ } break; case OSSunOS4: -@@ -2113,8 +2118,8 @@ +@@ -2124,8 +2131,8 @@ if (OS == OSFreeBSD) { if (strstr(comp, "cc")) @@ -55,7 +55,7 @@ } } return(*comp ? comp : NULL); -@@ -2756,7 +2761,7 @@ +@@ -2767,7 +2774,7 @@ break; case IntP4: lf1 = l1 = 64; @@ -64,7 +64,7 @@ s1 = 0; s2 = 0; break; -@@ -2860,6 +2865,7 @@ +@@ -2871,6 +2878,7 @@ l1 = l2 = s1 = s2 = 0; lf2 = 4096; } @@ -72,7 +72,7 @@ if (lvl == 1) { if (AmSure) *AmSure = s1; -@@ -2977,7 +2983,7 @@ +@@ -2988,7 +2996,7 @@ else if (strstr(ln, "ia64")) la = LAIA64; else if ( strstr(ln, "i686") || strstr(ln, "i586") || strstr(ln, "i486") || strstr(ln, "i386") || @@ -81,7 +81,7 @@ } return(la); } -@@ -3006,6 +3012,9 @@ +@@ -3017,6 +3025,9 @@ else sprintf(ln2, "cd CONFIG ; make IRunx86Info mydir=%s/CONFIG | fgrep cpu", TOPdir); @@ -91,7 +91,7 @@ if ( !CmndOneLine(NULL, ln2, ln) ) { if (strstr(ln, "Pentium 4E64")) -@@ -3047,12 +3056,22 @@ +@@ -3058,12 +3069,22 @@ } break; case LASPARC: /* don't know */ @@ -114,13 +114,15 @@ } break; case LAIA64: /* don't know */ -@@ -3060,15 +3079,36 @@ +@@ -3071,15 +3092,38 @@ case LAX86: if (!CmndOneLine(targ, "sysctl hw.model", ln)) { +// mach = Use64Bits ? IntP4E64 : IntP4E; #EM64T +// mach = IntP4E; #prescott if (strstr(ln, "Pentium Pro")) mach = IntPPRO; ++ else if (strstr(ln, "Pentium(R) D") && sizeof(void *)==4) mach = IntP4E; ++ else if (strstr(ln, "Pentium(R) D") && sizeof(void *)==8) mach = IntP4E64; + else if (strstr(ln, "Pentium(R) Pro")) mach = IntPPRO; + else if (strstr(ln, "Pentium 4")) mach = IntP4; + else if (strstr(ln, "Pentium(R) 4")) mach = IntP4; @@ -156,7 +158,7 @@ } break; default:; -@@ -3922,8 +3961,8 @@ +@@ -3933,8 +3977,8 @@ } if (THREADS) /* add ncpu to ARCH */ { @@ -167,7 +169,7 @@ } do { -@@ -4371,7 +4410,7 @@ +@@ -4382,7 +4426,7 @@ if (THREADS) { fprintf(fpout, " -DATL_NCPU=%d", ncpu); diff --git a/math/atlas-devel/files/patch-tune+sysinfo+getSysSum.c b/math/atlas-devel/files/timing_tolerance-patch index 5113e28405ab..5113e28405ab 100644 --- a/math/atlas-devel/files/patch-tune+sysinfo+getSysSum.c +++ b/math/atlas-devel/files/timing_tolerance-patch diff --git a/math/atlas-devel/pkg-plist b/math/atlas-devel/pkg-plist index 1a9eff85d161..2eefb616bc66 100644 --- a/math/atlas-devel/pkg-plist +++ b/math/atlas-devel/pkg-plist @@ -2,40 +2,40 @@ include/cblas.h include/clapack.h include/blas.h include/lapack.h -lib/libalapack.a +%%WITH_STATICLIB%%lib/libalapack.a lib/libalapack.so.1 lib/libalapack.so -lib/libalapack_r.a +%%WITH_STATICLIB%%lib/libalapack_r.a lib/libalapack_r.so.1 lib/libalapack_r.so -lib/libatlas.a +%%WITH_STATICLIB%%lib/libatlas.a lib/libatlas.so.1 lib/libatlas.so -lib/libatlas_r.a +%%WITH_STATICLIB%%lib/libatlas_r.a lib/libatlas_r.so.1 lib/libatlas_r.so -lib/libcblas.a +%%WITH_STATICLIB%%lib/libcblas.a lib/libcblas.so.1 lib/libcblas.so -lib/libcblas_r.a +%%WITH_STATICLIB%%lib/libcblas_r.a lib/libcblas_r.so.1 lib/libcblas_r.so -lib/libf77blas.a +%%WITH_STATICLIB%%lib/libf77blas.a lib/libf77blas.so.1 lib/libf77blas.so -lib/libf77blas_r.a +%%WITH_STATICLIB%%lib/libf77blas_r.a lib/libf77blas_r.so.1 lib/libf77blas_r.so -lib/libptcblas.a +%%WITH_STATICLIB%%lib/libptcblas.a lib/libptcblas.so.1 lib/libptcblas.so -lib/libptf77blas.a +%%WITH_STATICLIB%%lib/libptf77blas.a lib/libptf77blas.so.1 lib/libptf77blas.so -lib/libtstatlas.a +%%WITH_STATICLIB%%lib/libtstatlas.a lib/libtstatlas.so.1 lib/libtstatlas.so -lib/libtstatlas_r.a +%%WITH_STATICLIB%%lib/libtstatlas_r.a lib/libtstatlas_r.so.1 lib/libtstatlas_r.so %%PORTDOCS%%share/doc/atlas/AtlasCredits.txt |