Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Feb 2007 07:17:54 +0900 (JST)
From:      Maho NAKATA <chat95@mac.com>
To:        rpvoland@facstaff.wisc.edu
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.)
Message-ID:  <20070210.071754.71112797.chat95@mac.com>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070210.071754.71112797.chat95>