Re: [Rd] Best way to implement optional functions?
Yes, you do need at least a token about of documentation in both packages. I keep full documentation in the package where they originate, and minimal documentation in the rexporting package. The roxygen code in the reexporting package looks like this: #' Some function #' #' See \code{\link[originating_pkg]{some_function}}. #' @name some_function #' @export NULL I borrowed this idea from dplyr's reexporting of magrittr's pipe. On 17 November 2015 at 00:02, Duncan Murdoch wrote: > On 16/11/2015 4:00 AM, Richard Cotton wrote: >> >> On 22 October 2015 at 22:55, Duncan Murdoch >> wrote: >>> >>> I'm planning on adding some new WebGL functionality to the rgl package, >>> but >>> it will pull in a very large number of dependencies. Since many people >>> won't >>> need it, I'd like to make the new parts optional. >> >> >>> Can people suggest other packages that solve this kind of problem in a >>> good >>> way? >> >> >> I had the same issue with the assertive package: it was getting big, >> and not everyone wanted all the functionality. >> >> The solution was to create several smaller packages with individual >> components of functionality, for example assertive.base contains the >> bare-minimum functionality; assertive.numbers contains functionality >> related to numbers, etc. >> >> Then the assertive package imports all the functions from the >> component packages and reexports them. >> >> That way people who want a small footprint (mostly other package >> developers) can specify only what they need, and people who don't care >> (mostly end users) can just type library(assertive) and get access to >> everything. >> > > When you import and re-export functions, do they need to be documented in > both places? I forget if we have a simple way to say "this function is > documented in that package", to avoid duplication. > > Duncan Murdoch -- Regards, Richie Learning R 4dpiecharts.com __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] capturing warnings using capture.output
>From the Details section of ?capture.output: Messages sent to stderr() (including those from message, warning and stop) are captured by type = "message". Note that this can be "unsafe" and should only be used with care. Capturing messages works as expected: capture.output(message("!!!"), type = "message") ## [1] "!!!" Capturing warnings doesn't seems to work: capture.output(warning("!!!"), type = "message") ## character(0) ## Warning message: ## In eval(expr, envir, enclos) : !!! Is the documentation wrong, or is this a bug, or am I doing doing silly? -- Regards, Richie Learning R 4dpiecharts.com [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] capturing warnings using capture.output
When options("warn") is 0, the default, the warning is not printed until capture.output is done. Use warn=1 to capture the warnings as messages: > options(warn=0) > txt0 <- capture.output({message("A message"); warning("A warning")}, > type="message") Warning message: In eval(expr, envir, enclos) : A warning > options(warn=1) > txt1 <- capture.output({message("A message"); warning("A warning")}, > type="message") > txt0 [1] "A message" > txt1 [1] "A message" [2] "Warning in eval(expr, envir, enclos) : A warning" Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Nov 23, 2015 at 2:31 AM, Richard Cotton wrote: > >From the Details section of ?capture.output: > > Messages sent to stderr() (including those from message, warning and stop) > are captured by type = "message". Note that this can be "unsafe" and should > only be used with care. > > Capturing messages works as expected: > > capture.output(message("!!!"), type = "message") > ## [1] "!!!" > > Capturing warnings doesn't seems to work: > > capture.output(warning("!!!"), type = "message") > ## character(0) > ## Warning message: > ## In eval(expr, envir, enclos) : !!! > > Is the documentation wrong, or is this a bug, or am I doing doing silly? > > -- > Regards, > Richie > > Learning R > 4dpiecharts.com > > [[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
[Rd] MKL Acceleration encouraging; need adjust package builds?
Dear R-devel: The Cluster administrators at KU got enthusiastic about testing R-3.2.2 with Intel MKL when I asked for some BLAS integration. Below I forward a performance report, which is encouraging, and thought you would like to know the numbers. Appears to my untrained eye there are some extraordinary speedups on Cholesky decomposition, determinants, and matrix inversion. They had difficulty getting R to compile with R shared BLAS (don't know what went wrong there), so they went the other direction. In his message to me, the technician says that I should consider adjusting the compilation flags on the packages that use BLAS. Do you think that is needed? R is compiled with non-shared BLAS libraries, won't packages know where to look for BLAS headers? 2. If I need to do that, I wonder how to do it and which packages need attention. Eigen and Armadillo packages, and possibly the ones that depend on them, lme4, anything flowing through Rcpp. Here's the build for some packages. Are they finding MKL BLAS? How would I know? * installing *source* package 'RcppArmadillo' ... ** package 'RcppArmadillo' successfully unpacked and MD5 sums checked * checking LAPACK_LIBS: divide-and-conquer complex SVD available via system LAPACK ** libs g++ -I/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/include -I/usr/local/include -I"/panfs/pfs.acf.ku.edu/crmda/tools/lib64/R/3.2/site-library/Rcpp/include" -I../inst/include -fpic -O3 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic-c RcppArmadillo.cpp -o RcppArmadillo.o g++ -I/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/include -I/usr/local/include -I"/panfs/pfs.acf.ku.edu/crmda/tools/lib64/R/3.2/site-library/Rcpp/include" -I../inst/include -fpic -O3 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic-c RcppExports.cpp -o RcppExports.o g++ -I/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/include -I/usr/local/include -I"/panfs/pfs.acf.ku.edu/crmda/tools/lib64/R/3.2/site-library/Rcpp/include" -I../inst/include -fpic -O3 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic-c fastLm.cpp -o fastLm.o g++ -shared -L/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/lib -L/usr/local/lib64 -o RcppArmadillo.so RcppArmadillo.o RcppExports.o fastLm.o -L/panfs/pfs.acf.ku.edu/cluster/6.2/intel/2015/mkl/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -Wl,--start-group -lmkl_gnu_thread -lmkl_core -Wl,--end-group -fopenmp -ldl -lpthread -lm -lgfortran -lm -L/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/lib -lR installing to /panfs/pfs.acf.ku.edu/crmda/tools/lib64/R/3.2/site-library/RcppArmadillo/libs ** R ** inst ** preparing package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded * DONE (RcppArmadillo) * installing *source* package 'RcppEigen' ... ** package 'RcppEigen' successfully unpacked and MD5 sums checked ** libs g++ -I/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/include -I/usr/local/include -I"/panfs/pfs.acf.ku.edu/crmda/tools/lib64/R/3.2/site-library/Rcpp/include" -I../inst/include -fpic -O3 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic-c RcppEigen.cpp -o RcppEigen.o g++ -I/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/include -I/usr/local/include -I"/panfs/pfs.acf.ku.edu/crmda/tools/lib64/R/3.2/site-library/Rcpp/include" -I../inst/include -fpic -O3 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic-c RcppExports.cpp -o RcppExports.o g++ -I/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/include -I/usr/local/include -I"/panfs/pfs.acf.ku.edu/crmda/tools/lib64/R/3.2/site-library/Rcpp/include" -I../inst/include -fpic -O3 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic-c fastLm.cpp -o fastLm.o g++ -shared -L/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/lib -L/usr/local/lib64 -o RcppEigen.so RcppEigen.o RcppExports.o fastLm.o -L/panfs/pfs.acf.ku.edu/cluster/6.2/intel/2015/mkl/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -Wl,--start-group -lmkl_gnu_thread -lmkl_core -Wl,--end-group -fopenmp -ldl -lpthread -lm -lgfortran -lm -L/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/lib -lR installing to /panfs/pfs.acf.ku.edu/crmda/tools/lib64/R/3.2/site-library/RcppEigen/libs ** R ** inst ** preparing package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded * DONE (RcppEigen) * installing *source* package 'MatrixModels' ... ** package 'MatrixModels' successfully unpacked and MD5 sums checked ** R ** preparing package for lazy loading Creating a generic function for 'resid' from package 'stats' in package 'MatrixModels' Creating a generic function for 'fitted.va
Re: [Rd] MKL Acceleration encouraging; need adjust package builds?
Hi Paul, We've been through this process ourselves for the Revolution R Open project. There are a number of pitfalls to avoid, but you can take a look at how we achieved it in the build scripts at: https://github.com/RevolutionAnalytics/RRO There are also some very useful notes in the R Installation guide: https://cran.r-project.org/doc/manuals/r-release/R-admin.html#BLAS Most packages do benefit from MKL (or any multi-threaded BLAS) to some degree, although the actual benefit depends on the R functions they call. Some packages (and some built-in R functions) don't call into BLAS endpoints, so you won't see benefits in all cases. # David Smith -- David M Smith R Community Lead, Revolution Analytics (a Microsoft company) Tel: +1 (312) 9205766 (Chicago IL, USA) Twitter: @revodavid | Blog: http://blog.revolutionanalytics.com We are hiring engineers for Revolution R and Azure Machine Learning. -Original Message- From: R-devel [mailto:r-devel-boun...@r-project.org] On Behalf Of Paul Johnson Sent: Monday, November 23, 2015 09:28 To: R Devel List Subject: [Rd] MKL Acceleration encouraging; need adjust package builds? Dear R-devel: The Cluster administrators at KU got enthusiastic about testing R-3.2.2 with Intel MKL when I asked for some BLAS integration. Below I forward a performance report, which is encouraging, and thought you would like to know the numbers. Appears to my untrained eye there are some extraordinary speedups on Cholesky decomposition, determinants, and matrix inversion. They had difficulty getting R to compile with R shared BLAS (don't know what went wrong there), so they went the other direction. In his message to me, the technician says that I should consider adjusting the compilation flags on the packages that use BLAS. Do you think that is needed? R is compiled with non-shared BLAS libraries, won't packages know where to look for BLAS headers? 2. If I need to do that, I wonder how to do it and which packages need attention. Eigen and Armadillo packages, and possibly the ones that depend on them, lme4, anything flowing through Rcpp. Here's the build for some packages. Are they finding MKL BLAS? How would I know? * installing *source* package 'RcppArmadillo' ... ** package 'RcppArmadillo' successfully unpacked and MD5 sums checked * checking LAPACK_LIBS: divide-and-conquer complex SVD available via system LAPACK ** libs g++ -I/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/include -I/usr/local/include -I"/panfs/pfs.acf.ku.edu/crmda/tools/lib64/R/3.2/site-library/Rcpp/include" -I../inst/include -fpic -O3 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic-c RcppArmadillo.cpp -o RcppArmadillo.o g++ -I/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/include -I/usr/local/include -I"/panfs/pfs.acf.ku.edu/crmda/tools/lib64/R/3.2/site-library/Rcpp/include" -I../inst/include -fpic -O3 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic-c RcppExports.cpp -o RcppExports.o g++ -I/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/include -I/usr/local/include -I"/panfs/pfs.acf.ku.edu/crmda/tools/lib64/R/3.2/site-library/Rcpp/include" -I../inst/include -fpic -O3 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic-c fastLm.cpp -o fastLm.o g++ -shared -L/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/lib -L/usr/local/lib64 -o https://na01.safelinks.protection.outlook.com/?url=RcppArmadillo.so&data=01%7c01%7cdavidsmi%40microsoft.com%7c80ae9ec8fef04c42eed808d2f42bf31d%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=AwdY1xC74H25uBIyciugr9HeuGhYhnDGKoQkeDUhpeQ%3d RcppArmadillo.o RcppExports.o fastLm.o -L/panfs/pfs.acf.ku.edu/cluster/6.2/intel/2015/mkl/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -Wl,--start-group -lmkl_gnu_thread -lmkl_core -Wl,--end-group -fopenmp -ldl -lpthread -lm -lgfortran -lm -L/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/lib -lR installing to /panfs/pfs.acf.ku.edu/crmda/tools/lib64/R/3.2/site-library/RcppArmadillo/libs ** R ** inst ** preparing package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded * DONE (RcppArmadillo) * installing *source* package 'RcppEigen' ... ** package 'RcppEigen' successfully unpacked and MD5 sums checked ** libs g++ -I/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/include -I/usr/local/include -I"/panfs/pfs.acf.ku.edu/crmda/tools/lib64/R/3.2/site-library/Rcpp/include" -I../inst/include -fpic -O3 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic-c RcppEigen.cpp -o RcppEigen.o g++ -I/tools/cluster/6.2/R/3.2.2_mkl/lib64/R/include -I/usr/local/include -I"/panfs/pfs.acf.ku.edu/crmda/tools/lib64/R/3.2/site-library/Rcpp/include" -I../inst/include -fpic -O3 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexc
[Rd] compile question
Dear all, Starting all over again with R-devel of 22-11-2015. After getting the dependancies (minimal graphics initially) I have been able to come this far - with a 64-bit build on AIX. root@x072:[/data/prj/cran/64/R-devel]make make[1]: Entering directory '/data/prj/cran/64/R-devel/m4' make[1]: Nothing to be done for 'R'. make[1]: Leaving directory '/data/prj/cran/64/R-devel/m4' make[1]: Entering directory '/data/prj/cran/64/R-devel/tools' make[1]: Nothing to be done for 'R'. make[1]: Leaving directory '/data/prj/cran/64/R-devel/tools' make[1]: Entering directory '/data/prj/cran/64/R-devel/doc' make[2]: Entering directory '/data/prj/cran/64/R-devel/doc/html' make[2]: Leaving directory '/data/prj/cran/64/R-devel/doc/html' make[2]: Entering directory '/data/prj/cran/64/R-devel/doc/manual' make[2]: Nothing to be done for 'R'. make[2]: Leaving directory '/data/prj/cran/64/R-devel/doc/manual' make[1]: Leaving directory '/data/prj/cran/64/R-devel/doc' make[1]: Entering directory '/data/prj/cran/64/R-devel/etc' make[1]: Leaving directory '/data/prj/cran/64/R-devel/etc' make[1]: Entering directory '/data/prj/cran/64/R-devel/share' make[1]: Leaving directory '/data/prj/cran/64/R-devel/share' make[1]: Entering directory '/data/prj/cran/64/R-devel/src' make[2]: Entering directory '/data/prj/cran/64/R-devel/src/scripts' make[3]: Entering directory '/data/prj/cran/64/R-devel/src/scripts' make[3]: Leaving directory '/data/prj/cran/64/R-devel/src/scripts' make[2]: Leaving directory '/data/prj/cran/64/R-devel/src/scripts' make[2]: Entering directory '/data/prj/cran/64/R-devel/src/include' /bin/sh: ../../tools/missing: not found. Makefile:66: recipe for target 'stamp-h.in' failed make[2]: *** [stamp-h.in] Error 127 make[2]: Leaving directory '/data/prj/cran/64/R-devel/src/include' Makefile:28: recipe for target 'R' failed make[1]: *** [R] Error 1 make[1]: Leaving directory '/data/prj/cran/64/R-devel/src' Makefile:60: recipe for target 'R' failed make: *** [R] Error 1 This is my configure call: #!/usr/bin/ksh # my_config_test . /data/prj/cran/64/setup.env ./configure --enable-maintainer-mode --enable-R-shlib --enable-lto --with-libpth-prefix=prefix=/opt \ --disable-rpath --with-readline=no --with-x=no \ --with-cairo=no --with-libpng=no --with-jpeglib=no --with-libtiff=no \ --with-system-tre=no \ --with-recommended-packages=no \ --with-aix-soname=aix And the environment is: root@x072:[/data/prj/cran/64/R-devel]cat ../setup* export OBJECT_MODE=64 export CC="gcc -maix64" export CXX="g++ -maix64" export F77="gfortran -maix64" export FC="gfortran -maix64" export LDFLAGS="-L/opt/lib/64 -lpcre" FYI: configure ends with: R is now configured for powerpc-ibm-aix7.1.3.0 Source directory: . Installation directory:/usr/local C compiler:gcc -maix64 -std=gnu99 -mminimal-toc -g -O2 Fortran 77 compiler: gfortran -maix64 -g -O2 C++ compiler: g++ -maix64 -g -O2 C++11 compiler:g++ -maix64 -std=c++11 -g -O2 Fortran 90/95 compiler:gfortran -maix64 -g -O2 Obj-C compiler: Interfaces supported: External libraries:curl Additional capabilities: NLS Options enabled: shared R library, R profiling, maintainer mode Capabilities skipped: PNG, JPEG, TIFF, cairo, ICU Options not enabled: shared BLAS, memory profiling Recommended packages: no Thanks for your insight re: the missing tools/missing (or whatever it is looking for!) Michael __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] MKL Acceleration encouraging; need adjust package builds?
We said it before, but it bears repeating: BLAS is an interface. So unless you use on a static library build, these library can be switch after compilation and at essentially any point in time. My (unfinished) package gcbd shows how in its simple and vignette by comparing a number of BLAS implementations. See the (now dated) chart on page 9 of https://cran.rstudio.com/web/packages/gcbd/vignettes/gcbd.pdf or this (old) blog post http://dirk.eddelbuettel.com/blog/2010/10/03/ While the charts could do with an update, they do show how eg reference blas is clearly outperformed by Atlas or GotoBLAS (the predecessor to OpebBLAS). Hope this helps, Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] compile question
On 2015-11-23 18:52, aixtools wrote: Dear all, Starting all over again with R-devel of 22-11-2015. After getting the dependancies (minimal graphics initially) I have been able to come this far - with a 64-bit build on AIX. This is my configure call: #!/usr/bin/ksh # my_config_test . /data/prj/cran/64/setup.env ./configure --enable-maintainer-mode --enable-R-shlib --enable-lto --with-libpth-prefix=prefix=/opt \ --prefix=/opt \ --disable-rpath --with-readline=no --with-x=no \ --with-cairo=no --with-libpng=no --with-jpeglib=no --with-libtiff=no \ --with-aix-soname=aix So, modified the configure call, just incase, to be a bit more 'normal', but still getting a failure with: creating src/scripts/R.fe make[3]: Entering directory '/data/prj/cran/64/R-devel/src/scripts' mkdir -p -- ../../bin make[3]: Leaving directory '/data/prj/cran/64/R-devel/src/scripts' make[2]: Leaving directory '/data/prj/cran/64/R-devel/src/scripts' make[2]: Entering directory '/data/prj/cran/64/R-devel/src/include' mkdir -p -- ../../include /bin/sh: ../../tools/missing: not found. Makefile:66: recipe for target 'stamp-h.in' failed make[2]: *** [stamp-h.in] Error 127 make[2]: Leaving directory '/data/prj/cran/64/R-devel/src/include' Makefile:28: recipe for target 'R' failed make[1]: *** [R] Error 1 make[1]: Leaving directory '/data/prj/cran/64/R-devel/src' Makefile:60: recipe for target 'R' failed make: *** [R] Error 1 Everything seems top be in place, but I do not know GNU autotools well enough (I thought that is the origin of 'missing') root@x072:[/data/prj/cran/64/R-devel]cd src/include root@x072:[/data/prj/cran/64/R-devel/src/include]find ../.. -name missing ../../tools/missing root@x072:[/data/prj/cran/64/R-devel/src/include]find ../.. -name missing -ls 101915983 11 -rwxrwxr-x 1 2300 230011135 Nov 14 2013 ../../tools/missing root@x072:[/data/prj/cran/64/R-devel/src/include]head ../../tools/missing #! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify And the environment is: root@x072:[/data/prj/cran/64/R-devel]cat ../setup* export OBJECT_MODE=64 export CC="gcc -maix64" export CXX="g++ -maix64" export F77="gfortran -maix64" export FC="gfortran -maix64" export LDFLAGS="-L/opt/lib/64 -lpcre" Thanks for your insight re: the missing tools/missing (or whatever it is looking for!) Michael __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] compile question
Hi Michael, I experienced the same thing in the past. After you get the R-3.2.2.tar.gz and uncompress it, enter the R-3.2.2 directory and run the ./configure and make from there, rather than a different one. One other thing, you probably already did this, but just in case you might want to double-check this section as well: https://cran.r-project.org/doc/manuals/r-release/R-admin.html#AIX Hope it helps, ~p -Original Message- From: R-devel [mailto:r-devel-boun...@r-project.org] On Behalf Of aixtools Sent: Monday, November 23, 2015 4:31 PM To: r-devel@r-project.org Subject: Re: [Rd] compile question On 2015-11-23 18:52, aixtools wrote: > Dear all, > > Starting all over again with R-devel of 22-11-2015. > > After getting the dependancies (minimal graphics initially) I have > been able to come this far - with a 64-bit build on AIX. > > > > This is my configure call: > > #!/usr/bin/ksh > # my_config_test > > . /data/prj/cran/64/setup.env > > ./configure --enable-maintainer-mode --enable-R-shlib --enable-lto > --with-libpth-prefix=prefix=/opt \ --prefix=/opt \ > --disable-rpath --with-readline=no --with-x=no \ > --with-cairo=no --with-libpng=no --with-jpeglib=no > --with-libtiff=no \ > --with-aix-soname=aix > So, modified the configure call, just incase, to be a bit more 'normal', but still getting a failure with: creating src/scripts/R.fe make[3]: Entering directory '/data/prj/cran/64/R-devel/src/scripts' mkdir -p -- ../../bin make[3]: Leaving directory '/data/prj/cran/64/R-devel/src/scripts' make[2]: Leaving directory '/data/prj/cran/64/R-devel/src/scripts' make[2]: Entering directory '/data/prj/cran/64/R-devel/src/include' mkdir -p -- ../../include /bin/sh: ../../tools/missing: not found. Makefile:66: recipe for target 'stamp-h.in' failed make[2]: *** [stamp-h.in] Error 127 make[2]: Leaving directory '/data/prj/cran/64/R-devel/src/include' Makefile:28: recipe for target 'R' failed make[1]: *** [R] Error 1 make[1]: Leaving directory '/data/prj/cran/64/R-devel/src' Makefile:60: recipe for target 'R' failed make: *** [R] Error 1 Everything seems top be in place, but I do not know GNU autotools well enough (I thought that is the origin of 'missing') root@x072:[/data/prj/cran/64/R-devel]cd src/include root@x072:[/data/prj/cran/64/R-devel/src/include]find ../.. -name missing ../../tools/missing root@x072:[/data/prj/cran/64/R-devel/src/include]find ../.. -name missing -ls 101915983 11 -rwxrwxr-x 1 2300 230011135 Nov 14 2013 ../../tools/missing root@x072:[/data/prj/cran/64/R-devel/src/include]head ../../tools/missing #! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify > And the environment is: > root@x072:[/data/prj/cran/64/R-devel]cat ../setup* export > OBJECT_MODE=64 export CC="gcc -maix64" > export CXX="g++ -maix64" > export F77="gfortran -maix64" > export FC="gfortran -maix64" > export LDFLAGS="-L/opt/lib/64 -lpcre" > > Thanks for your insight re: the missing tools/missing (or whatever it > is looking for!) > > Michael > __ 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] compile question
> On 23 Nov 2015, at 22:30 , aixtools wrote: > >> >> ./configure --enable-maintainer-mode ... Two things here - possibly irrelevant, but I'd avoid building in the source directory. (mkdir ../BUILD ; cd ../BUILD; ../R/configure) - don't turn on mantainer mode. You are not a maintainer, and if you want to play at being one, I think you need extra tools. -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Custom C finalizers for .Call
WRE explains that R_alloc() can be used to allocate memory which automatically gets released by R at the end of a .C, .Call or .External, even in the case of an error or interruption. This is a really great feature to prevent memory leaks. I was wondering if there is a way to extend this mechanism to allow for automatically running UNPROTECT and custom finalizers at the end of a .Call as well. Currently it is all to easy for package authors to introduce a memory leak or stack imbalance by calling Rf_error() or R_CheckUserInterrupt() in a way that skips over the usual cleanup steps. This holds especially for packages interfacing C libraries (libcurl, libxml2, openssl, etc) which require xx_new() and xx_free() functions to allocate/free various types of objects, handles and contexts. Therefore we cannot use R_alloc() and we need to manually clean up when returning, which is tricky for irregular exits. Moreover package authors might benefit from an alternative of allocVector() which automatically protects the SEXP until the .Call is done. Perhaps I don't fully appreciate the complexity of the garbage collector, but one could imagine a variant of PROTECT() which automatically keeps a counter 'n' for the number of allocated objects and makes R run UNPROTECT(n) when .Call exists, along with releasing the R_alloc() memory. Yes, there are cases where it is useful to have manual control over what can be collected earlier during the .Call procedure, but these are rare. A lot of C code in packages might become safer and cleaner if authors would have an option to let this be automated. The most general feature would a hook for adding custom C functions to the .Call exit, similar to on.exit() in R: xmlNodePtr *node = xmlNewNode(...); Rf_on_exit(xmlFreeNode, node); EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new(...); Rf_on_exit(EVP_PKEY_CTX_free, ctx); SEXP out = PROTECT(allocVector(...)); Rf_on_exit(UNPROTECT, 1); I don't know R's internals well enough to estimate if something like this would be possible. I did put together a simple C example of a linked list with object pointers and their corresponding free functions, which can easily be free'd with a single call: http://git.io/vBqRA . So basically what is mostly missing at this point is a way to trigger this at the end of the .Call in a way that works for regular returns, errors and interruptions... __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R-devel no longer supports Ubuntu 14.04 LTS (insufficient PCRE version)
Sebastian, Paul, Ubuntu 14.04 builds (for Linux 32 and 64 bit, ie i386 and amd64) of the (most current) pcre package (ie 8.35-7) for Ubuntu are now in my PPA at https://launchpad.net/~edd/+archive/ubuntu/misc/+packages These should work. You can add this PPA as I do in some Travis runs via sudo add-apt-repository -y ppa:edd/misc and then just do apt-get update; apt-get install libpcre3-dev which should do the trick -- but I haven't tested. Contact me off-list if you fail. Oh, and I guess we should have had this whole thread over on r-sig-debian. Best, Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel