Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Aug 2002 16:53:06 -0700 (PDT)
From:      Nakata Maho <chat95@mbox.kyoto-inet.or.jp>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/41770: port maintainer fix: ATLAS compilation fails on Alpha platforms
Message-ID:  <200208182353.g7INr6Ge036599@www.freebsd.org>

Next in thread | Raw E-Mail | Index | Archive | Help

>Number:         41770
>Category:       ports
>Synopsis:       port maintainer fix: ATLAS compilation fails on Alpha platforms
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 18 17:00:03 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Nakata Maho
>Release:        4.6-stable
>Organization:
private
>Environment:
FreeBSD quanta.synchem.kyoto-u.ac.jp 4.6-STABLE FreeBSD 4.6-STABLE #0: Wed Jul  3 23:00:59 JST 2002     maho@quanta.synchem.kyoto-u.ac.jp:/usr/src/sys/compile/MAHO-QUANTA  alpha

>Description:
Compilation of the port math/atlas fails on Alpha
platforms. reported by Christian Weisgerber <naddy@freebsd.org>
I update the port and build succesfully on these platforms.
There are other problems, that math/atlas ignore CC
and CFLAGS.
However, author of atlas knows what is the best choices of CC, and CFLAGS, so I keep untouched.
For example, for i386,
I build atlas with using intel C compiler which may be faster than gcc, but I didn't get performance gain and
even slower. So the best way is that keep untouched.
>How-To-Repeat:
      
>Fix:
diff -urN /work/cvsup/ports/math/atlas/Makefile atlas/Makefile
--- /work/cvsup/ports/math/atlas/Makefile	Tue Jul 16 06:23:27 2002
+++ atlas/Makefile	Sun Aug 18 12:40:49 2002
@@ -20,6 +20,11 @@
 USE_BZIP2=	yes
 WRKSRC=		${WRKDIR}/ATLAS
 INSTALLS_SHLIB= yes
+USE_REINPLACE=  yes
+
+.if (${MACHINE_ARCH} == "alpha")
+USE_GCC=	3.1
+.endif
 
 do-configure:
 .if defined(BATCH) || defined(PACKAGE_BUILDING)
@@ -27,9 +32,16 @@
 .else
 	@(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} config)
 .endif
+.if (${MACHINE_ARCH} == "alpha")
+	@(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/alpha-patch)
+.endif
 
 do-build:
+.if (${MACHINE_ARCH} == "alpha") || defined(USE_GCC)
+	@${REINPLACE_CMD} -e 's|/usr/bin/gcc|${CC}|g;' ${WRKSRC}/Make.`cat ${WRKSRC}/ARCHNAME`
+.endif
 	(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} install arch=`cat ${WRKSRC}/ARCHNAME`)
+	(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} sanity_test arch=`cat ${WRKSRC}/ARCHNAME`)
 	(cd ${WRKSRC}; ${MKDIR} tmp ; \
 		${CP} ${LOCALBASE}/lib/liblapack.a tmp ;\
 		cd tmp ;\
diff -urN /work/cvsup/ports/math/atlas/files/alpha-patch atlas/files/alpha-patch
--- /work/cvsup/ports/math/atlas/files/alpha-patch	Thu Jan  1 09:00:00 1970
+++ atlas/files/alpha-patch	Sun Aug 18 10:47:51 2002
@@ -0,0 +1,9 @@
+--- src/blas/gemm/GOTO/ATLU_usergemm.c~ Mon Jun 17 10:38:22 2002
++++ src/blas/gemm/GOTO/ATLU_usergemm.c  Sun Aug 18 10:41:19 2002
+@@ -1,5 +1,5 @@
+ #include "atlas_misc.h"
+-#include <sys/mman.h>
++/*#include <sys/mman.h>*/
+ 
+ #ifdef EV6
+    #ifdef ATL_OS_OSF1
diff -urN /work/cvsup/ports/math/atlas/files/patch-aa atlas/files/patch-aa
--- /work/cvsup/ports/math/atlas/files/patch-aa	Tue Jul 16 06:23:27 2002
+++ atlas/files/patch-aa	Sun Aug 18 03:11:47 2002
@@ -1,6 +1,26 @@
---- config.c.orig	Mon Jun 17 09:37:24 2002
-+++ config.c	Mon Jul 15 18:39:46 2002
-@@ -2049,12 +2049,14 @@
+--- config.c.orig	Mon Jun 17 10:37:24 2002
++++ config.c	Sun Aug 18 03:11:24 2002
+@@ -692,7 +692,7 @@
+          else if (mach == IA64Itan || MachIsUS(mach) ||
+                   mach == Dec21164 || mach == Dec21264)
+          {
+-            if (major == 3)
++            if ((major == 2 && minor < 96) || (major == 3)) /* Nasty hack for FreeBSD/Alpha STABLE */
+             {
+                strcpy(goodgcc, files[i]);
+                return(0);
+@@ -2040,7 +2040,10 @@
+          if (!CmndOneLine(targ, "sysctl hw.model", ln))
+          {
+             if (strstr(ln, "433au")) mach = Dec21164;
++            else if (strstr(ln, "500au")) mach = Dec21164;
++            else if (strstr(ln, "AlphaPC 164")) mach = Dec21164;
+             else if (strstr(ln, "XP1000")) mach = Dec21264;
++            else mach = Dec21264;
+          }
+          break;
+       case LAIA64: /* don't know */
+@@ -2049,12 +2052,14 @@
           if (!CmndOneLine(targ, "sysctl hw.model", ln))
           {
              if (strstr(ln, "Pentium Pro")) mach = IntPPRO;
@@ -10,12 +30,13 @@
              else if (strstr(ln, "Athlon")) mach = AmdAthlon;
              else if (strstr(ln, "AMD-K7")) mach = AmdAthlon;
              else if (strstr(ln, "Pentium/P55C")) mach = IntP5MMX; /* sent by */
-             else if (strstr(ln, "Pentium")) mach=IntP5;       /* Nakata Maho */
-+            else mach=IntP5;
+-            else if (strstr(ln, "Pentium")) mach=IntP5;       /* Nakata Maho */
++            else if (strstr(ln, "Pentium")) mach = IntP5;       /* Nakata Maho */
++            else mach = IntP5;
           }
           break;
        default:;
-@@ -3024,6 +3026,9 @@
+@@ -3024,6 +3029,9 @@
     }
     if (USEWINF77) strcpy(F77, "$(BINdir)/winf77.exe");
  
diff -urN /work/cvsup/ports/math/atlas/pkg-descr atlas/pkg-descr
--- /work/cvsup/ports/math/atlas/pkg-descr	Sat Jun 22 18:33:15 2002
+++ atlas/pkg-descr	Sun Aug 18 02:42:21 2002
@@ -11,14 +11,13 @@
 IT SIGNIFICANTLY IMPROVES PERFORMANCE. 
 
 If you use blas, you can simply change flags when linking,
-from -lblas to -lf77blas -latlas (order is important)
-get a significantly performance increase.
+from -lblas to -lf77blas -latlas (order is important).
 
 A few routines from LAPACK are merged into one library as libalapack.
 It requres both C and Fortran77 interfaces, and thus that link line would be:
--lalapack -lf77blas -lcblas -latlas -lg2c -lm 
-Order *is* important, so -latlas -lcblas will *not* work.
+-lalapack -lf77blas -lcblas -latlas -lg2c -lm .
+
+Other choice of CC and CFLAGS are *NOT* recommended.
+They are already optimized for this platform and automatically searched.
 
 WWW: http://math-atlas.sourceforge.net/
-- NAKATA, Maho
-  E-mail: chat95@mbox.kyoto-inet.or.jp

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?200208182353.g7INr6Ge036599>