aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaho <maho@FreeBSD.org>2003-07-03 05:39:36 +0800
committermaho <maho@FreeBSD.org>2003-07-03 05:39:36 +0800
commit796033bf208a6152c5e14648ad8fa9eb2ba1213b (patch)
treecdcc2db6a055daed2f228463cf799d665b483e7c
parentc64b410e38c75615a578950e4610552346f1af2c (diff)
downloadfreebsd-ports-gnome-796033bf208a6152c5e14648ad8fa9eb2ba1213b.tar.gz
freebsd-ports-gnome-796033bf208a6152c5e14648ad8fa9eb2ba1213b.tar.zst
freebsd-ports-gnome-796033bf208a6152c5e14648ad8fa9eb2ba1213b.zip
build both threaded/non-threaded libraries
which introduced some kludge... Reported by: kris (broken on bento for lapack++) Suggestion from: "Pedro F. Giffuni" <giffunip@yahoo.com>
-rw-r--r--math/atlas/Makefile75
-rw-r--r--math/atlas/files/non-thread-patch18
-rw-r--r--math/atlas/files/patch-config.c7
-rw-r--r--math/atlas/files/thread-patch23
-rw-r--r--math/atlas/pkg-plist31
5 files changed, 119 insertions, 35 deletions
diff --git a/math/atlas/Makefile b/math/atlas/Makefile
index 9132ed4c341d..5b2fd281cb56 100644
--- a/math/atlas/Makefile
+++ b/math/atlas/Makefile
@@ -10,6 +10,7 @@
PORTNAME= atlas
PORTVERSION= 3.5.5
+PORTREVISION= 1
CATEGORIES= math
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= math-atlas
@@ -34,44 +35,72 @@ post-patch:
${WRKSRC}/config.c
@${REINPLACE_CMD} -e 's+%%PTHREAD_LIBS%%+ ${PTHREAD_LIBS}+' \
${WRKSRC}/config.c
-.if !defined(USE_THREADS)
- @${ECHO_MSG} "make USE_THREADS=yes for force to make threaded version"
-.else
- @(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/thread-patch)
+.if (${MACHINE_ARCH} == "alpha")
+ @(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/alpha-patch)
.endif
do-configure:
-.if defined(BATCH) || defined(PACKAGE_BUILDING)
+ @(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/non-thread-patch)
+ @(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} config < ${FILESDIR}/answer)
+ @(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/thread-patch)
@(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} config < ${FILESDIR}/answer)
-.else
- @(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} config)
-.endif
-.if (${MACHINE_ARCH} == "alpha")
- @(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/alpha-patch)
-.endif
-do-build:
+NON_THREADED_ATLAS=`cat ${WRKSRC}/ARCHNAME-NON-THREADED`
+THREADED_ATLAS=`cat ${WRKSRC}/ARCHNAME-THREADED`
+ATLAS_LIBS1=libatlas libcblas libf77blas libtstatlas libalapack
+ATLAS_LIBS2=libptcblas libptf77blas
+
+post-configure:
.if (${MACHINE_ARCH} == "alpha") || defined(USE_GCC)
- @${REINPLACE_CMD} -e 's|/usr/bin/gcc|${CC}|g;' ${WRKSRC}/Make.`cat ${WRKSRC}/ARCHNAME`
+ @${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
- (cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} install arch=`cat ${WRKSRC}/ARCHNAME`)
- (cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} sanity_test arch=`cat ${WRKSRC}/ARCHNAME`)
+
+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 ;\
ar x liblapack.a ;\
- ar x ../lib/`cat ${WRKSRC}/ARCHNAME`/liblapack.a ;\
- ar r ../lib/`cat ${WRKSRC}/ARCHNAME`/libalapack.a *.o ;\
- ranlib ../lib/`cat ${WRKSRC}/ARCHNAME`/libalapack.a )
-.for i in libatlas libcblas libf77blas libtstatlas libalapack
- ( cd ${WRKSRC}/lib/`cat ${WRKSRC}/ARCHNAME`/ ; \
+ ar x ../lib/${NON_THREADED_ATLAS}/liblapack.a ;\
+ ar r ../lib/${NON_THREADED_ATLAS}/libalapack.a *.o ;\
+ ranlib ../lib/${NON_THREADED_ATLAS}/libalapack.a )
+.for i in ${ATLAS_LIBS1}
+ ( cd ${WRKSRC}/lib/${NON_THREADED_ATLAS}/ ; \
+ 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 )
+.for i in ${ATLAS_LIBS1} ${ATLAS_LIBS2}
+ ( cd ${WRKSRC}/lib/${THREADED_ATLAS}/ ; \
ld -Bshareable -o ${i}.so.1 -x -soname ${i}.so.1 --whole-archive ${i}.a )
.endfor
do-install:
-.for i in libatlas libcblas libf77blas libtstatlas libalapack
- @${INSTALL_DATA} ${WRKSRC}/lib/`cat ${WRKSRC}/ARCHNAME`/${i}.a ${PREFIX}/lib
- @${INSTALL_DATA} ${WRKSRC}/lib/`cat ${WRKSRC}/ARCHNAME`/${i}.so.1 ${PREFIX}/lib
+.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
+ @${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}thr.a
+ @${INSTALL_DATA} ${WRKSRC}/lib/${THREADED_ATLAS}/${i}.so.1 ${PREFIX}/lib/${i}thr.so.1
+ @${LN} -sf ${i}thr.so.1 ${PREFIX}/lib/${i}thr.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
@${LN} -sf ${i}.so.1 ${PREFIX}/lib/${i}.so
.endfor
@${INSTALL_DATA} ${WRKSRC}/include/cblas.h ${PREFIX}/include
diff --git a/math/atlas/files/non-thread-patch b/math/atlas/files/non-thread-patch
new file mode 100644
index 000000000000..69c632a45b6a
--- /dev/null
+++ b/math/atlas/files/non-thread-patch
@@ -0,0 +1,18 @@
+--- config.c.orig Tue Jul 1 12:32:49 2003
++++ config.c Tue Jul 1 12:35:09 2003
+@@ -2737,6 +2737,7 @@
+ Use3DNow = IsYes('n', " ", "Use 3DNow! for computation?");
+ }
+ 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);
+@@ -3154,6 +3155,7 @@
+ }
+ if (USEWINF77) strcpy(F77, "$(BINdir)/winf77.exe");
+
++ 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/files/patch-config.c b/math/atlas/files/patch-config.c
index 84e0fee4d10f..c3bb42b8a882 100644
--- a/math/atlas/files/patch-config.c
+++ b/math/atlas/files/patch-config.c
@@ -1,5 +1,5 @@
---- config.c.orig Mon Jun 23 00:58:35 2003
-+++ config.c Sat Jun 28 16:44:25 2003
+--- config.c.orig Mon Jun 23 07:58:35 2003
++++ config.c Tue Jul 1 12:32:49 2003
@@ -708,7 +708,7 @@
else if (mach == IA64Itan || MachIsUS(mach) ||
mach == Dec21164 || mach == Dec21264)
@@ -66,11 +66,10 @@
}
break;
default:;
-@@ -3136,6 +3154,9 @@
+@@ -3136,6 +3154,8 @@
}
if (USEWINF77) strcpy(F77, "$(BINdir)/winf77.exe");
-+ fpout = fopen("ARCHNAME", "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/files/thread-patch b/math/atlas/files/thread-patch
index 1660248f74fe..4d1a00c71f47 100644
--- a/math/atlas/files/thread-patch
+++ b/math/atlas/files/thread-patch
@@ -1,11 +1,28 @@
---- config.c~ Wed Jun 11 11:25:09 2003
-+++ config.c Wed Jun 11 11:35:08 2003
+--- config.c.orig Tue Jul 1 12:35:09 2003
++++ config.c Tue Jul 1 12:35:44 2003
@@ -79,7 +79,7 @@
char *usermmnam[2] = {"", "GOTO"};
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
char TARGNAM[512];
enum MACHTYPE mach=MACHOther;
+@@ -2737,7 +2737,6 @@
+ Use3DNow = IsYes('n', " ", "Use 3DNow! for computation?");
+ }
+ 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);
diff --git a/math/atlas/pkg-plist b/math/atlas/pkg-plist
index 42d47883160b..b08b52302468 100644
--- a/math/atlas/pkg-plist
+++ b/math/atlas/pkg-plist
@@ -3,20 +3,41 @@ include/clapack.h
include/blas.h
include/lapack.h
lib/libalapack.a
-lib/libalapack.so
lib/libalapack.so.1
+lib/libalapack.so
+lib/libalapackthr.a
+lib/libalapackthr.so.1
+lib/libalapackthr.so
lib/libatlas.a
-lib/libatlas.so
lib/libatlas.so.1
+lib/libatlas.so
+lib/libatlasthr.a
+lib/libatlasthr.so.1
+lib/libatlasthr.so
lib/libcblas.a
-lib/libcblas.so
lib/libcblas.so.1
+lib/libcblas.so
+lib/libcblasthr.a
+lib/libcblasthr.so.1
+lib/libcblasthr.so
lib/libf77blas.a
-lib/libf77blas.so
lib/libf77blas.so.1
+lib/libf77blas.so
+lib/libf77blasthr.a
+lib/libf77blasthr.so.1
+lib/libf77blasthr.so
+lib/libptcblas.a
+lib/libptcblas.so.1
+lib/libptcblas.so
+lib/libptf77blas.a
+lib/libptf77blas.so.1
+lib/libptf77blas.so
lib/libtstatlas.a
-lib/libtstatlas.so
lib/libtstatlas.so.1
+lib/libtstatlas.so
+lib/libtstatlasthr.a
+lib/libtstatlasthr.so.1
+lib/libtstatlasthr.so
%%PORTDOCS%%share/doc/atlas/AtlasCredits.txt
%%PORTDOCS%%share/doc/atlas/ChangeLog
%%PORTDOCS%%share/doc/atlas/DirStruct.txt