From llwang@infor.ck.tp.edu.tw  Sat Mar 16 19:48:16 2002
Return-Path: <llwang@infor.ck.tp.edu.tw>
Received: from infor.ck.tp.edu.tw (infor.ck.tp.edu.tw [203.64.26.200])
	by hub.freebsd.org (Postfix) with ESMTP id 97C3937B420
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 16 Mar 2002 19:48:01 -0800 (PST)
Received: by infor.ck.tp.edu.tw (Postfix, from userid 1001)
	id 27A439293; Sun, 17 Mar 2002 11:47:45 +0800 (CST)
Message-Id: <20020317034745.27A439293@infor.ck.tp.edu.tw>
Date: Sun, 17 Mar 2002 11:47:45 +0800 (CST)
From: Li-lun Wang (Leland Wang) <llwang@infor.org>
Reply-To: Li-lun Wang (Leland Wang) <llwang@infor.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: math/atlas does not build on some machines
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         35994
>Category:       ports
>Synopsis:       math/atlas does not build on some machines
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 16 19:50:00 PST 2002
>Closed-Date:    Mon Mar 25 21:50:26 PST 2002
>Last-Modified:  Mon Mar 25 21:50:26 PST 2002
>Originator:     Li-lun Wang (Leland Wang)
>Release:        FreeBSD 4.5-RELEASE-p2 i386
>Organization:
National Taiwan University
>Environment:
System: FreeBSD Athena.infor.org 4.5-RELEASE-p2 FreeBSD 4.5-RELEASE-p2 #0: Fri Mar 8 19:11:20 CST 2002 root@Athena.infor.org:/usr/obj/usr/src/sys/Athena i386


	
>Description:
math/atlas port uses default answers for the configuration, which makes
it unable to build on some machines, e.g. K6-III. The questions asked are
different for different archs, and the default answers provided in
${FILESDIR} is not suitable for all archs. Since NO_PACKAGE and NO_CDROM
are already defined, I suggest to remove the default answers and define
IS_INTERACTIVE to make it happy on all supported archs.
>How-To-Repeat:
make build the math/atlas port on a AMD K6-III box.
>Fix:
diff -urN atlas.orig/Makefile atlas/Makefile
--- atlas.orig/Makefile	Fri Mar 15 11:53:15 2002
+++ atlas/Makefile	Sun Mar 17 11:26:21 2002
@@ -16,16 +16,17 @@
 
 BUILD_DEPENDS=	${LOCALBASE}/lib/liblapack.a:${PORTSDIR}/math/lapack
 
+IS_INTERACTIVE=	yes
 USE_BZIP2=	yes
 WRKSRC=		${WRKDIR}/ATLAS
 NO_PACKAGE=	"It is better to compile at the target machine."
 NO_CDROM=	"It is better to compile at the target machine."
 
 do-configure:
-	@(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} config < ${FILESDIR}/answer)
+	@(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} config)
 
 do-build:
-	(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} install arch=FreeBSD_GENERIC)
+	(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} install arch=`cat ${WRKSRC}/ARCHNAME`)
 	(cd ${WRKSRC}; ${MKDIR} tmp ; \
 			${CP} ${LOCALBASE}/lib/liblapack.a tmp ;\
 			cd tmp ;\
diff -urN atlas.orig/files/answer atlas/files/answer
--- atlas.orig/files/answer	Fri Mar 15 11:53:15 2002
+++ atlas/files/answer	Thu Jan  1 08:00:00 1970
@@ -1,9 +0,0 @@
-
-
-
-
-
-FreeBSD_GENERIC
-
-
-
diff -urN atlas.orig/files/patch-aa atlas/files/patch-aa
--- atlas.orig/files/patch-aa	Fri Mar 15 11:53:15 2002
+++ atlas/files/patch-aa	Sun Mar 17 11:22:08 2002
@@ -1,5 +1,5 @@
---- config.c.orig	Sat Feb  2 11:57:44 2002
-+++ config.c	Sun Mar  3 16:28:41 2002
+--- config.c.orig	Sat Feb  2 10:57:44 2002
++++ config.c	Sun Mar 17 11:19:00 2002
 @@ -2050,6 +2050,7 @@
           if (!CmndOneLine(targ, "sysctl hw.model", ln))
           {
@@ -8,3 +8,13 @@
              else if (strstr(ln, "Pentium III")) mach = IntPIII;
              else if (strstr(ln, "Pentium II ")) mach = IntPII;
              else if (strstr(ln, "Athlon")) mach = AmdAthlon;
+@@ -3018,6 +3019,9 @@
+    }
+    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);
+    sprintf(ln, "Make.%s", ARCH);
+    fpout = fopen(ln, "w");


>Release-Note:
>Audit-Trail:

From: "Li-lun Wang (Leland Wang)" <llwang@infor.org>
To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports@FreeBSD.org
Cc:  
Subject: Re: ports/35994: math/atlas does not build on some machines
Date: Sun, 17 Mar 2002 22:58:38 +0800

 I am sorry that I forgot to deal with the same thing for do_install.
 Please use the following patch instead.
 
 diff -urN atlas.orig/Makefile atlas/Makefile
 --- atlas.orig/Makefile	Fri Mar 15 11:53:15 2002
 +++ atlas/Makefile	Sun Mar 17 22:53:34 2002
 @@ -16,29 +16,30 @@
  
  BUILD_DEPENDS=	${LOCALBASE}/lib/liblapack.a:${PORTSDIR}/math/lapack
  
 +IS_INTERACTIVE=	yes
  USE_BZIP2=	yes
  WRKSRC=		${WRKDIR}/ATLAS
  NO_PACKAGE=	"It is better to compile at the target machine."
  NO_CDROM=	"It is better to compile at the target machine."
  
  do-configure:
 -	@(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} config < ${FILESDIR}/answer)
 +	@(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} config)
  
  do-build:
 -	(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} install arch=FreeBSD_GENERIC)
 +	(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} install arch=`cat ${WRKSRC}/ARCHNAME`)
  	(cd ${WRKSRC}; ${MKDIR} tmp ; \
  			${CP} ${LOCALBASE}/lib/liblapack.a tmp ;\
  			cd tmp ;\
  			ar x liblapack.a ;\
 -			ar x ../lib/FreeBSD_GENERIC/liblapack.a ;\
 -			ar r ../lib/FreeBSD_GENERIC/libalapack.a *.o ;\
 -			ranlib ../lib/FreeBSD_GENERIC/libalapack.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 )
  do-install:
  	@${MKDIR} ${PREFIX}/share/doc/atlas
 -	${INSTALL_DATA} ${WRKSRC}/lib/FreeBSD_GENERIC/libatlas.a    ${PREFIX}/lib
 -	${INSTALL_DATA} ${WRKSRC}/lib/FreeBSD_GENERIC/libcblas.a    ${PREFIX}/lib
 -	${INSTALL_DATA} ${WRKSRC}/lib/FreeBSD_GENERIC/libf77blas.a  ${PREFIX}/lib
 -	${INSTALL_DATA} ${WRKSRC}/lib/FreeBSD_GENERIC/libtstatlas.a ${PREFIX}/lib
 -	${INSTALL_DATA} ${WRKSRC}/lib/FreeBSD_GENERIC/libalapack.a  ${PREFIX}/lib
 +	${INSTALL_DATA} ${WRKSRC}/lib/`cat ${WRKSRC}/ARCHNAME`/libatlas.a    ${PREFIX}/lib
 +	${INSTALL_DATA} ${WRKSRC}/lib/`cat ${WRKSRC}/ARCHNAME`/libcblas.a    ${PREFIX}/lib
 +	${INSTALL_DATA} ${WRKSRC}/lib/`cat ${WRKSRC}/ARCHNAME`/libf77blas.a  ${PREFIX}/lib
 +	${INSTALL_DATA} ${WRKSRC}/lib/`cat ${WRKSRC}/ARCHNAME`/libtstatlas.a ${PREFIX}/lib
 +	${INSTALL_DATA} ${WRKSRC}/lib/`cat ${WRKSRC}/ARCHNAME`/libalapack.a  ${PREFIX}/lib
  	${INSTALL_DATA} ${WRKSRC}/doc/* ${PREFIX}/share/doc/atlas
  .include <bsd.port.mk>
 diff -urN atlas.orig/files/answer atlas/files/answer
 --- atlas.orig/files/answer	Fri Mar 15 11:53:15 2002
 +++ atlas/files/answer	Thu Jan  1 08:00:00 1970
 @@ -1,9 +0,0 @@
 -
 -
 -
 -
 -
 -FreeBSD_GENERIC
 -
 -
 -
 diff -urN atlas.orig/files/patch-aa atlas/files/patch-aa
 --- atlas.orig/files/patch-aa	Fri Mar 15 11:53:15 2002
 +++ atlas/files/patch-aa	Sun Mar 17 22:52:09 2002
 @@ -1,5 +1,5 @@
 ---- config.c.orig	Sat Feb  2 11:57:44 2002
 -+++ config.c	Sun Mar  3 16:28:41 2002
 +--- config.c.orig	Sat Feb  2 10:57:44 2002
 ++++ config.c	Sun Mar 17 11:19:00 2002
  @@ -2050,6 +2050,7 @@
            if (!CmndOneLine(targ, "sysctl hw.model", ln))
            {
 @@ -8,3 +8,13 @@
               else if (strstr(ln, "Pentium III")) mach = IntPIII;
               else if (strstr(ln, "Pentium II ")) mach = IntPII;
               else if (strstr(ln, "Athlon")) mach = AmdAthlon;
 +@@ -3018,6 +3019,9 @@
 +    }
 +    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);
 +    sprintf(ln, "Make.%s", ARCH);
 +    fpout = fopen(ln, "w");

From: chat95@mbox.kyoto-inet.or.jp (Nakata Maho)
To: freebsd-gnats-submit@FreeBSD.org
Cc: llwang@infor.org
Subject: Re: ports/35994: math/atlas does not build on some machines
Date: Mon, 25 Mar 2002 16:24:38 +0900 (JST)

 I approve this refinement with Li-lun Wang's
 suggestion. He is completely reasonable.
 
  
State-Changed-From-To: open->closed 
State-Changed-By: ijliao 
State-Changed-When: Mon Mar 25 21:50:06 PST 2002 
State-Changed-Why:  
committed (with minor modified), thanks 

http://www.freebsd.org/cgi/query-pr.cgi?pr=35994 
>Unformatted:
