From owner-freebsd-ports@FreeBSD.ORG Fri Feb 9 22:18:03 2007 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5277E16A401 for ; Fri, 9 Feb 2007 22:18:03 +0000 (UTC) (envelope-from maho.nakata@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.227]) by mx1.freebsd.org (Postfix) with ESMTP id 00B0B13C461 for ; Fri, 9 Feb 2007 22:18:02 +0000 (UTC) (envelope-from maho.nakata@gmail.com) Received: by nz-out-0506.google.com with SMTP id i11so990545nzh for ; Fri, 09 Feb 2007 14:18:02 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:message-id:to:cc:subject:from:in-reply-to:references:x-mailer:mime-version:content-type:content-transfer-encoding:sender; b=TfYsu4O0vpn3t+Hz3HhoAV2q2iB3j7yICeYksoUuVxvEVxXEpPXgo9JLJDGeFS0KbEFCRtN+F/TCHiz7VcJixMFf6N/6evCKROf52tYDN/UqRAfXY329aKLb9LttHmmchoNPxZKRN0TODmvZ92am2NpABwWde804gXgIc0mSiTM= Received: by 10.64.131.17 with SMTP id e17mr2122267qbd.1171059482136; Fri, 09 Feb 2007 14:18:02 -0800 (PST) Received: from localhost ( [133.11.172.102]) by mx.google.com with ESMTP id r1sm5283345nzd.2007.02.09.14.18.00; Fri, 09 Feb 2007 14:18:01 -0800 (PST) Date: Sat, 10 Feb 2007 07:17:54 +0900 (JST) Message-Id: <20070210.071754.71112797.chat95@mac.com> To: rpvoland@facstaff.wisc.edu From: Maho NAKATA In-Reply-To: <20070209.180418.85375367.chat95@mac.com> References: <20070126.113458.35660495.chat95@mac.com> <20070209.154656.63087958.chat95@mac.com> <20070209.180418.85375367.chat95@mac.com> X-Mailer: Mew version 5.1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: Maho NAKATA Cc: eric+fbports@vangyzen.net, vdemart1@tin.it, freebsd-ports@freebsd.org Subject: A workaround for math/R (was Re: math/R eats up all.) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Feb 2007 22:18:03 -0000 Dear all, First, Eric, I'd like to ask your opinion about the patch I proposed. If you approve I'll commit to math/R for atlas users. Several tries I found that for my Pentium M, status of buildablity of R is following: ATLAS + internal LAPACK o ATLAS + external LAPACK x ATLAS + ATLAS's LAPACK x --- BLAS + external LAPACK o BLAS + internal LAPACK o --- GOTOBLAS + internal LAPACK o GOTOBLAS + external LAPACK o o means build successfully x means build hangs up at: cc -std=gnu99 -shared -L/usr/local/lib -o grDevices.so chull.o devNull.o devPicTeX.o devPS.o devQuartz.o init.o -L../../../../lib -lR mkdir ../../../../library/grDevices/libs . internal LAPACK means using LAPACK comes with R. external LAPACK means using math/lapack ATLAS's LAPACK means using libalapack from math/atlas. I briefly read the source code what routines are used in internal LAPACK of R, it contains, Cholesky factorization etc, which are accelerated by ATLAS. Anyway, vanilla Lapack+atlas blas combination is 10%~20% faster than atlas's LAPACK. This is unfortunate perfomance loss. Here I propose a patch; just workarounding hang up during the build. there may be performance loss by not using ATLAS's LAPACK. Index: Makefile =================================================================== RCS file: /home/pcvs/ports/math/R/Makefile,v retrieving revision 1.57 diff -u -r1.57 Makefile --- Makefile 25 Jan 2007 17:56:40 -0000 1.57 +++ Makefile 9 Feb 2007 22:08:12 -0000 @@ -72,9 +72,15 @@ .if defined(WITH_ATLAS) LIB_DEPENDS+= atlas.2:${PORTSDIR}/math/atlas -CONFIGURE_ARGS+=--with-lapack="-lalapack -lcblas" --with-blas="-lf77blas" +CONFIGURE_ARGS+=--with-blas="-lf77blas -latlas" +# A workaround to prevent hangs up during the build. +.if ${ARCH} != "i386" +CONFIGURE_ARGS+=--with-lapack="-lalapack -lcblas" PLIST_SUB+= BLAS="@comment " .else +PLIST_SUB+= BLAS="" +.endif +.else LIB_DEPENDS+= blas.2:${PORTSDIR}/math/blas CONFIGURE_ARGS+=--with-blas="-lblas" PLIST_SUB+= BLAS="" Thanks for your patience, and sorry for inconvenience. Sincerely yours, -- NAKATA, Maho (maho@FreeBSD.org)