Re: [Rd] [R-sig-hpc] doMC - compiler - concatenate an expression vector into a single expression?

2011-06-29 Thread Renaud Gaujoux

Thank you very much Steve.
Your suggestion works perfectly -- at least with doSEQ, doMC and doMPI.

Bests,
Renaud


On 28/06/2011 15:35, Stephen Weston wrote:

I think that the result of the concatenation should be a call object,
rather than an expression object.  How about something along the
lines of:

'%dopar2%'- function(obj, ex) {
   ex- as.call(list(as.name('{'),
   quote({ a- i; message(Custom , a) }),
   substitute(ex)))
   do.call('%dopar%', list(obj, ex), envir=parent.frame())
}

- Steve


On Tue, Jun 28, 2011 at 8:26 AM, Renaud Gaujoux
ren...@mancala.cbio.uct.ac.za  wrote:

Hi,

this post is about foreach operators, the compiler package and the last
update of doMC that includes support for the compiler functionality.

I am using a home-made %dopar%-like operator that adds some custom
expression to be executed before the foreach loop expression itself (see
sample code below).
It used to work perfectly with doMC 1.2.1, but with the introduction of
the compiler functionality, things do not work properly.
The change in the doMC package consists in evaluating a compiled
expression instead of the original R expression:

# from doMC:::doMC ...
c.expr- comp(expr, env = envir, options = list(suppressUndefined = TRUE))

and for R= 2.13.0 comp is defined as compiler::compile:
function (e, env = .GlobalEnv, options = NULL)
{
cenv- makeCenv(env)
cntxt- make.toplevelContext(cenv, options)
cntxt$env- addCenvVars(cenv, findLocals(e, cntxt))
genCode(e, cntxt)
}
environment: namespace:compiler

My guess is that the function findLocals or genCode can not handle a
2-length expression vector.

Maybe somebody who knows the internals of these functions could explain
better this behaviour?
How can I concatenate two expressions into a single one?

Thank you,
Renaud


##
# Sample code
##

`%dopar2%`- function(obj, ex){

# append custom code to the expression
ex- c(expression({ a- i; message(Custom , a);}), substitute(ex))

# call the standard %dopar% operator
do.call(`%dopar%`, list(obj, ex), envir=parent.frame() )
}
res- foreach(i=1:3) %dopar2% { print(i); i*2; }
res


#
# Output with doSEQ or doMC 1.2.1
#
Custom 1
[1] 1
Custom 2
[1] 2
Custom 3
[1] 3

  res

[[1]]
[1] 2

[[2]]
[1] 4

[[3]]
[1] 6


#
# Output with doMC 1.2.2
#

[[1]]
expression({
a- i
message(Custom , a)
}, {
print(i)
i * 2
})

[[2]]
expression({
a- i
message(Custom , a)
}, {
print(i)
i * 2
})

[[3]]
expression({
a- i
message(Custom , a)
}, {
print(i)
i * 2
})





###
UNIVERSITY OF CAPE TOWN
This e-mail is subject to the UCT ICT policies and e-mai...{{dropped:5}}

___
R-sig-hpc mailing list
r-sig-...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-hpc





###
UNIVERSITY OF CAPE TOWN 


This e-mail is subject to the UCT ICT policies and e-mai...{{dropped:5}}

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


[Rd] Compilation error Mac binary

2011-06-29 Thread soeren . vogel
Hello, the compilation of the GUTS package on CRAN for Mac produces the 
following error messages:

http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/GUTS-00install.html

I guess it is some namespace collision, but I can not reproduce it on my 
machine, it compiles fine here. What is the cause and which setup do I need to 
reproduce the errors?

R: version
platform   i386-apple-darwin9.8.0
arch   i386
os darwin9.8.0
system i386, darwin9.8.0
status
major  2
minor  13.0
year   2011
month  04
day13
svn rev55427
language   R
version.string R version 2.13.0 (2011-04-13)

I ~ $: gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I ~ $: less /opt/local/include/boost/version.hpp
//  Boost version.hpp configuration header file  
--//
[...]
#define BOOST_VERSION 104601
#define BOOST_LIB_VERSION 1_46_1
[...]

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


Re: [Rd] R-devel Digest, Vol 100, Issue 28

2011-06-29 Thread John Maindonald
I get the same style of path as Hadley.  This is on Windows 7 Home Premium with 
SP1.
I start R by clicking on the R-2.31.0 icon.

I'd assumed that it was a change that came with R-2.13.0!
(On 32-bit Windows XP, which I have just checked, I do indeed get the 8.3 
paths.)

 R.home()
[1] C:/Programs/R/R-2.13.0
 sessionInfo()
R version 2.13.0 (2011-04-13)
Platform: x86_64-pc-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_Australia.1252 
[2] LC_CTYPE=English_Australia.1252   
[3] LC_MONETARY=English_Australia.1252
[4] LC_NUMERIC=C  
[5] LC_TIME=English_Australia.1252

attached base packages:
[1] stats graphics  grDevices utils datasets 
[6] methods   base 

John Maindonald email: john.maindon...@anu.edu.au
phone : +61 2 (6125)3473fax  : +61 2(6125)5549
Centre for Mathematics  Its Applications, Room 1194,
John Dedman Mathematical Sciences Building (Building 27)
Australian National University, Canberra ACT 0200.
http://www.maths.anu.edu.au/~johnm

 From: Duncan Murdoch murdoch.dun...@gmail.com
 Date: 29 June 2011 10:17:46 AM AEST
 To: Hadley Wickham had...@rice.edu
 Cc: Simon Urbanek simon.urba...@r-project.org, r-devel@r-project.org
 Subject: Re: [Rd] Small bug in install.packages?
 
 
 On 28/06/2011 5:42 PM, Hadley Wickham wrote:
 Isn't R.home() 8.3 path anyway?
 
 I don't think so:
 
 R.home(bin)
 [1] C:/Program Files/R/R-2.13.0/bin/i386
 
 Weird.  Like others, I see 8.3 pathnames.  R gets those from a Windows call; 
 what version of Windows are you using?
 
 Duncan Murdoch
 


[[alternative HTML version deleted]]

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


Re: [Rd] Compilation error Mac binary

2011-06-29 Thread David Winsemius


On Jun 29, 2011, at 5:33 AM, soeren.vo...@uzh.ch wrote:

Hello, the compilation of the GUTS package on CRAN for Mac produces  
the following error messages:


http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/GUTS-00install.html

I guess it is some namespace collision, but I can not reproduce it  
on my machine, it compiles fine here. What is the cause and which  
setup do I need to reproduce the errors?



I was going to suggest you take this up with the maintainers... but  
you _are_ one of the maintainers.


Here is the output from an attempt to compile from source, version  
0.1.45, with a relatively recent version of R 2.13.0 (but not the most  
recent and I still use Mac OSX 10.5.8). Perhaps its brevity will be  
helpful, and the fact that it seems to identify different error than  
those flagged in the log at CRAN.


trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/GUTS_0.1.45.tar.gz'
Content type 'application/x-gzip' length 9842 bytes
opened URL
==
downloaded 9842 bytes

Loading required package: lattice
Loading required package: sos
Loading required package: brew
[1] 2011-06-29 09:40:18 EDT
* installing *source* package ‘GUTS’ ...
** libs
*** arch - i386
g++ -arch i386 -I/Library/Frameworks/R.framework/Resources/include -I/ 
Library/Frameworks/R.framework/Resources/include/i386 -I/opt/local/ 
include -I/usr/local/include -I/Library/Frameworks/R.framework/ 
Versions/2.13/Resources/library/Rcpp/include   -fPIC  -g -O2 -c  
GUTS.cpp -o GUTS.o

In file included from GUTS.cpp:12:
GUTS.h:21:28: error: boost/random.hpp: No such file or directory
GUTS.h:22:40: error: boost/math/distributions.hpp: No such file or  
directory

GUTS.cpp: In function ‘void to_print(double)’:
GUTS.cpp:277: error: ‘cout’ was not declared in this scope
GUTS.cpp: In member function ‘void GUTS::showObject()’:
GUTS.cpp:281: error: ‘cout’ is not a member of ‘std’
GUTS.cpp:284: error: ‘cout’ was not declared in this scope
make: *** [GUTS.o] Error 1
ERROR: compilation failed for package ‘GUTS’
* removing ‘/Library/Frameworks/R.framework/Versions/2.13/Resources/ 
library/GUTS’


 sessionInfo()
R version 2.13.0 beta (2011-04-04 r55296)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

other attached packages:
[1] mgcv_1.7-6  sos_1.3-0   brew_1.0-6  lattice_0.19-26

loaded via a namespace (and not attached):
[1] grid_2.13.0Matrix_0.999375-50 nlme_3.1-101
tools_2.13.0


--
David.




R: version
platform   i386-apple-darwin9.8.0
arch   i386
os darwin9.8.0
system i386, darwin9.8.0
status
major  2
minor  13.0
year   2011
month  04
day13
svn rev55427
language   R
version.string R version 2.13.0 (2011-04-13)

I ~ $: gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666)  
(dot 3)

Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There  
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR  
PURPOSE.


I ~ $: less /opt/local/include/boost/version.hpp
//  Boost version.hpp configuration header file   
--//

[...]
#define BOOST_VERSION 104601
#define BOOST_LIB_VERSION 1_46_1
[...]

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


David Winsemius, MD
West Hartford, CT

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


Re: [Rd] Compilation error Mac binary

2011-06-29 Thread soeren . vogel
Hello David

On 29.06.2011, at 15:56, David Winsemius wrote:

 On Jun 29, 2011, at 5:33 AM, soeren.vo...@uzh.ch wrote:
 
 Hello, the compilation of the GUTS package on CRAN for Mac produces the 
 following error messages:
 
 http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/GUTS-00install.html
 
 I guess it is some namespace collision, but I can not reproduce it on my 
 machine, it compiles fine here. What is the cause and which setup do I need 
 to reproduce the errors?
 
 I was going to suggest you take this up with the maintainers... but you _are_ 
 one of the maintainers.

:-)

 Here is the output from an attempt to compile from source, version 0.1.45, 
 with a relatively recent version of R 2.13.0 (but not the most recent and I 
 still use Mac OSX 10.5.8). Perhaps its brevity will be helpful, and the fact 
 that it seems to identify different error than those flagged in the log at 
 CRAN.

Thanks for your answer. The failure on your side is clear to me: there is no 
installation of the boost C++ library in any of the standard include locations. 
I have added /opt/local/include in Makevars (Mac Ports installation of C source 
packages), however, I know I should but still I am reluctant to write a 
configure script that could circumvent non-standard installations of boost on 
UNIX machines.

So thanks for the output, but the CRAN messages must point to something 
different...

Regards
Sören

 trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/GUTS_0.1.45.tar.gz'
 Content type 'application/x-gzip' length 9842 bytes
 opened URL
 ==
 downloaded 9842 bytes
 
 Loading required package: lattice
 Loading required package: sos
 Loading required package: brew
 [1] 2011-06-29 09:40:18 EDT
 * installing *source* package ‘GUTS’ ...
 ** libs
 *** arch - i386
 g++ -arch i386 -I/Library/Frameworks/R.framework/Resources/include 
 -I/Library/Frameworks/R.framework/Resources/include/i386 -I/opt/local/include 
 -I/usr/local/include 
 -I/Library/Frameworks/R.framework/Versions/2.13/Resources/library/Rcpp/include
-fPIC  -g -O2 -c GUTS.cpp -o GUTS.o
 In file included from GUTS.cpp:12:
 GUTS.h:21:28: error: boost/random.hpp: No such file or directory
 GUTS.h:22:40: error: boost/math/distributions.hpp: No such file or directory
 GUTS.cpp: In function ‘void to_print(double)’:
 GUTS.cpp:277: error: ‘cout’ was not declared in this scope
 GUTS.cpp: In member function ‘void GUTS::showObject()’:
 GUTS.cpp:281: error: ‘cout’ is not a member of ‘std’
 GUTS.cpp:284: error: ‘cout’ was not declared in this scope
 make: *** [GUTS.o] Error 1
 ERROR: compilation failed for package ‘GUTS’
 * removing 
 ‘/Library/Frameworks/R.framework/Versions/2.13/Resources/library/GUTS’
 
  sessionInfo()
 R version 2.13.0 beta (2011-04-04 r55296)
 Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
 
 locale:
 [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
 
 attached base packages:
 [1] stats graphics  grDevices utils datasets  methods   base
 
 other attached packages:
 [1] mgcv_1.7-6  sos_1.3-0   brew_1.0-6  lattice_0.19-26
 
 loaded via a namespace (and not attached):
 [1] grid_2.13.0Matrix_0.999375-50 nlme_3.1-101   tools_2.13.0
 
 -- 
 David.
 
 
 
 R: version
 platform   i386-apple-darwin9.8.0
 arch   i386
 os darwin9.8.0
 system i386, darwin9.8.0
 status
 major  2
 minor  13.0
 year   2011
 month  04
 day13
 svn rev55427
 language   R
 version.string R version 2.13.0 (2011-04-13)
 
 I ~ $: gcc --version
 i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
 Copyright (C) 2007 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 I ~ $: less /opt/local/include/boost/version.hpp
 //  Boost version.hpp configuration header file  
 --//
 [...]
 #define BOOST_VERSION 104601
 #define BOOST_LIB_VERSION 1_46_1
 [...]
 
 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel
 
 David Winsemius, MD
 West Hartford, CT
 
 

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


[Rd] Ref Classes: bug with using '.self' within initialize methods?

2011-06-29 Thread Janko Thyson
Dear list,

I'm wondering if the following error I'm getting is a small bug in the 
Reference Class paradigm or if it makes perfect sense.

When you write an explicit initialize method for a Ref Class, can you 
then make use of '.self' WITHIN this initialize method just as you would 
once an object of the class has actually been initialized?
Because it seems to me that you can not.

Below is an example that shows that calling '.self$someInitFoo()' within 
the initialize method for 'MyClass' does not work (see section METHODS 
in example below). Instead I have to go with 
'someInitFooRefInner(.self=.Object, ...)' (see section UPDATED METHOD 
in example below). Yet, this is only possible because there actually IS 
such a method (I try to stick to the recommendations at ?setRefClass 
where it says: Reference methods should be kept simple; if they need to 
do some specialized *R* computation, that computation should use a 
separate *R* function that is called from the reference method)

The same problem occurs when, say 'someInitFoo()' calls yet another Ref 
Class method (as is the case in the example below with a call to 
'.self$someFoo()').

Is this a desired behavior?

Thanks for any clarifying comments!
Janko

# CODE EXAMPLE #

# CLASSES
setRefClass(
 Class=MyVirtual,
 contains=c(VIRTUAL),
 methods=list(
 initialize=function(...){
 callSuper(...)
 return(.self)
 },
 someInitFoo=function(flds, ...){
 someInitFooRefInner(
 .self=.self,
 flds=flds
 )
 }
 )
)
GENERATOR - setRefClass(
 Class=MyClass,
 contains=c(MyVirtual),
 fields=list(
 A=character,
 B=numeric
 ),
 methods=list(
 someFoo=function(...){
 someFooRefInner(.self=.self, ...)
 }
 )
)
# /

# GENERICS
setGeneric(name=someInitFooRefInner,
 def=function(.self, ...) standardGeneric(someInitFooRefInner),
 signature=c(.self)
)
setGeneric(name=someFooRefInner,
 def=function(.self, ...) standardGeneric(someFooRefInner),
 signature=c(.self)
)
# /

# METHODS
setMethod(
 f=someInitFooRefInner,
 signature=signature(.self=MyVirtual),
 definition=function(.self, flds, ...){
 print(Trying to call '.self$someFoo())
 try(.self$someFoo())
 print(Trying to call 'someFooRefInner(.self=.self))
 try(someFooRefInner(.self=.self))
 return(flds)
 }
)
setMethod(
 f=someFooRefInner,
 signature=signature(.self=MyVirtual),
 definition=function(.self, ...){
 print(hello world!)
 }
)
setMethod(
 f=initialize,
 signature=signature(.Object=MyVirtual),
 definition=function(.Object, GENERATOR=NULL, ...){
 # MESSAGE
 if(class(.Object) == MyVirtual){
 cat(paste(initializing object of class ', class(.Object), 
',
 sep=), sep=\n)
 } else {
 cat(paste(initializig object of class', class(.Object),
 ' inheriting from class 'MyVirtual', sep=), sep=\n)
 }
 # /
 # GET GENERATOR OBJECT
 if(is.null(GENERATOR)){
 GENERATOR - getRefClass(class(.Object))
 }
 flds - names(GENERATOR$fields())
 .Object$someInitFoo(
 flds=flds,
 ...
 )
 return(.Object)
 }
)
# /

x - GENERATOR$new()

# UPDATED METHOD
setMethod(
 f=initialize,
 signature=signature(.Object=MyVirtual),
 definition=function(.Object, GENERATOR=NULL, ...){
 # MESSAGE
 if(class(.Object) == MyVirtual){
 cat(paste(initializing object of class ', class(.Object), 
',
 sep=), sep=\n)
 } else {
 cat(paste(initializig object of class', class(.Object),
 ' inheriting from class 'MyVirtual', sep=), 
sep=\n)
 }
 # /
 # GET GENERATOR OBJECT
 if(is.null(GENERATOR)){
 GENERATOR - getRefClass(class(.Object))
 }
 flds - names(GENERATOR$fields())
 someInitFooRefInner(.self=.Object, flds=flds, ...)
 return(.Object)
 }
)
# /

x - GENERATOR$new()

[[alternative HTML version deleted]]

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


Re: [Rd] Small bug in install.packages?

2011-06-29 Thread Hadley Wickham
 R.home(bin)

 [1] C:/Program Files/R/R-2.13.0/bin/i386

 Weird.  Like others, I see 8.3 pathnames.  R gets those from a Windows
 call; what version of Windows are you using?

 ... and how are you starting R?  Startup goes through some contortions to
 handle all the different possibilities; maybe one of them is missing the
 path-shortening step.

Ok, this was coming from R running within eclipse, via rj.  (This is
not my setup, but a collaborator's)

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

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


Re: [Rd] R-devel Digest, Vol 100, Issue 28

2011-06-29 Thread Uwe Ligges



On 29.06.2011 13:41, John Maindonald wrote:

I get the same style of path as Hadley.  This is on Windows 7 Home Premium with 
SP1.
I start R by clicking on the R-2.31.0 icon.

I'd assumed that it was a change that came with R-2.13.0!
(On 32-bit Windows XP, which I have just checked, I do indeed get the 8.3 
paths.)


R.home()

[1] C:/Programs/R/R-2.13.0



No, you got the same as Duncan: This is 8.3 compatible.

Uwe



sessionInfo()

R version 2.13.0 (2011-04-13)
Platform: x86_64-pc-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_Australia.1252
[2] LC_CTYPE=English_Australia.1252
[3] LC_MONETARY=English_Australia.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252

attached base packages:
[1] stats graphics  grDevices utils datasets
[6] methods   base

John Maindonald email: john.maindon...@anu.edu.au
phone : +61 2 (6125)3473fax  : +61 2(6125)5549
Centre for Mathematics  Its Applications, Room 1194,
John Dedman Mathematical Sciences Building (Building 27)
Australian National University, Canberra ACT 0200.
http://www.maths.anu.edu.au/~johnm


From: Duncan Murdochmurdoch.dun...@gmail.com
Date: 29 June 2011 10:17:46 AM AEST
To: Hadley Wickhamhad...@rice.edu
Cc: Simon Urbaneksimon.urba...@r-project.org, r-devel@r-project.org
Subject: Re: [Rd] Small bug in install.packages?


On 28/06/2011 5:42 PM, Hadley Wickham wrote:

Isn't R.home() 8.3 path anyway?


I don't think so:


R.home(bin)

[1] C:/Program Files/R/R-2.13.0/bin/i386


Weird.  Like others, I see 8.3 pathnames.  R gets those from a Windows call; 
what version of Windows are you using?

Duncan Murdoch




[[alternative HTML version deleted]]

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


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


Re: [Rd] Compilation error Mac binary

2011-06-29 Thread Uwe Ligges

Looks like a different boost version than the one you require.
I'd suggest to talk to the Mac maintainer, Simon Urbanek (CCing).

Best,
Uwe Ligges





On 29.06.2011 17:14, soeren.vo...@uzh.ch wrote:

Hello David

On 29.06.2011, at 15:56, David Winsemius wrote:


On Jun 29, 2011, at 5:33 AM, soeren.vo...@uzh.ch wrote:


Hello, the compilation of the GUTS package on CRAN for Mac produces the 
following error messages:

http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/GUTS-00install.html

I guess it is some namespace collision, but I can not reproduce it on my 
machine, it compiles fine here. What is the cause and which setup do I need to 
reproduce the errors?


I was going to suggest you take this up with the maintainers... but you _are_ 
one of the maintainers.


:-)


Here is the output from an attempt to compile from source, version 0.1.45, with 
a relatively recent version of R 2.13.0 (but not the most recent and I still 
use Mac OSX 10.5.8). Perhaps its brevity will be helpful, and the fact that it 
seems to identify different error than those flagged in the log at CRAN.


Thanks for your answer. The failure on your side is clear to me: there is no 
installation of the boost C++ library in any of the standard include locations. 
I have added /opt/local/include in Makevars (Mac Ports installation of C source 
packages), however, I know I should but still I am reluctant to write a 
configure script that could circumvent non-standard installations of boost on 
UNIX machines.

So thanks for the output, but the CRAN messages must point to something 
different...

Regards
Sören


trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/GUTS_0.1.45.tar.gz'
Content type 'application/x-gzip' length 9842 bytes
opened URL
==
downloaded 9842 bytes

Loading required package: lattice
Loading required package: sos
Loading required package: brew
[1] 2011-06-29 09:40:18 EDT
* installing *source* package ‘GUTS’ ...
** libs
*** arch - i386
g++ -arch i386 -I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/i386 -I/opt/local/include 
-I/usr/local/include 
-I/Library/Frameworks/R.framework/Versions/2.13/Resources/library/Rcpp/include
   -fPIC  -g -O2 -c GUTS.cpp -o GUTS.o
In file included from GUTS.cpp:12:
GUTS.h:21:28: error: boost/random.hpp: No such file or directory
GUTS.h:22:40: error: boost/math/distributions.hpp: No such file or directory
GUTS.cpp: In function ‘void to_print(double)’:
GUTS.cpp:277: error: ‘cout’ was not declared in this scope
GUTS.cpp: In member function ‘void GUTS::showObject()’:
GUTS.cpp:281: error: ‘cout’ is not a member of ‘std’
GUTS.cpp:284: error: ‘cout’ was not declared in this scope
make: *** [GUTS.o] Error 1
ERROR: compilation failed for package ‘GUTS’
* removing 
‘/Library/Frameworks/R.framework/Versions/2.13/Resources/library/GUTS’


sessionInfo()

R version 2.13.0 beta (2011-04-04 r55296)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

other attached packages:
[1] mgcv_1.7-6  sos_1.3-0   brew_1.0-6  lattice_0.19-26

loaded via a namespace (and not attached):
[1] grid_2.13.0Matrix_0.999375-50 nlme_3.1-101   tools_2.13.0

--
David.




R: version
platform   i386-apple-darwin9.8.0
arch   i386
os darwin9.8.0
system i386, darwin9.8.0
status
major  2
minor  13.0
year   2011
month  04
day13
svn rev55427
language   R
version.string R version 2.13.0 (2011-04-13)

I ~ $: gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I ~ $: less /opt/local/include/boost/version.hpp
//  Boost version.hpp configuration header file  
--//
[...]
#define BOOST_VERSION 104601
#define BOOST_LIB_VERSION 1_46_1
[...]

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


David Winsemius, MD
West Hartford, CT




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


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


Re: [Rd] R-devel Digest, Vol 100, Issue 28

2011-06-29 Thread Duncan Murdoch

On 29/06/2011 1:09 PM, Uwe Ligges wrote:


On 29.06.2011 13:41, John Maindonald wrote:
  I get the same style of path as Hadley.  This is on Windows 7 Home Premium 
with SP1.
  I start R by clicking on the R-2.31.0 icon.

  I'd assumed that it was a change that came with R-2.13.0!
  (On 32-bit Windows XP, which I have just checked, I do indeed get the 8.3 
paths.)

  R.home()
  [1] C:/Programs/R/R-2.13.0


No, you got the same as Duncan: This is 8.3 compatible.



Yes, that's right.  The documentation is pretty inaccurate.  What 
actually is supposed to happen is that you get the actual path, with 
forward slashes in it, unless it contains spaces:  then you get the 8.3 
version.  So John's path has no spaces, and doesn't get converted to 
8.3.  True 8.3 would also have uppercase PROGRAMS, and only one dot in 
R-2.13.0 (I forget how that is converted).


Duncan Murdoch

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


Re: [Rd] R CMD check --force-multiarch does not install all the archs for testing

2011-06-29 Thread Uwe Ligges



On 28.06.2011 23:11, Hervé Pagès wrote:

Simon,

On 11-06-28 01:44 PM, Simon Urbanek wrote:


On Jun 28, 2011, at 3:45 PM, Hervé Pagès wrote:


Hi Simon,

On 11-06-28 12:19 PM, Simon Urbanek wrote:


On Jun 28, 2011, at 3:01 PM, Hervé Pagès wrote:


Hi Uwe,

On 11-06-28 01:44 AM, Uwe Ligges wrote:



On 28.06.2011 01:31, Hervé Pagès wrote:

Hi,

Why isn't 'R CMD check --force-multiarch' installing the package
for all the architectures that are going to be checked?


Hervé,

no, since it cannot know that that you need

--merge-multiarch

as an additional install flag for this particular package.


Why not just use this flag anyway? Does it hurt to use it on
packages that don't strictly need it?



It does for two reasons: a) everything is built twice


That's exactly what I want when I do 'R CMD check --force-multiarch'



No, that's not what it does (and I assume you mean --force-biarch). It
builds the package just once, you're simply overriding the default
behavior of checking for configure.win, that's all. The two flags are
orthogonal, --force-biarch makes no sense with --merge-multiarch, they
are for all practical purposes mutually exclusive by definition of
what they do.


I really mean --force-multiarch, not --force-biarch. AFAIK 'R CMD check'
has no --force-biarch option.





and b) package authors don't expect the necessity to support
--libs-only if the package doesn't require separate build runs.


When specifying --force-multiarch, the user really expects the
package to be installed for all sub-archs.



... with the assumption that the package supports it even though it
has a configure script which may to may not work unlike
--merge-multiarch which will always work.


Just to clarify:

--force-multiarch is an 'R CMD check' option, not an 'R CMD INSTALL'
option

--merge-multiarch is an 'R CMD INSTALL' option, not an 'R CMD check'
option

Now you are saying that --merge-multiarch will always work (on Windows
of course, all this discussion is about how to achieve multiarch check
on Windows). Great, this is what I've been observing too so far!



It does not always work, unfortunately. We need force-biarch on CRAN for:

RGtk2
rgdal
rphast
SQLiteMap




On packages with or without native codes, with or without configure.win
scripts, etc... It always seems to work. So, again, why isn't
'R CMD check --force-multiarch' installing with --merge-multiarch?
Note that I'm not attached to that solution in particular, just trying
to suggest an easy fix for 'R CMD check --force-multiarch' (which right
now is broken on some packages).


Well, merge-multiarch will result in small overhead. It will try to 
compile the code in ./src  for the other architecture and merge that 
into the same package. For packages without any compiled code, it does 
not make sense to ask R to do that since the packages are identical 
under 32-bit and 64-bit, hence you don't want the overhead. For packages 
that include compiled code, you still do not want it, since R does it 
automatically - unless there is a configure.win file.


Therefore, the option is just an add on that is necessary for only 18 
out of roughly 3000 CRAN packages.


So we have 4 packages that require --force-biarch and 18 requiring 
--merge-multiarch on CRAN. All the others build automatically for both 
architectures if they need to. So no reason to do that all the time.


Best wishes,
Uwe




--force-biarch is just a way to flag packages that have configure.win
that has no effect on the binary settings (flags etc.). It forces R to
try multi-arch build in one flight, but it may or may not work
depending on the package. It is a way to save time by not running
--merge-multiarch (and thus building the package twice).


--force-biarch is an 'R CMD INSTALL' option that I don't use. Why would
I use something that might fail when I can use --merge-multiarch which
always works.



Thanks,
H.



Cheers,
Simon




The cross-platform way is to not use --merge-multiarch but use
--libs-only instead as needed (easy to check after the first arch
run which will tell you whether it's needed or not). I suspect that
--merge-multiarch is just a convenience shortcut (and it's unclear
to me why it's Windows-only...).


A great convenience indeed as it allows to do the multiarch install in
a single step. And it's unclear to me too why it's Windows-only but I
would have hoped you would know...

Thanks,
H.




Cheers,
Simon



You will have to check it in repository maintainer's mode (as the
CRAN
maintainers do everywhere). Essentially this is for me (when also
producing WIndows binaries):


Step 1: Installation

R CMD INSTALL --pkglock --compact-docs --build --merge-multiarch
--library=D:/path/to/library fabia_1.5.0.tar.gz
fabia-install.out 21

(where the merge-multiarch part applies only to this package, of
course)



Step 2: Check (without installation, since that happened before
already,
using the install log from step 1)

R CMD check --library=D:/path/to/library --force-multiarch

Re: [Rd] Compilation error Mac binary

2011-06-29 Thread Simon Urbanek

On Jun 29, 2011, at 1:12 PM, Uwe Ligges wrote:

 Looks like a different boost version than the one you require.
 I'd suggest to talk to the Mac maintainer, Simon Urbanek (CCing).
 

GUTS doesn't specify any system requirements, so obviously it has no business 
trying to use boost from the system. Also note boost is inlined in the vast 
majority of cases, so most packages simply supply the headers inside as to 
guarantee the required version is used (which I would certainly expect GUTS to 
do since it doesn't depend on boost according to the DESCRIPTION).

Cheers,
Simon


 
 On 29.06.2011 17:14, soeren.vo...@uzh.ch wrote:
 Hello David
 
 On 29.06.2011, at 15:56, David Winsemius wrote:
 
 On Jun 29, 2011, at 5:33 AM, soeren.vo...@uzh.ch wrote:
 
 Hello, the compilation of the GUTS package on CRAN for Mac produces the 
 following error messages:
 
 http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/GUTS-00install.html
 
 I guess it is some namespace collision, but I can not reproduce it on my 
 machine, it compiles fine here. What is the cause and which setup do I 
 need to reproduce the errors?
 
 I was going to suggest you take this up with the maintainers... but you 
 _are_ one of the maintainers.
 
 :-)
 
 Here is the output from an attempt to compile from source, version 0.1.45, 
 with a relatively recent version of R 2.13.0 (but not the most recent and I 
 still use Mac OSX 10.5.8). Perhaps its brevity will be helpful, and the 
 fact that it seems to identify different error than those flagged in the 
 log at CRAN.
 
 Thanks for your answer. The failure on your side is clear to me: there is no 
 installation of the boost C++ library in any of the standard include 
 locations. I have added /opt/local/include in Makevars (Mac Ports 
 installation of C source packages), however, I know I should but still I am 
 reluctant to write a configure script that could circumvent non-standard 
 installations of boost on UNIX machines.
 
 So thanks for the output, but the CRAN messages must point to something 
 different...
 
 Regards
 Sören
 
 trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/GUTS_0.1.45.tar.gz'
 Content type 'application/x-gzip' length 9842 bytes
 opened URL
 ==
 downloaded 9842 bytes
 
 Loading required package: lattice
 Loading required package: sos
 Loading required package: brew
 [1] 2011-06-29 09:40:18 EDT
 * installing *source* package ‘GUTS’ ...
 ** libs
 *** arch - i386
 g++ -arch i386 -I/Library/Frameworks/R.framework/Resources/include 
 -I/Library/Frameworks/R.framework/Resources/include/i386 
 -I/opt/local/include -I/usr/local/include 
 -I/Library/Frameworks/R.framework/Versions/2.13/Resources/library/Rcpp/include
-fPIC  -g -O2 -c GUTS.cpp -o GUTS.o
 In file included from GUTS.cpp:12:
 GUTS.h:21:28: error: boost/random.hpp: No such file or directory
 GUTS.h:22:40: error: boost/math/distributions.hpp: No such file or directory
 GUTS.cpp: In function ‘void to_print(double)’:
 GUTS.cpp:277: error: ‘cout’ was not declared in this scope
 GUTS.cpp: In member function ‘void GUTS::showObject()’:
 GUTS.cpp:281: error: ‘cout’ is not a member of ‘std’
 GUTS.cpp:284: error: ‘cout’ was not declared in this scope
 make: *** [GUTS.o] Error 1
 ERROR: compilation failed for package ‘GUTS’
 * removing 
 ‘/Library/Frameworks/R.framework/Versions/2.13/Resources/library/GUTS’
 
 sessionInfo()
 R version 2.13.0 beta (2011-04-04 r55296)
 Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
 
 locale:
 [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
 
 attached base packages:
 [1] stats graphics  grDevices utils datasets  methods   base
 
 other attached packages:
 [1] mgcv_1.7-6  sos_1.3-0   brew_1.0-6  lattice_0.19-26
 
 loaded via a namespace (and not attached):
 [1] grid_2.13.0Matrix_0.999375-50 nlme_3.1-101   tools_2.13.0
 
 --
 David.
 
 
 
 R: version
 platform   i386-apple-darwin9.8.0
 arch   i386
 os darwin9.8.0
 system i386, darwin9.8.0
 status
 major  2
 minor  13.0
 year   2011
 month  04
 day13
 svn rev55427
 language   R
 version.string R version 2.13.0 (2011-04-13)
 
 I ~ $: gcc --version
 i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
 Copyright (C) 2007 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 I ~ $: less /opt/local/include/boost/version.hpp
 //  Boost version.hpp configuration header file  
 --//
 [...]
 #define BOOST_VERSION 104601
 #define BOOST_LIB_VERSION 1_46_1
 [...]
 
 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel
 
 David Winsemius, MD
 West Hartford, CT
 
 
 
 __
 

Re: [Rd] R-devel Digest, Vol 100, Issue 28

2011-06-29 Thread Duncan Murdoch

On 29/06/2011 1:44 PM, Duncan Murdoch wrote:

On 29/06/2011 1:09 PM, Uwe Ligges wrote:

  On 29.06.2011 13:41, John Maindonald wrote:
 I get the same style of path as Hadley.  This is on Windows 7 Home 
Premium with SP1.
 I start R by clicking on the R-2.31.0 icon.
  
 I'd assumed that it was a change that came with R-2.13.0!
 (On 32-bit Windows XP, which I have just checked, I do indeed get the 
8.3 paths.)
  
 R.home()
 [1] C:/Programs/R/R-2.13.0


  No, you got the same as Duncan: This is 8.3 compatible.


Yes, that's right.  The documentation is pretty inaccurate.  What
actually is supposed to happen is that you get the actual path, with
forward slashes in it, unless it contains spaces:  then you get the 8.3
version.  So John's path has no spaces, and doesn't get converted to
8.3.  True 8.3 would also have uppercase PROGRAMS, and only one dot in
R-2.13.0 (I forget how that is converted).


I've now clarified the help page.  R.home() just looks up the 
environment variable R_HOME, and then possibly adds some subdir to it.
If your front end (e.g. Hadley's rj/Eclipse setup) doesn't initialize 
R_HOME properly, then you'll get whatever it put there.  You can also 
mess with it using Sys.setenv(R_HOME=junk).


Duncan Murdoch

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


Re: [Rd] Compilation error Mac binary

2011-06-29 Thread Simon Urbanek
BTW: the build result is at

http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/GUTS-00install.html

so you may want to have a look. I'm not a C++ expert so you may want to ask on 
the Rcpp list since it appears to be some issue triggered by Rcpp includes - as 
if boost and tr1 and somehow define the same things but differently ... Since 
Dirk uses the same boost (1.43 here) successfully in QuantLib he may know more 
...

Cheers,
Simon


On Jun 29, 2011, at 2:05 PM, Simon Urbanek wrote:

 
 On Jun 29, 2011, at 1:12 PM, Uwe Ligges wrote:
 
 Looks like a different boost version than the one you require.
 I'd suggest to talk to the Mac maintainer, Simon Urbanek (CCing).
 
 
 GUTS doesn't specify any system requirements, so obviously it has no business 
 trying to use boost from the system. Also note boost is inlined in the vast 
 majority of cases, so most packages simply supply the headers inside as to 
 guarantee the required version is used (which I would certainly expect GUTS 
 to do since it doesn't depend on boost according to the DESCRIPTION).
 
 Cheers,
 Simon
 
 
 
 On 29.06.2011 17:14, soeren.vo...@uzh.ch wrote:
 Hello David
 
 On 29.06.2011, at 15:56, David Winsemius wrote:
 
 On Jun 29, 2011, at 5:33 AM, soeren.vo...@uzh.ch wrote:
 
 Hello, the compilation of the GUTS package on CRAN for Mac produces the 
 following error messages:
 
 http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/GUTS-00install.html
 
 I guess it is some namespace collision, but I can not reproduce it on my 
 machine, it compiles fine here. What is the cause and which setup do I 
 need to reproduce the errors?
 
 I was going to suggest you take this up with the maintainers... but you 
 _are_ one of the maintainers.
 
 :-)
 
 Here is the output from an attempt to compile from source, version 0.1.45, 
 with a relatively recent version of R 2.13.0 (but not the most recent and 
 I still use Mac OSX 10.5.8). Perhaps its brevity will be helpful, and the 
 fact that it seems to identify different error than those flagged in the 
 log at CRAN.
 
 Thanks for your answer. The failure on your side is clear to me: there is 
 no installation of the boost C++ library in any of the standard include 
 locations. I have added /opt/local/include in Makevars (Mac Ports 
 installation of C source packages), however, I know I should but still I am 
 reluctant to write a configure script that could circumvent non-standard 
 installations of boost on UNIX machines.
 
 So thanks for the output, but the CRAN messages must point to something 
 different...
 
 Regards
 Sören
 
 trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/GUTS_0.1.45.tar.gz'
 Content type 'application/x-gzip' length 9842 bytes
 opened URL
 ==
 downloaded 9842 bytes
 
 Loading required package: lattice
 Loading required package: sos
 Loading required package: brew
 [1] 2011-06-29 09:40:18 EDT
 * installing *source* package ‘GUTS’ ...
 ** libs
 *** arch - i386
 g++ -arch i386 -I/Library/Frameworks/R.framework/Resources/include 
 -I/Library/Frameworks/R.framework/Resources/include/i386 
 -I/opt/local/include -I/usr/local/include 
 -I/Library/Frameworks/R.framework/Versions/2.13/Resources/library/Rcpp/include
-fPIC  -g -O2 -c GUTS.cpp -o GUTS.o
 In file included from GUTS.cpp:12:
 GUTS.h:21:28: error: boost/random.hpp: No such file or directory
 GUTS.h:22:40: error: boost/math/distributions.hpp: No such file or 
 directory
 GUTS.cpp: In function ‘void to_print(double)’:
 GUTS.cpp:277: error: ‘cout’ was not declared in this scope
 GUTS.cpp: In member function ‘void GUTS::showObject()’:
 GUTS.cpp:281: error: ‘cout’ is not a member of ‘std’
 GUTS.cpp:284: error: ‘cout’ was not declared in this scope
 make: *** [GUTS.o] Error 1
 ERROR: compilation failed for package ‘GUTS’
 * removing 
 ‘/Library/Frameworks/R.framework/Versions/2.13/Resources/library/GUTS’
 
 sessionInfo()
 R version 2.13.0 beta (2011-04-04 r55296)
 Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
 
 locale:
 [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
 
 attached base packages:
 [1] stats graphics  grDevices utils datasets  methods   base
 
 other attached packages:
 [1] mgcv_1.7-6  sos_1.3-0   brew_1.0-6  lattice_0.19-26
 
 loaded via a namespace (and not attached):
 [1] grid_2.13.0Matrix_0.999375-50 nlme_3.1-101   tools_2.13.0
 
 --
 David.
 
 
 
 R: version
 platform   i386-apple-darwin9.8.0
 arch   i386
 os darwin9.8.0
 system i386, darwin9.8.0
 status
 major  2
 minor  13.0
 year   2011
 month  04
 day13
 svn rev55427
 language   R
 version.string R version 2.13.0 (2011-04-13)
 
 I ~ $: gcc --version
 i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
 Copyright (C) 2007 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 

Re: [Rd] R-devel Digest, Vol 100, Issue 28

2011-06-29 Thread Tobias Verbeke

On 06/29/2011 08:08 PM, Duncan Murdoch wrote:

On 29/06/2011 1:44 PM, Duncan Murdoch wrote:

On 29/06/2011 1:09 PM, Uwe Ligges wrote:

 On 29.06.2011 13:41, John Maindonald wrote:
  I get the same style of path as Hadley. This is on Windows 7 Home
Premium with SP1.
  I start R by clicking on the R-2.31.0 icon.
 
  I'd assumed that it was a change that came with R-2.13.0!
  (On 32-bit Windows XP, which I have just checked, I do indeed get
the 8.3 paths.)
 
  R.home()
  [1] C:/Programs/R/R-2.13.0


 No, you got the same as Duncan: This is 8.3 compatible.


Yes, that's right. The documentation is pretty inaccurate. What
actually is supposed to happen is that you get the actual path, with
forward slashes in it, unless it contains spaces: then you get the 8.3
version. So John's path has no spaces, and doesn't get converted to
8.3. True 8.3 would also have uppercase PROGRAMS, and only one dot in
R-2.13.0 (I forget how that is converted).


I've now clarified the help page. R.home() just looks up the environment
variable R_HOME, and then possibly adds some subdir to it.
If your front end (e.g. Hadley's rj/Eclipse setup) doesn't initialize
R_HOME properly, then you'll get whatever it put there. You can also


For the record, Eclipse/StatET makes use of an R_HOME variable
as set by the user (not as initialized by the front-end)
in a so called 'R Environment' under

Window  Preferences  StatET  Run/Debug  R Environments

Best,
Tobias


mess with it using Sys.setenv(R_HOME=junk).

Duncan Murdoch

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



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


Re: [Rd] Compilation error Mac binary

2011-06-29 Thread soeren . vogel
Thanks Simon, Uwe and David for your helpful answers. English is not my primary 
language, so I was hypothesising a bit about the correct interpretation of 
inlining and supply inside. I thought it meant copying the headers inside 
the package. I was already inspecting RQuantlib but I did, so far, not get 
smarter. I think I will setup a VMware OS X 10.5 with an older boost. This 
approach seems more reliable to me than just trying around with a configure 
script which, eventually, I don't understand fully. Yet, interesting that GUTS 
builds on Win and Linux, but not on the CRAN OS X. Anyway, thanks for your help.

Best
Sören


On 29.06.2011, at 20:05, Simon Urbanek wrote:


 On Jun 29, 2011, at 1:12 PM, Uwe Ligges wrote:
 
 Looks like a different boost version than the one you require.
 I'd suggest to talk to the Mac maintainer, Simon Urbanek (CCing).
 
 
 GUTS doesn't specify any system requirements, so obviously it has no business 
 trying to use boost from the system. Also note boost is inlined in the vast 
 majority of cases, so most packages simply supply the headers inside as to 
 guarantee the required version is used (which I would certainly expect GUTS 
 to do since it doesn't depend on boost according to the DESCRIPTION).
 
 Cheers,
 Simon
 
 
 
 On 29.06.2011 17:14, soeren.vo...@uzh.ch wrote:
 Hello David
 
 On 29.06.2011, at 15:56, David Winsemius wrote:
 
 On Jun 29, 2011, at 5:33 AM, soeren.vo...@uzh.ch wrote:
 
 Hello, the compilation of the GUTS package on CRAN for Mac produces the 
 following error messages:
 
 http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/GUTS-00install.html
 
 I guess it is some namespace collision, but I can not reproduce it on my 
 machine, it compiles fine here. What is the cause and which setup do I 
 need to reproduce the errors?
 
 I was going to suggest you take this up with the maintainers... but you 
 _are_ one of the maintainers.
 
 :-)
 
 Here is the output from an attempt to compile from source, version 0.1.45, 
 with a relatively recent version of R 2.13.0 (but not the most recent and 
 I still use Mac OSX 10.5.8). Perhaps its brevity will be helpful, and the 
 fact that it seems to identify different error than those flagged in the 
 log at CRAN.
 
 Thanks for your answer. The failure on your side is clear to me: there is 
 no installation of the boost C++ library in any of the standard include 
 locations. I have added /opt/local/include in Makevars (Mac Ports 
 installation of C source packages), however, I know I should but still I am 
 reluctant to write a configure script that could circumvent non-standard 
 installations of boost on UNIX machines.
 
 So thanks for the output, but the CRAN messages must point to something 
 different...
 
 Regards
 Sören
 
 trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/GUTS_0.1.45.tar.gz'
 Content type 'application/x-gzip' length 9842 bytes
 opened URL
 ==
 downloaded 9842 bytes
 
 Loading required package: lattice
 Loading required package: sos
 Loading required package: brew
 [1] 2011-06-29 09:40:18 EDT
 * installing *source* package ‘GUTS’ ...
 ** libs
 *** arch - i386
 g++ -arch i386 -I/Library/Frameworks/R.framework/Resources/include 
 -I/Library/Frameworks/R.framework/Resources/include/i386 
 -I/opt/local/include -I/usr/local/include 
 -I/Library/Frameworks/R.framework/Versions/2.13/Resources/library/Rcpp/include
-fPIC  -g -O2 -c GUTS.cpp -o GUTS.o
 In file included from GUTS.cpp:12:
 GUTS.h:21:28: error: boost/random.hpp: No such file or directory
 GUTS.h:22:40: error: boost/math/distributions.hpp: No such file or 
 directory
 GUTS.cpp: In function ‘void to_print(double)’:
 GUTS.cpp:277: error: ‘cout’ was not declared in this scope
 GUTS.cpp: In member function ‘void GUTS::showObject()’:
 GUTS.cpp:281: error: ‘cout’ is not a member of ‘std’
 GUTS.cpp:284: error: ‘cout’ was not declared in this scope
 make: *** [GUTS.o] Error 1
 ERROR: compilation failed for package ‘GUTS’
 * removing 
 ‘/Library/Frameworks/R.framework/Versions/2.13/Resources/library/GUTS’
 
 sessionInfo()
 R version 2.13.0 beta (2011-04-04 r55296)
 Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
 
 locale:
 [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
 
 attached base packages:
 [1] stats graphics  grDevices utils datasets  methods   base
 
 other attached packages:
 [1] mgcv_1.7-6  sos_1.3-0   brew_1.0-6  lattice_0.19-26
 
 loaded via a namespace (and not attached):
 [1] grid_2.13.0Matrix_0.999375-50 nlme_3.1-101   tools_2.13.0
 
 --
 David.
 
 
 
 R: version
 platform   i386-apple-darwin9.8.0
 arch   i386
 os darwin9.8.0
 system i386, darwin9.8.0
 status
 major  2
 minor  13.0
 year   2011
 month  04
 day13
 svn rev55427
 language   R
 version.string R version 2.13.0 (2011-04-13)
 
 I ~ $: gcc --version
 i686-apple-darwin10-gcc-4.2.1 

Re: [Rd] Compilation error Mac binary

2011-06-29 Thread Simon Urbanek
On Jun 29, 2011, at 2:39 PM, soeren.vo...@uzh.ch wrote:

 Thanks Simon, Uwe and David for your helpful answers. English is not my 
 primary language, so I was hypothesising a bit about the correct 
 interpretation of inlining and supply inside. I thought it meant copying 
 the headers inside the package.

Yes, that is what I meant- pick the part of boost that you use and include it 
(boost has many parts so that's another reason to do that).


 I was already inspecting RQuantlib but I did, so far, not get smarter.

The two comments were unrelated ;). I was just pointing out that Dirk has C++ 
expertise, uses boots himself and is the author of Rcpp so he may possibly know 
what the error is about.

I did not have RQuantLib in mind for you to look at the boost inclusion - 
RQuantLib needs QuantLib in addition to boost, so it is not surprising that he 
doesn't include boost inside as he has additional dependencies (and he does 
declare them correctly).


 I think I will setup a VMware OS X 10.5 with an older boost. This approach 
 seems more reliable to me than just trying around with a configure script 
 which, eventually, I don't understand fully. Yet, interesting that GUTS 
 builds on Win and Linux, but not on the CRAN OS X. Anyway, thanks for your 
 help.
 

It is a side-effect that GUTS builds at all, because the only reason it does is 
that some other package has probably required boost before. If that was not the 
case, your package would fail everywhere. [That is not the answer to the Mac 
error since the same applies - your failure to declare the dependency is masked 
by the fact that other packages do need boost. I suspect the answer will be in 
the interaction of tr1/boost/Rcpp, but your should fix GUTS regardless]

Cheers,
Simon


 
 On 29.06.2011, at 20:05, Simon Urbanek wrote:
 
 
 On Jun 29, 2011, at 1:12 PM, Uwe Ligges wrote:
 
 Looks like a different boost version than the one you require.
 I'd suggest to talk to the Mac maintainer, Simon Urbanek (CCing).
 
 
 GUTS doesn't specify any system requirements, so obviously it has no 
 business trying to use boost from the system. Also note boost is inlined in 
 the vast majority of cases, so most packages simply supply the headers 
 inside as to guarantee the required version is used (which I would certainly 
 expect GUTS to do since it doesn't depend on boost according to the 
 DESCRIPTION).
 
 Cheers,
 Simon
 
 
 
 On 29.06.2011 17:14, soeren.vo...@uzh.ch wrote:
 Hello David
 
 On 29.06.2011, at 15:56, David Winsemius wrote:
 
 On Jun 29, 2011, at 5:33 AM, soeren.vo...@uzh.ch wrote:
 
 Hello, the compilation of the GUTS package on CRAN for Mac produces the 
 following error messages:
 
 http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/GUTS-00install.html
 
 I guess it is some namespace collision, but I can not reproduce it on my 
 machine, it compiles fine here. What is the cause and which setup do I 
 need to reproduce the errors?
 
 I was going to suggest you take this up with the maintainers... but you 
 _are_ one of the maintainers.
 
 :-)
 
 Here is the output from an attempt to compile from source, version 
 0.1.45, with a relatively recent version of R 2.13.0 (but not the most 
 recent and I still use Mac OSX 10.5.8). Perhaps its brevity will be 
 helpful, and the fact that it seems to identify different error than 
 those flagged in the log at CRAN.
 
 Thanks for your answer. The failure on your side is clear to me: there is 
 no installation of the boost C++ library in any of the standard include 
 locations. I have added /opt/local/include in Makevars (Mac Ports 
 installation of C source packages), however, I know I should but still I 
 am reluctant to write a configure script that could circumvent 
 non-standard installations of boost on UNIX machines.
 
 So thanks for the output, but the CRAN messages must point to something 
 different...
 
 Regards
 Sören
 
 trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/GUTS_0.1.45.tar.gz'
 Content type 'application/x-gzip' length 9842 bytes
 opened URL
 ==
 downloaded 9842 bytes
 
 Loading required package: lattice
 Loading required package: sos
 Loading required package: brew
 [1] 2011-06-29 09:40:18 EDT
 * installing *source* package ‘GUTS’ ...
 ** libs
 *** arch - i386
 g++ -arch i386 -I/Library/Frameworks/R.framework/Resources/include 
 -I/Library/Frameworks/R.framework/Resources/include/i386 
 -I/opt/local/include -I/usr/local/include 
 -I/Library/Frameworks/R.framework/Versions/2.13/Resources/library/Rcpp/include
-fPIC  -g -O2 -c GUTS.cpp -o GUTS.o
 In file included from GUTS.cpp:12:
 GUTS.h:21:28: error: boost/random.hpp: No such file or directory
 GUTS.h:22:40: error: boost/math/distributions.hpp: No such file or 
 directory
 GUTS.cpp: In function ‘void to_print(double)’:
 GUTS.cpp:277: error: ‘cout’ was not declared in this scope
 GUTS.cpp: In member function ‘void GUTS::showObject()’:
 GUTS.cpp:281: error: ‘cout’ 

Re: [Rd] Compilation error Mac binary

2011-06-29 Thread Dirk Eddelbuettel

On 29 June 2011 at 14:17, Simon Urbanek wrote:
| BTW: the build result is at
| 
| 
http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/GUTS-00install.html
| 
| so you may want to have a look. I'm not a C++ expert so you may want to ask 
on the Rcpp list since it appears to be some issue triggered by Rcpp includes - 
as if boost and tr1 and somehow define the same things but differently ... 
Since Dirk uses the same boost (1.43 here) successfully in QuantLib he may know 
more ...

Well, I already told Soeren over there on rcpp-devel that his issues are

  a) totally homegrown (as he continues to ignore configure issues and just
 assumes things would work because they do on his),

  b) hence unrelated to Rcpp (as he just throws '#include boost/...' in his
 code without testing

  c) almost entirely solvable by copy-and-paste as e.g. my RQuantLib has a
 configure script using boost-config he could copy (but I acknowldged
 that the configure script does more and is hence not the easiest
 possible).

Now, I do admit that learning configure is a bit of a pain, but that is the
price of admission of CRAN if you use Boost -- or you choose the frequently
done but very inelegant route of copying all your Boost headers into your
package.  My RcppBDT package does that too.  Some of us have talked about
creating a 'boost-headers' package for CRAN that the couple of Boost-using
packages could have a 'Depends:' and 'LinkingTo:' on.  Then his issues would
be solved -- but we're not there yet.

Soeren just shown resilience and persistence in getting his package
written, built and now onto CRAN.  The remaining step is to learn more about
cross-platform build issues.  Because that is the (high) standard of CRAN,
and if you want to be part of it, you are expected to conform.  No shortcuts.

Dirk

 
| Cheers,
| Simon
| 
| 
| On Jun 29, 2011, at 2:05 PM, Simon Urbanek wrote:
| 
|  
|  On Jun 29, 2011, at 1:12 PM, Uwe Ligges wrote:
|  
|  Looks like a different boost version than the one you require.
|  I'd suggest to talk to the Mac maintainer, Simon Urbanek (CCing).
|  
|  
|  GUTS doesn't specify any system requirements, so obviously it has no 
business trying to use boost from the system. Also note boost is inlined in the 
vast majority of cases, so most packages simply supply the headers inside as to 
guarantee the required version is used (which I would certainly expect GUTS to 
do since it doesn't depend on boost according to the DESCRIPTION).
|  
|  Cheers,
|  Simon
|  
|  
|  
|  On 29.06.2011 17:14, soeren.vo...@uzh.ch wrote:
|  Hello David
|  
|  On 29.06.2011, at 15:56, David Winsemius wrote:
|  
|  On Jun 29, 2011, at 5:33 AM, soeren.vo...@uzh.ch wrote:
|  
|  Hello, the compilation of the GUTS package on CRAN for Mac produces the 
following error messages:
|  
|  
http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/GUTS-00install.html
|  
|  I guess it is some namespace collision, but I can not reproduce it on 
my machine, it compiles fine here. What is the cause and which setup do I need 
to reproduce the errors?
|  
|  I was going to suggest you take this up with the maintainers... but you 
_are_ one of the maintainers.
|  
|  :-)
|  
|  Here is the output from an attempt to compile from source, version 
0.1.45, with a relatively recent version of R 2.13.0 (but not the most recent 
and I still use Mac OSX 10.5.8). Perhaps its brevity will be helpful, and the 
fact that it seems to identify different error than those flagged in the log at 
CRAN.
|  
|  Thanks for your answer. The failure on your side is clear to me: there is 
no installation of the boost C++ library in any of the standard include 
locations. I have added /opt/local/include in Makevars (Mac Ports installation 
of C source packages), however, I know I should but still I am reluctant to 
write a configure script that could circumvent non-standard installations of 
boost on UNIX machines.
|  
|  So thanks for the output, but the CRAN messages must point to something 
different...
|  
|  Regards
|  Sören
|  
|  trying URL 
'http://lib.stat.cmu.edu/R/CRAN/src/contrib/GUTS_0.1.45.tar.gz'
|  Content type 'application/x-gzip' length 9842 bytes
|  opened URL
|  ==
|  downloaded 9842 bytes
|  
|  Loading required package: lattice
|  Loading required package: sos
|  Loading required package: brew
|  [1] 2011-06-29 09:40:18 EDT
|  * installing *source* package ‘GUTS’ ...
|  ** libs
|  *** arch - i386
|  g++ -arch i386 -I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/i386 -I/opt/local/include 
-I/usr/local/include 
-I/Library/Frameworks/R.framework/Versions/2.13/Resources/library/Rcpp/include
   -fPIC  -g -O2 -c GUTS.cpp -o GUTS.o
|  In file included from GUTS.cpp:12:
|  GUTS.h:21:28: error: boost/random.hpp: No such file or directory
|  GUTS.h:22:40: error: boost/math/distributions.hpp: No such file or 
directory
|  

Re: [Rd] Compilation error Mac binary

2011-06-29 Thread soeren . vogel
On 29.06.2011, at 21:19, Dirk Eddelbuettel wrote:

 Soeren just shown resilience and persistence in getting his package
 written, built and now onto CRAN.  The remaining step is to learn more about
 cross-platform build issues.  Because that is the (high) standard of CRAN,
 and if you want to be part of it, you are expected to conform.  No shortcuts.

Hehehe :-D Okay, Dirk, I'll try my best :-)!

Cheers
Sören

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


[Rd] invalid body argument for function

2011-06-29 Thread Michael Lawrence
Hi guys,

Looks like mkCLOSXP cannot handle external pointers as the function body.
Work around is obvious, but I guess it's a bug nonetheless.

 library(RGtk2)
 fun - eval(substitute(function() x, list(x = gtkWindow(
Error in eval(expr, envir, enclos) : invalid body argument for function
Should NEVER happen; please bug.report() [mkCLOSXP]

 sessionInfo()
R version 2.14.0 Under development (unstable) (--)
Platform: i686-pc-linux-gnu (32-bit)

locale:
[1] C

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

other attached packages:
[1] RGtk2_2.20.13 qtbase_0.8-16 visnab_0.0.1

loaded via a namespace (and not attached):
 [1] BSgenome_1.21.3   Biobase_2.11.10   Biostrings_2.21.6
 [4] DBI_0.2-5 GenomicFeatures_1.5.5 GenomicRanges_1.3.39
 [7] IRanges_1.11.11   MutableRanges_0.2.0   RColorBrewer_1.0-2
[10] RCurl_1.5-0   RSQLite_0.9-4 Rsamtools_1.5.13
[13] XML_3.2-0 biomaRt_2.7.2 colorspace_1.0-1
[16] dichromat_1.2-3   munsell_0.2   objectSignals_0.5.1
[19] plumbr_0.6.2  plyr_1.4.1qtpaint_0.7.22
[22] rtracklayer_1.13.3scales_0.1.0  stringr_0.4

[[alternative HTML version deleted]]

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