[R-sig-Debian] Compiling R-2.11.0 with ATLAS-tuned BLAS and LAPACK

Avraham Adler avraham.adler at gmail.com
Fri May 28 07:27:22 CEST 2010


Hello. I am a Linux neophyte and know almost nothing  about compiling,
so I would appreciate any help and advice y'all would care to offer.

I am trying to compile the 64 bit version of R using a tuned ATLAS and
LAPACK (ATLAS 3.9.24). I am running Ubunto 10.04 LTS (through wubi,
FWIW). The ATLAS and LAPACK files (atlas.so, f77blas.so, lapack.so,
and cblas.so) are sitting in the folder "/usr/local/atlas/lib"
(together with the static .a versions and some other files.

Following the R installation manual, I used the following configure string:

./configure --enable-R-shlib --enable-BLAS-shlib
--with-blas="-L/usr/local/atlas/lib -latlas -lf77blas"
--with-lapack="-L/usr/local/atlas/lib -llapack -lcblas" CFLAGS='-O3
-pipe -march=native' CXXFLAGS='-O3 -pipe -march=native'
R_PAPERSIZE='letter'

The configuration routine returns the following errors:

checking for cblas_cdotu_sub in vecLib framework... no
checking for dgemm_ in -L/usr/local/atlas/lib -latlas -lf77blas... no
checking for dgemm_... no
checking for ATL_xerbla in -latlas... no
checking for dgemm_ in -lblas... no
checking for dgemm_ in -lblas... (cached) no
checking for dgemm_ in -lblas... (cached) no

Looking at the config.log shows the following:

configure:28566: checking for dgemm_ in -L/usr/local/atlas/lib -latlas -lf77blas
configure:28587: gcc -std=gnu99 -o conftest -O3 -pipe -march=native
-fpic  -I/usr/local/include  -L/usr/local/lib64 conftest.c
-L/usr/local/atlas/lib -latlas -lf77blas  -lgfortran -lm -ldl -lm  >&5
conftest.c: In function 'main':
conftest.c:193: warning: implicit declaration of function 'dgemm_'
/usr/local/atlas/lib/libf77blas.so: undefined reference to `atl_f77wrap_zger2u_'
/usr/local/atlas/lib/libf77blas.so: undefined reference to `atl_f77wrap_cger2c_'
/usr/local/atlas/lib/libf77blas.so: undefined reference to `atl_f77wrap_zger2c_'
/usr/local/atlas/lib/libf77blas.so: undefined reference to `atl_f77wrap_cger2u_'
collect2: ld returned 1 exit status
configure:28587: $? = 1

If I run "make" after this, R starts compiling and uses its own
built-in blas and lapack

I tried various different flavors of the configuration line including
using BLAS_LIBS and LAPACK_LIBS to pass the folder and libraries, and
nothing seems to work.

I do not know enough to know if the problem with my ATLAS libraries or
if the problem with my attempt at compiling R. If it makes a
difference, the ATLAS (3.9.24) needed to be compiled with the
--allow-multiple-definitions (-z multidef) option because of what may
be a bug (see <http://sourceforge.net/tracker/?func=detail&aid=2998779&group_id=23725&atid=379483>
)

I do not know if I could follow the "Shared BLAS" route suggested for
ACML/Goto, as ATLAS requires two files (the f77blas library as well).
Also, I would like to use the tuned lapack.

I would very much appreciate any and everyones advice, as I have no
idea how to proceed.

Thank you,

--Avraham



More information about the R-SIG-Debian mailing list