[Rd] assistance building R on RHEL5

2011-11-10 Thread Mike Dahman
I have gotten this error while attempting to build R-2.13.2 and
R-2.14.0 using ./configure --with-x=no --enable-R-shlib, and
./configure --with-x=no


Red Hat Enterprise Linux Server release 5.6 (Tikanga)

=

Warning in solve.default(rgb) :
  unable to load shared object '/users/home/mked/R-2.13.2/modules//lapack.so':
  /users/home/mked/R-2.13.2/lib/libRlapack.so: undefined symbol:
_gfortran_concat_string
Error in solve.default(rgb) : lapack routines cannot be loaded
Error: unable to load R code in package 'grDevices'

=

I'm not sure how to rectify this issue.

Note: I ran 'configure' with an updated configure script to point to
the fortran version that is installed.

  F77=
  F95_compilers="f95 fort xlf95 ifort ifc efc pgf95 lf95 gfortran
gcc44-gfortran ftn g95" # <== gcc44-gfortran added
  F90_compilers="f90 xlf90 pgf90 pghpf epcf90"
  case "${host_os}" in
hpux*)
  F77_compilers="g77 fort77 f77 xlf frt pgf77 cf77 fl32 af77" ;;
*)
  F77_compilers="g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77" ;;
  esac
  GCC_Fortran_compiler=
  if test "${GCC}" = yes; then
case "${CC_VERSION}" in
  3.*) GCC_Fortran_compiler=g77 ;;
  4.*) GCC_Fortran_compiler=gcc44 ;;   # <== updated to gcc44
esac
  fi

thanks in advance -

-mike

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Define S4 methods for 'plot'

2011-11-10 Thread cgenolin
I works, thank you very much.

--
View this message in context: 
http://r.789695.n4.nabble.com/Define-S4-methods-for-plot-tp4020750p4023508.html
Sent from the R devel mailing list archive at Nabble.com.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] assistance building R on RHEL5

2011-11-10 Thread Prof Brian Ripley

On Wed, 9 Nov 2011, Mike Dahman wrote:


I have gotten this error while attempting to build R-2.13.2 and
R-2.14.0 using ./configure --with-x=no --enable-R-shlib, and
./configure --with-x=no


Hmm, gcc44 is unlikely to be a Fortran compiler.  You should not be 
patching the configure script, rather setting precious variables like 
F77 (see the R-admin manual).


The problem is in your Fortran setup. At a guess, it has a static 
libgfortran (unusual with gcc 4.x).  Take a look at 
src/library/modules/lapack/Makefile . You most likely have a line


Rlapack_la_LIBADD = # $(FLIBS) $(LIBR)

and need

Rlapack_la_LIBADD = $(FLIBS) # $(LIBR)

Either that, or your compiler and your dynamic libgfortran.so are 
mis-matched.






Red Hat Enterprise Linux Server release 5.6 (Tikanga)

=

Warning in solve.default(rgb) :
 unable to load shared object '/users/home/mked/R-2.13.2/modules//lapack.so':
 /users/home/mked/R-2.13.2/lib/libRlapack.so: undefined symbol:
_gfortran_concat_string
Error in solve.default(rgb) : lapack routines cannot be loaded
Error: unable to load R code in package 'grDevices'

=

I'm not sure how to rectify this issue.

Note: I ran 'configure' with an updated configure script to point to
the fortran version that is installed.

 F77=
 F95_compilers="f95 fort xlf95 ifort ifc efc pgf95 lf95 gfortran
gcc44-gfortran ftn g95" # <== gcc44-gfortran added
 F90_compilers="f90 xlf90 pgf90 pghpf epcf90"
 case "${host_os}" in
   hpux*)
 F77_compilers="g77 fort77 f77 xlf frt pgf77 cf77 fl32 af77" ;;
   *)
 F77_compilers="g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77" ;;
 esac
 GCC_Fortran_compiler=
 if test "${GCC}" = yes; then
   case "${CC_VERSION}" in
 3.*) GCC_Fortran_compiler=g77 ;;
 4.*) GCC_Fortran_compiler=gcc44 ;;   # <== updated to gcc44
   esac
 fi

thanks in advance -

-mike

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] url() does not decode when writing local files

2011-11-10 Thread Michael Lawrence
The url() function does not seem to decode a URL, at least when creating
local files. For example, if "%20" is used instead of " ", the "%20" will
be included verbatim in the file name.  In my opinion, it should perform
the replacement, i.e., the equivalent of URLdecode(). And really, it should
throw an error if someone passes an invalid URL, like one with a space
(which currently works).

> u <- url("file:///tmp/foo%20bar.test")
> writeLines("test", u)
> close(u)
> tools::list_files_with_exts("/tmp", "test")
[1] "/tmp/foo%20bar.test"

Probably should not work:
> u <- url("file:///tmp/foo bar.test2") # invalid URL
> writeLines("test", u)
> close(u)
> tools::list_files_with_exts("/tmp", "test2")
[1] "/tmp/foo bar.test2"

Michael

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] assistance building R on RHEL5

2011-11-10 Thread Mike Dahman
Thanks for the tips. It appears as the root cause was indeed the
fortran/gcc packages.

There was a mix of the gcc packages and gcc 44 packages. I removed the
gcc44s and installed the gcc-fortran, put the original configure
script back and compilation completed.

gcc.x86_64
gcc-c++.x86_64
gcc-gfortran.x86_64 (this was missing)

and

gcc44.x86_64
gcc44-c++.x86_64   (this was missing)
gcc44-gfortran.x86_64

You were also correct about the Rlapack_la_LIBADD syntax. I initially
changed it, but had the same result prior to fixing the gcc packages.
The compilation seemed to progress fine with the original makefile
after the gcc packages were cleaned up.

Rlapack_la_LIBADD = # $(FLIBS) $(LIBR)

'make check' just completed successfully so I'm hoping all is well.

Thanks again.

-mike

On Thu, Nov 10, 2011 at 5:43 AM, Prof Brian Ripley
 wrote:
> On Wed, 9 Nov 2011, Mike Dahman wrote:
>
>> I have gotten this error while attempting to build R-2.13.2 and
>> R-2.14.0 using ./configure --with-x=no --enable-R-shlib, and
>> ./configure --with-x=no
>
> Hmm, gcc44 is unlikely to be a Fortran compiler.  You should not be patching
> the configure script, rather setting precious variables like F77 (see the
> R-admin manual).
>
> The problem is in your Fortran setup. At a guess, it has a static
> libgfortran (unusual with gcc 4.x).  Take a look at
> src/library/modules/lapack/Makefile . You most likely have a line
>
> Rlapack_la_LIBADD = # $(FLIBS) $(LIBR)
>
> and need
>
> Rlapack_la_LIBADD = $(FLIBS) # $(LIBR)
>
> Either that, or your compiler and your dynamic libgfortran.so are
> mis-matched.
>
>
>>
>>
>> Red Hat Enterprise Linux Server release 5.6 (Tikanga)
>>
>> =
>>
>> Warning in solve.default(rgb) :
>>  unable to load shared object
>> '/users/home/mked/R-2.13.2/modules//lapack.so':
>>  /users/home/mked/R-2.13.2/lib/libRlapack.so: undefined symbol:
>> _gfortran_concat_string
>> Error in solve.default(rgb) : lapack routines cannot be loaded
>> Error: unable to load R code in package 'grDevices'
>>
>> =
>>
>> I'm not sure how to rectify this issue.
>>
>> Note: I ran 'configure' with an updated configure script to point to
>> the fortran version that is installed.
>>
>>  F77=
>>  F95_compilers="f95 fort xlf95 ifort ifc efc pgf95 lf95 gfortran
>> gcc44-gfortran ftn g95"     # <== gcc44-gfortran added
>>  F90_compilers="f90 xlf90 pgf90 pghpf epcf90"
>>  case "${host_os}" in
>>   hpux*)
>>     F77_compilers="g77 fort77 f77 xlf frt pgf77 cf77 fl32 af77" ;;
>>   *)
>>     F77_compilers="g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77" ;;
>>  esac
>>  GCC_Fortran_compiler=
>>  if test "${GCC}" = yes; then
>>   case "${CC_VERSION}" in
>>     3.*) GCC_Fortran_compiler=g77 ;;
>>     4.*) GCC_Fortran_compiler=gcc44 ;;   # <== updated to gcc44
>>   esac
>>  fi
>>
>> thanks in advance -
>>
>> -mike
>>
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
> --
> Brian D. Ripley,                  rip...@stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] When collected warnings exceeds 50

2011-11-10 Thread Jeffrey Horner
Hi,

I've been tracking down a memory leak in an rApache application,
http://data.vanderbilt.edu/rapache/bbplot. The code was deployed in
2007 and has survived numerous upgrades of both R and rApache
(including upgrades and bugs in RMySQL). It's written in such a way so
that web crawlers will download every possible URL the app will
create. It's not a high-traffic app, but just about every line of code
is executed at some point during a crawl by Google, Bing, etc.

Here's the salient point: the app (well, just about all rApache apps)
sets option warn to 0 to collect all warnings until a request is
completed. It turns out that some requests will collect more than 50
warnings, and the result is an apache process that leaks memory until
finally seg faulting somewhere in one of R's extra packages, if I
recall correctly.

After what seems like a month working on this problem, I think I've
narrowed it down to a simple test case. I'm testing with R-devel
r57624 on ubuntu linux. Running the following under valgrind:

R -d valgrind
> options(warn=0)
> for (i in 1:51) factor(1,levels=c(1,1) # duplicate level warningcall

and you should see "Invalid read" messages. I've narrowed it down to
vwarningcall_dflt starting a new R context via begincontext()  but
returning early without calling endcontext() in errors.c:

 svn diff src/main/errors.c
Index: src/main/errors.c
===
--- src/main/errors.c   (revision 57624)
+++ src/main/errors.c   (working copy)
@@ -333,8 +333,11 @@
char *tr; int nc;
if(!R_CollectWarnings)
setupwarnings();
-   if( R_CollectWarnings > 49 )
+   if( R_CollectWarnings > 49 ) {
+   endcontext(&cntxt);
+   inWarning = 0;
return;
+   }
SET_VECTOR_ELT(R_Warnings, R_CollectWarnings, call);
Rvsnprintf(buf, min(BUFSIZE, R_WarnLength+1), format, ap);
if(R_WarnLength < BUFSIZE - 20 && strlen(buf) == R_WarnLength)

This fix eliminates the "Invalid read" errors, but I'm unsure if it
fixes my application. I'll find out tomorrow.

Jeff

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] When collected warnings exceeds 50

2011-11-10 Thread Jeffrey Horner
On Thu, Nov 10, 2011 at 10:54 PM, Jeffrey Horner
 wrote:
> Hi,
>
> I've been tracking down a memory leak in an rApache application,
> http://data.vanderbilt.edu/rapache/bbplot. The code was deployed in
> 2007 and has survived numerous upgrades of both R and rApache
> (including upgrades and bugs in RMySQL). It's written in such a way so
> that web crawlers will download every possible URL the app will
> create. It's not a high-traffic app, but just about every line of code
> is executed at some point during a crawl by Google, Bing, etc.
>
> Here's the salient point: the app (well, just about all rApache apps)
> sets option warn to 0 to collect all warnings until a request is
> completed. It turns out that some requests will collect more than 50
> warnings, and the result is an apache process that leaks memory until
> finally seg faulting somewhere in one of R's extra packages, if I
> recall correctly.
>
> After what seems like a month working on this problem, I think I've
> narrowed it down to a simple test case. I'm testing with R-devel
> r57624 on ubuntu linux. Running the following under valgrind:
>
> R -d valgrind
>> options(warn=0)
>> for (i in 1:51) factor(1,levels=c(1,1) # duplicate level warningcall

Missed a closing parenthesis. should be :

> options(warn=0)
> for (i in 1:51) factor(1,levels=c(1,1)) # duplicate level warningcall

>
> and you should see "Invalid read" messages. I've narrowed it down to
> vwarningcall_dflt starting a new R context via begincontext()  but
> returning early without calling endcontext() in errors.c:
>
>  svn diff src/main/errors.c
> Index: src/main/errors.c
> ===
> --- src/main/errors.c   (revision 57624)
> +++ src/main/errors.c   (working copy)
> @@ -333,8 +333,11 @@
>        char *tr; int nc;
>        if(!R_CollectWarnings)
>            setupwarnings();
> -       if( R_CollectWarnings > 49 )
> +       if( R_CollectWarnings > 49 ) {
> +           endcontext(&cntxt);
> +           inWarning = 0;
>            return;
> +       }
>        SET_VECTOR_ELT(R_Warnings, R_CollectWarnings, call);
>        Rvsnprintf(buf, min(BUFSIZE, R_WarnLength+1), format, ap);
>        if(R_WarnLength < BUFSIZE - 20 && strlen(buf) == R_WarnLength)
>
> This fix eliminates the "Invalid read" errors, but I'm unsure if it
> fixes my application. I'll find out tomorrow.
>
> Jeff
>

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel