[R-SIG-Mac] Problem with lapack.so compiling R 2.2.0 from source under Tiger

Simon Urbanek simon.urbanek at r-project.org
Wed Oct 12 17:18:15 CEST 2005


Michael, Roberto,

On Oct 9, 2005, at 8:48 PM, Michael.Martin at anu.edu.au wrote:

> I am trying to compile R 2.2.0 from source under Tiger and am  
> running into
> problems with loading lapack.so when it tries to build the  
> grDevices library.
> I configured as follows:
> ./configure --with-blas='-framework vecLib' --with-lapack F77=gfortran
> and ran make, which resulted in the following error:
> Error in solve.default(rgb) : lapack routines cannot be loaded
> In addition: Warning message:
> unable to load shared library 'R-2.2.0/modules/lapack.so':
>   dlopen(R-2.2.0/modules/lapack.so, 6): Symbol not found:  
> _rcblas_zdotc_sub__
>   Referenced from: R-2.2.0/modules/lapack.so
>   Expected in: flat namespace

It is not quite clear to me why this sometimes happens - it seems to  
depend on the gcc/gfortran versions, but for some strange reason  
gfortran wants two underscores appended. Until I figure out the exact  
circumstances, please use the following patch if you get exactly the  
error above:

diff -ur R-2.2.0/src/modules/lapack/vecLibg95c.c R-2.2.0-p/src/ 
modules/lapack/vecLibg95c.c
--- R-2.2.0/src/modules/lapack/vecLibg95c.c     2005-09-07  
10:53:32.000000000 -0400
+++ R-2.2.0-p/src/modules/lapack/vecLibg95c.c   2005-10-12  
11:07:18.000000000 -0400
@@ -2,7 +2,7 @@
#include <vecLib/vecLib.h>
#ifdef HAVE_F77_UNDERSCORE
-# define F77_SYMBOL(x)   x ## _
+# define F77_SYMBOL(x)   x ## __
#else
# define F77_SYMBOL(x)   x
#endif

Again, as a side-note - we still discourage the use of gfortran 4.0.x  
due to unresolved issues and slight speed penalty - unless you need  
64-bit version of R we recommend the use of gcc 3.x + g77.

Cheers,
Simon



More information about the R-SIG-Mac mailing list