[Rcpp-devel] (OS X / 64 bit woes?) R CMD check failing on skeletonc Rcpp module

Dirk Eddelbuettel edd at debian.org
Fri Mar 23 21:08:22 CET 2012


Bob,

Thanks for the detailed email.

On 23 March 2012 at 15:42, Bob Carpenter wrote:
| With latest Rcpp (0.9.10) and latest R (2.14.2),
| I generated an Rcpp module skeleton, but it
| blows up with a memory error "pointer being freed was not
| allocated" when I run "R CMD check" for x86_64.
| 
| An Rcpp skeleton created with module=FALSE works just fine.
| 
| Here's what I did step-by-step:
| 
| 1.  Updated R to 2.14.2
| 
| 2.  Fired up 64-bit R
| 
| ~/stan> R
| 
| R version 2.14.2 (2012-02-29)
| Copyright (C) 2012 The R Foundation for Statistical Computing
| ISBN 3-900051-07-0
| Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
| 
| 
| 3.  Installed Rcpp
| 
| R> setwd('stan')
| R> install.packages('Rcpp')
| --- Please select a CRAN mirror for use in this session ---
| trying URL 
| 'http://cran.at.r-project.org/bin/macosx/leopard/contrib/2.14/Rcpp_0.9.10.tgz'
| Content type 'application/x-gzip' length 7636884 bytes (7.3 Mb)
| opened URL
| ==================================================
| downloaded 7.3 Mb
| 
| 
| 4. Generated a package skeleton with module=TRUE
| 
| R> Rcpp.package.skeleton(name='mypkg2',module=TRUE)
| Creating directories ...
| Creating DESCRIPTION ...
| Creating NAMESPACE ...
| Creating Read-and-delete-me ...
| Saving functions and data ...
| Making help files ...
| Done.
| Further steps are described in './mypkg2/Read-and-delete-me'.
| 
| 
| 5.  Built the package
| 
| ~/stan> R CMD build mypkg2
| * checking for file ‘mypkg2/DESCRIPTION’ ... OK
| * preparing ‘mypkg2’:
| * checking DESCRIPTION meta-information ... OK
| * cleaning src
| * checking for LF line-endings in source and make files
| * checking for empty or unneeded directories
| * building ‘mypkg2_1.0.tar.gz’
| 
| 
| 6. Check the package
| 
| ~/stan> R CMD check mypkg2
| * using log directory ‘/Users/carp/stan/mypkg2.Rcheck’
| * using R version 2.14.2 (2012-02-29)
| * using platform: x86_64-apple-darwin9.8.0 (64-bit)
| * using session charset: UTF-8
| * checking for file ‘mypkg2/DESCRIPTION’ ... OK
| * checking extension type ... Package
| * this is package ‘mypkg2’ version ‘1.0’
| * checking package namespace information ... OK
| * checking package dependencies ... OK
| * checking if this is a source package ... OK
| * checking if there is a namespace ... OK
| * checking for executable files ... OK
| * checking whether package ‘mypkg2’ can be installed ... ERROR
| Installation failed.
| See ‘/Users/carp/stan/mypkg2.Rcheck/00install.out’ for details.

Works for me with R 2.14.2 on 64-bit Linux:

edd at max:/tmp$ R CMD build mypkg2/
R CMD build mypkg2/
* checking for file ‘mypkg2/DESCRIPTION’ ... OK
* preparing ‘mypkg2’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building ‘mypkg2_1.0.tar.gz’

edd at max:/tmp$ R CMD check mypkg2_1.0.tar.gz 
R CMD check mypkg2_1.0.tar.gz 
* using log directory ‘/tmp/mypkg2.Rcheck’
* using R version 2.14.2 (2012-02-29)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ‘mypkg2/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘mypkg2’ version ‘1.0’
* checking CRAN incoming feasibility ... NOTE
Non-FOSS package license (What Licence is it under ?)
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking whether package ‘mypkg2’ can be installed ... WARNING
Found the following significant warnings:
  Warning: /tmp/mypkg2.Rcheck/00_pkg_src/mypkg2/man/mypkg2-package.Rd:31: All text must be in a section
See ‘/tmp/mypkg2.Rcheck/00install.out’ for details.
* checking installed package size ... OK
* checking package directory ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking DESCRIPTION meta-information ... WARNING
Non-standard license specification:
  What Licence is it under ?
Standardizable: FALSE
* checking top-level files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking for unstated dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... NOTE
File ‘mypkg2/R/zzz.R’:
  .onLoad calls:
    require("methods", character = TRUE, quietly = TRUE)

Package startup functions should not change the search path.
See section ‘Good practice’ in ?.onAttach.

.onLoad: warning in require("methods", character = TRUE, quietly =
  TRUE): partial argument match of 'character' to 'character.only'
* checking Rd files ... WARNING
prepare_Rd: mypkg2-package.Rd:31: All text must be in a section
prepare_Rd: mypkg2-package.Rd:37-39: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... WARNING
Unknown package(s) ‘<pkg>’ in Rd xrefs
* checking for missing documentation entries ... WARNING
Undocumented code objects:
  ‘World’ ‘bar’ ‘bla’ ‘bla1’ ‘bla2’ ‘foo’ ‘hello’
All user-level objects in a package should have documentation entries.
See the chapter ‘Writing R documentation files’ in the ‘Writing R Extensions’ manual.
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking for portable compilation flags in Makevars ... OK
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking compiled code ... OK
* checking examples ... OK
* checking PDF version of manual ... OK

WARNING: There were 5 warnings, see
  ‘/tmp/mypkg2.Rcheck/00check.log’
for details

edd at max:/tmp$ 


Regards, Dirk

| 
| 
| 7. Look at the error log
| 
| ~/stan> cat /Users/carp/stan/mypkg2.Rcheck/00install.out
| * installing *source* package ‘mypkg2’ ...
| ** libs
| *** arch - i386
| g++ -arch i386 -I/Library/Frameworks/R.framework/Resources/include 
| -I/Library/Frameworks/R.framework/Resources/include/i386 
| -I/usr/local/include 
| -I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include" 
|    -fPIC  -g -O2 -c rcpp_hello_world.cpp -o rcpp_hello_world.o
| g++ -arch i386 -I/Library/Frameworks/R.framework/Resources/include 
| -I/Library/Frameworks/R.framework/Resources/include/i386 
| -I/usr/local/include 
| -I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include" 
|    -fPIC  -g -O2 -c rcpp_module.cpp -o rcpp_module.o
| g++ -arch i386 -dynamiclib -Wl,-headerpad_max_install_names -undefined 
| dynamic_lookup -single_module -multiply_defined suppress 
| -L/usr/local/lib -o mypkg2.so rcpp_hello_world.o rcpp_module.o 
| /Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/lib/i386/libRcpp.a 
| -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework 
| -Wl,CoreFoundation
| ld: warning: in /usr/local/lib/libstdc++.dylib, file was built for 
| unsupported file format which is not the architecture being linked (i386)
| installing to /Users/carp/stan/mypkg2.Rcheck/mypkg2/libs/i386
| *** arch - x86_64
| g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include 
| -I/Library/Frameworks/R.framework/Resources/include/x86_64 
| -I/usr/local/include 
| -I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include" 
|    -fPIC  -g -O2 -c rcpp_hello_world.cpp -o rcpp_hello_world.o
| g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include 
| -I/Library/Frameworks/R.framework/Resources/include/x86_64 
| -I/usr/local/include 
| -I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include" 
|    -fPIC  -g -O2 -c rcpp_module.cpp -o rcpp_module.o
| g++ -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined 
| dynamic_lookup -single_module -multiply_defined suppress 
| -L/usr/local/lib -o mypkg2.so rcpp_hello_world.o rcpp_module.o 
| /Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/lib/x86_64/libRcpp.a 
| -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework 
| -Wl,CoreFoundation
| installing to /Users/carp/stan/mypkg2.Rcheck/mypkg2/libs/x86_64
| ** R
| ** preparing package for lazy loading
| ** help
| Warning: /Users/carp/stan/mypkg2/man/mypkg2-package.Rd:30: All text must 
| be in a section
| *** installing help indices
| ** building package indices ...
| ** testing if installed package can be loaded
| *** arch - i386
| *** arch - x86_64
| R(2493) malloc: *** error for object 0x7fff704bd500: pointer being freed 
| was not allocated
| *** set a breakpoint in malloc_error_break to debug
| sh: line 1:  2493 Abort trap 
| '/Library/Frameworks/R.framework/Resources/bin/R' --arch=x86_64 
| --no-save --slave < 
| /var/folders/ju/juD0VflHENew03RUV+bbPU+++TM/-Tmp-//RtmpEs9sCx/file971c5161ca
| ERROR: loading failed for ‘x86_64’
| * removing ‘/Users/carp/stan/mypkg2.Rcheck/mypkg2’
| 
| 
| 
| Any clues as to what's going on would be greatly appreciated.

I do not have an OS X machine, so I can't test this and do anything further,
I am afraid.

Try submitting it to win-builder.r-project.org which would throw another 64
bit compiler in the mix.  We have had our share of issue with the older /
deprecated g++ version on OS X so this could be related.

Dirk


| Thanks.
| 
| - Bob Carpenter
|    Columbia University, Deptartment of Statistics
| 
| 
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

-- 
"Outside of a dog, a book is a man's best friend. Inside of a dog, it is too
dark to read." -- Groucho Marx


More information about the Rcpp-devel mailing list