summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorMaho Nakata <maho@FreeBSD.org>2004-01-20 01:24:34 +0000
committerMaho Nakata <maho@FreeBSD.org>2004-01-20 01:24:34 +0000
commita1995689bbc17adb6446aeeb5e289028fab04337 (patch)
tree77d82285a038d69301055505093a1ff24d948b45 /math
parentadd p5-FCGI-ProcManager 0.17 (diff)
a) update to 3.6.0
b) make PIC object files for amd64 c) some clean ups
Notes
Notes: svn path=/head/; revision=98624
Diffstat (limited to 'math')
-rw-r--r--math/atlas-devel/Makefile150
-rw-r--r--math/atlas-devel/distinfo2
-rw-r--r--math/atlas-devel/files/non-thread-patch19
-rw-r--r--math/atlas-devel/files/patch-config.c41
-rw-r--r--math/atlas-devel/files/thread-patch19
5 files changed, 140 insertions, 91 deletions
diff --git a/math/atlas-devel/Makefile b/math/atlas-devel/Makefile
index ed5b24159f04..66f97f987371 100644
--- a/math/atlas-devel/Makefile
+++ b/math/atlas-devel/Makefile
@@ -6,10 +6,10 @@
#
# NOTE: This port purposely ignores the CC and CFLAGS settings.
-# Program and compiler flags are finetuned to gcc 2.95/3.1.
+# Program and compiler flags are finetuned to gcc.
PORTNAME= atlas
-PORTVERSION= 3.5.22
+PORTVERSION= 3.6.0
CATEGORIES= math
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= math-atlas
@@ -18,15 +18,32 @@ DISTNAME= ${PORTNAME}${PORTVERSION}
MAINTAINER= maho@FreeBSD.org
COMMENT= Development version of math/atlas
-LIB_DEPENDS= lapack:${PORTSDIR}/math/lapack
-
USE_BZIP2= yes
WRKSRC= ${WRKDIR}/ATLAS
INSTALLS_SHLIB= yes
USE_REINPLACE= yes
PKGNAMESUFFIX= -devel
+# only affects for lapack sub project
+.if defined(WITH_OPTIMIZED_FLAGS)
+FFLAGS+= -pipe -O3 -ffast-math -finline-functions -fstrength-reduce -funroll-loops -fexpensive-optimizations
+.if (${MACHINE_ARCH} == "i386" && !${MACHINE_ARCH} == "amd64" )
+FFLAGS+= -mfancy-math-387 -mpreferred-stack-boundary=3 -malign-double
+.endif # i386
+.endif
+
+.include <bsd.port.pre.mk>
+
post-patch:
+.if !defined(WITH_OPTIMIZED_FLAGS)
+ @${ECHO_CMD} "You can optimize lapack sub project by setting WITH_OPTIMIZED_FLAGS=yes."
+.endif
+.if ${ARCH} == "i386" && ${OSVERSION} >= 502000
+ @${ECHO_CMD} "NOTE FOR SMP USERS: You also want to activate libkse or libthr by"
+ @${ECHO_CMD} "# cp /usr/lib/libkse.so.1 /usr/lib/libpthread.so.1"
+ @${ECHO_CMD} "# ln -s /usr/lib/libpthread.so.1 /usr/lib/libpthread.so"
+ @${ECHO_CMD} "If not, stop this and re make again"
+.endif
@${REINPLACE_CMD} -e 's+%%PTHREAD_CFLAGS%%+ ${PTHREAD_CFLAGS}+' \
${WRKSRC}/config.c
@${REINPLACE_CMD} -e 's+%%PTHREAD_LIBS%%+ ${PTHREAD_LIBS}+' \
@@ -35,68 +52,113 @@ post-patch:
@(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/alpha-patch)
.endif
+.if !defined(PICFLAG)
+.if ${MACHINE_ARCH} == "sparc64"
+PICFLAG=-fPIC
+.else
+PICFLAG=-fpic
+.endif
+.endif
+
do-configure:
- @(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/non-thread-patch)
- @(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} config < ${FILESDIR}/answer)
+ @(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} xconfig ; \
+ ./xconfig -N 1 -c ${CC} -f ${FC} -a NON_THREADED < ${FILESDIR}/answer)
+ @(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} xconfig ; \
+ ./xconfig -N 1 -c ${CC} -f ${FC} -a NON_THREADED_PIC \
+ -F c '${PICFLAG} -DPIC' -F f '${PICFLAG} -DPIC' \
+ -F m '${PICFLAG} -DPIC' -F x '${PICFLAG} -DPIC' < ${FILESDIR}/answer)
@(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/thread-patch)
- @(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} config < ${FILESDIR}/answer)
+ @(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} xconfig ; \
+ ./xconfig -c ${CC} -f ${FC} -a THREADED < ${FILESDIR}/answer)
+ @(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} xconfig ; \
+ ./xconfig -c ${CC} -f ${FC} -a THREADED_PIC \
+ -F c '${PICFLAG} -DPIC' -F f '${PICFLAG} -DPIC' \
+ -F m '${PICFLAG} -DPIC' -F x '${PICFLAG} -DPIC' < ${FILESDIR}/answer)
-NON_THREADED_ATLAS=`cat ${WRKSRC}/ARCHNAME-NON-THREADED`
-THREADED_ATLAS=`cat ${WRKSRC}/ARCHNAME-THREADED`
-ATLAS_LIBS1=libatlas libcblas libf77blas libtstatlas libalapack
+ATLAS_LIBS1=libalapack libatlas libcblas libf77blas libtstatlas
ATLAS_LIBS2=libptcblas libptf77blas
-post-configure:
-.if defined(USE_GCC)
- @${REINPLACE_CMD} -e 's|/usr/bin/gcc|${CC}|g;' ${WRKSRC}/Make.${NON_THREADED_ATLAS}
- @${REINPLACE_CMD} -e 's|/usr/bin/gcc|${CC}|g;' ${WRKSRC}/Make.${THREADED_ATLAS}
-.endif
-
do-build:
-# non thread version
- (cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} install arch=${NON_THREADED_ATLAS})
-# (cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} sanity_test arch=${NON_THREADED_ATLAS})
- (cd ${WRKSRC}; ${MKDIR} tmp ; \
- ${CP} ${LOCALBASE}/lib/liblapack.a tmp ;\
- cd tmp ;\
+# make lapack
+.if ! exists(${WRKDIR}/lapack/Makefile)
+ @${ECHO_MSG} "===> Extracting lapack sub project"
+ @${MKDIR} ${WRKDIR}/lapack
+ @${CP} -r ${PORTSDIR}/math/lapack/files ${WRKDIR}/lapack
+ @${CP} -r ${PORTSDIR}/math/lapack/scripts ${WRKDIR}/lapack
+ @${CP} ${PORTSDIR}/math/lapack/Makefile ${WRKDIR}/lapack
+ @${CP} ${PORTSDIR}/math/lapack/distinfo ${WRKDIR}/lapack
+ @${CP} ${PORTSDIR}/math/lapack/pkg-descr ${WRKDIR}/lapack
+ @cd ${WRKDIR}/lapack ; ${MAKE} "FFLAGS=${FFLAGS}" FC="${FC}" build WRKDIRPREFIX=""
+.endif
+# @(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} install arch=NON_THREADED)
+# @(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} install arch=NON_THREADED_PIC)
+# @(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} install arch=THREADED)
+# @(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} install arch=THREADED_PIC)
+# make atlas enhanced lapack (static ver)
+ (cd ${WRKSRC}; ${MKDIR} tmp1 ; \
+ ${CP} ${WRKDIR}/lapack/work/LAPACK/SRC/liblapack.a tmp1 ;\
+ cd tmp1 ;\
+ ar x liblapack.a ;\
+ ar x ../lib/NON_THREADED/liblapack.a ;\
+ ar r ../lib/NON_THREADED/libalapack.a *.o ;\
+ ranlib ../lib/NON_THREADED/libalapack.a )
+# make atlas enhanced lapack (static and thread safe ver)
+ (cd ${WRKSRC}; ${MKDIR} tmp2 ; \
+ ${CP} ${WRKDIR}/lapack/work/LAPACK/SRC/liblapack.a tmp2 ;\
+ cd tmp2 ;\
ar x liblapack.a ;\
- ar x ../lib/${NON_THREADED_ATLAS}/liblapack.a ;\
- ar r ../lib/${NON_THREADED_ATLAS}/libalapack.a *.o ;\
- ranlib ../lib/${NON_THREADED_ATLAS}/libalapack.a )
+ ar x ../lib/THREADED/liblapack.a ;\
+ ar r ../lib/THREADED/libalapack.a *.o ;\
+ ranlib ../lib/THREADED/libalapack.a )
+# 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 ;\
+ for object in `${FIND} tmp3 -name "*.So"` ; do \
+ n=`${ECHO_CMD} $${object}|${SED} -e 's#.So##'` ; \
+ ${MV} $$n.So $$n.o ; \
+ done ; \
+ cd tmp3 ;\
+ ar x ../lib/NON_THREADED_PIC/liblapack.a ;\
+ ar r ../lib/NON_THREADED_PIC/libalapack.a *.o ;\
+ ranlib ../lib/NON_THREADED_PIC/libalapack.a )
+# make atlas enhanced lapack (shared and thread safe ver)
+ ( cd ${WRKSRC}; ${MKDIR} tmp4 ;\
+ ${TAR} --exclude "*.f" --exclude "*.po" --exclude "*.o" -cf - -C ${WRKDIR}/lapack/work/LAPACK/SRC . | ${TAR} xf - -C tmp4 ;\
+ for object in `${FIND} tmp4 -name "*.So"` ; do \
+ n=`${ECHO_CMD} $${object}|${SED} -e 's#.So##'` ; \
+ ${MV} $$n.So $$n.o ; \
+ done ; \
+ cd tmp4 ;\
+ ar x ../lib/THREADED_PIC/liblapack.a ;\
+ ar r ../lib/THREADED_PIC/libalapack.a *.o ;\
+ ranlib ../lib/THREADED_PIC/libalapack.a )
+
+# make atlas shared library
.for i in ${ATLAS_LIBS1}
- ( cd ${WRKSRC}/lib/${NON_THREADED_ATLAS}/ ; \
+ ( cd ${WRKSRC}/lib/NON_THREADED_PIC/ ; \
ld -Bshareable -o ${i}.so.1 -x -soname ${i}.so.1 --whole-archive ${i}.a )
.endfor
-# thread version
- (cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} install arch=${THREADED_ATLAS})
-# (cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} sanity_test arch=${THREADED_ATLAS})
- (cd ${WRKSRC}; ${MKDIR} tmp2 ; \
- ${CP} ${LOCALBASE}/lib/liblapack.a tmp2 ;\
- cd tmp2 ;\
- ar x liblapack.a ;\
- ar x ../lib/${THREADED_ATLAS}/liblapack.a ;\
- ar r ../lib/${THREADED_ATLAS}/libalapack.a *.o ;\
- ranlib ../lib/${THREADED_ATLAS}/libalapack.a )
+# make atlas shared (thread safe) library
.for i in ${ATLAS_LIBS1} ${ATLAS_LIBS2}
- ( cd ${WRKSRC}/lib/${THREADED_ATLAS}/ ; \
+ ( cd ${WRKSRC}/lib/THREADED_PIC/ ; \
ld -Bshareable -o ${i}.so.1 -x -soname ${i}.so.1 --whole-archive ${i}.a )
.endfor
do-install:
.for i in ${ATLAS_LIBS1}
- @${INSTALL_DATA} ${WRKSRC}/lib/${NON_THREADED_ATLAS}/${i}.a ${PREFIX}/lib
- @${INSTALL_DATA} ${WRKSRC}/lib/${NON_THREADED_ATLAS}/${i}.so.1 ${PREFIX}/lib
+ @${INSTALL_DATA} ${WRKSRC}/lib/NON_THREADED/${i}.a ${PREFIX}/lib
+ @${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}
- @${INSTALL_DATA} ${WRKSRC}/lib/${THREADED_ATLAS}/${i}.a ${PREFIX}/lib/${i}_r.a
- @${INSTALL_DATA} ${WRKSRC}/lib/${THREADED_ATLAS}/${i}.so.1 ${PREFIX}/lib/${i}_r.so.1
+ @${INSTALL_DATA} ${WRKSRC}/lib/THREADED/${i}.a ${PREFIX}/lib/${i}_r.a
+ @${INSTALL_DATA} ${WRKSRC}/lib/THREADED_PIC/${i}.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}
- @${INSTALL_DATA} ${WRKSRC}/lib/${THREADED_ATLAS}/${i}.a ${PREFIX}/lib
- @${INSTALL_DATA} ${WRKSRC}/lib/${THREADED_ATLAS}/${i}.so.1 ${PREFIX}/lib
+ @${INSTALL_DATA} ${WRKSRC}/lib/THREADED/${i}.a ${PREFIX}/lib
+ @${INSTALL_DATA} ${WRKSRC}/lib/THREADED_PIC/${i}.so.1 ${PREFIX}/lib
@${LN} -sf ${i}.so.1 ${PREFIX}/lib/${i}.so
.endfor
@${INSTALL_DATA} ${WRKSRC}/include/cblas.h ${PREFIX}/include
@@ -108,4 +170,4 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/doc/* ${DOCSDIR}
.endif
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/math/atlas-devel/distinfo b/math/atlas-devel/distinfo
index 2896c636d596..88607159496d 100644
--- a/math/atlas-devel/distinfo
+++ b/math/atlas-devel/distinfo
@@ -1 +1 @@
-MD5 (atlas3.5.22.tar.bz2) = a19b18834a8bbe9aeeaea19e534892f1
+MD5 (atlas3.6.0.tar.bz2) = df2ee2eb65d1c08ee93d04370172c262
diff --git a/math/atlas-devel/files/non-thread-patch b/math/atlas-devel/files/non-thread-patch
deleted file mode 100644
index 742eb36f4d29..000000000000
--- a/math/atlas-devel/files/non-thread-patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- config.c.orig Sun Dec 28 13:12:32 2003
-+++ config.c Sun Dec 28 13:15:07 2003
-@@ -3515,6 +3515,7 @@
- }
- i = ncpu;
- if (!ncpu) ncpu = ProbeNCPU(OS, mach, targ, TOPdir);
-+ ncpu = 1; // force non-threading
- if (ncpu != 1) /* user may want to thread */
- {
- DisplayFile("CONFIG/pthread.txt", stdout, NLINES);
-@@ -3952,6 +3953,7 @@
- USEDEFL1 = !IsYes('y', "", "Tune the Level 1 BLAS?");
- }
-
-+ fpout = fopen("ARCHNAME-NON-THREADED", "w");
- fprintf(fpout, "%s", ARCH);
- fclose(fpout);
- ATL_mprintf(2, fplog, stdout,"\nCreating make include file Make.%s\n", ARCH);
-
diff --git a/math/atlas-devel/files/patch-config.c b/math/atlas-devel/files/patch-config.c
index 458bbbb4d032..4f6773eacf38 100644
--- a/math/atlas-devel/files/patch-config.c
+++ b/math/atlas-devel/files/patch-config.c
@@ -34,6 +34,15 @@
}
}
return(*comp ? comp : NULL);
+@@ -2801,7 +2801,7 @@
+ else if (strstr(ln, "ia64")) la = LAIA64;
+ else if ( strstr(ln, "i686") || strstr(ln, "i586") ||
+ strstr(ln, "i486") || strstr(ln, "i386") ||
+- strstr(ln, "x86_64") ) la = LAX86;
++ strstr(ln, "x86_64") || strstr(ln, "amd64") ) la = LAX86;
+ }
+ return(la);
+ }
@@ -2840,7 +2842,10 @@
if (!CmndOneLine(targ, "sysctl hw.model", ln))
{
@@ -51,7 +60,7 @@
if (strstr(ln, "Pentium Pro")) mach = IntPPRO;
+ 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;
++ else if (strstr(ln, "Pentium(R) 4")) mach = IntP4;
else if (strstr(ln, "Pentium III")) mach = IntPIII;
+ else if (strstr(ln, "Pentium(R) III")) mach = IntPIII;
else if (strstr(ln, "Pentium II ")) mach = IntPII;
@@ -70,15 +79,29 @@
}
break;
default:;
-@@ -3939,6 +3952,8 @@
- USEDEFL1 = !IsYes('y', "", "Tune the Level 1 BLAS?");
+@@ -3654,8 +3654,8 @@
+ }
+ if (THREADS) /* add ncpu to ARCH */
+ {
+- for (i=0; ARCH[i]; i++);
+- sprintf(ARCH+i, "_%d", ncpu);
++// for (i=0; ARCH[i]; i++); // do not add number of cpu for ARCHNAME
++// sprintf(ARCH+i, "_%d", ncpu); // #cpu can be different in general
}
-
-+ fprintf(fpout, "%s", ARCH);
-+ fclose(fpout);
- ATL_mprintf(2, fplog, stdout,"\nCreating make include file Make.%s\n", ARCH);
- sprintf(ln, "Make.%s", ARCH);
- fpout = fopen(ln, "w");
+ do
+ {
+@@ -4064,9 +4063,9 @@
+ if (mach == IA64Itan || mach == IA64Itan2 )
+ fprintf(fpout, " -DATL_MAXNREG=128");
+ if (ASMD != ASM_None) fprintf(fpout, " -DATL_%s", ASMNAM[ASMD]);
+- if (mach == AmdHammer32 && (OS != OSWinNT && OS != OSWin9x))
++ if (mach == AmdHammer32 && (OS != OSWinNT && OS != OSWin9x && OS != OSFreeBSD))
+ fprintf(fpout, " -m32");
+- else if (mach == AmdHammer64) fprintf(fpout, " -m64");
++ else if (mach == AmdHammer64 && (OS != OSFreeBSD)) fprintf(fpout, " -m64");
+ if (mach == IA64Itan2 && strstr(CC, "icc"))
+ fprintf(fpout, " -DATL_IntelIccBugs");
+ fprintf(fpout, "\n\n");
@@ -4080,7 +4095,7 @@
if (THREADS)
{
diff --git a/math/atlas-devel/files/thread-patch b/math/atlas-devel/files/thread-patch
index e07813c4fc30..5d6521809593 100644
--- a/math/atlas-devel/files/thread-patch
+++ b/math/atlas-devel/files/thread-patch
@@ -5,24 +5,7 @@
enum USERGEMM {UG_None=0, UG_GOTO};
-int XCOMP=0, THREADS=0, USEWINF77=0, NLINES=0, ISWIN=0;
-+int XCOMP=0, THREADS=1, USEWINF77=0, NLINES=0, ISWIN=0; // force threading
++int XCOMP=0, THREADS=1, USEWINF77=0, NLINES=0, ISWIN=0; // force threading for single processor
char TARGNAM[512];
enum MACHTYPE mach=MACHOther;
-@@ -3515,7 +3515,6 @@
- }
- i = ncpu;
- if (!ncpu) ncpu = ProbeNCPU(OS, mach, targ, TOPdir);
-- ncpu = 1; // force non-threading
- if (ncpu != 1) /* user may want to thread */
- {
- DisplayFile("CONFIG/pthread.txt", stdout, NLINES);
-@@ -3155,7 +3154,7 @@
- }
- if (USEWINF77) strcpy(F77, "$(BINdir)/winf77.exe");
-
-- fpout = fopen("ARCHNAME-NON-THREADED", "w");
-+ fpout = fopen("ARCHNAME-THREADED", "w");
- fprintf(fpout, "%s", ARCH);
- fclose(fpout);
- ATL_mprintf(2, fplog, stdout,"\nCreating make include file Make.%s\n", ARCH);