Re: [Rd] Trouble building package using R in development
To what end is the --vanilla here? Writing R Extensions says that R CMD check (and R CMD build) are invoked via R --vanilla so that would seem redundant, although my experience from several hours working this through today suggests there is a difference between R --vanilla CMD check and R CMD check. Maybe that's new? We've certainly had problems with R CMD reading user startup files, which is why we starting using --vanilla. Hadley -- Chief Scientist, RStudio http://had.co.nz/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Trouble building package using R in development
Dear List, I'm having considerable trouble setting up my environment (Linux, Fedora 16, Bash) to build and check packages under R Under Development (r61660). I'm doing this to better get a handle on difference in the output from running checks on examples in one of my packages. Note I compiled R Under Development myself The problem I am now having is whenever I try to build my analogue package using R Under Development, R complains about a dependency having been built before R 3.0.0. I obviously don't have my environment variables set correctly, but I don't see why or how R is finding my daily-use package library; if anything I would have expected it to fail with a missing dependency. If I start Rdevel with --vanilla (to mimic Rdevel CMD build) I see: .libPaths() [1] /home/gavin/R/devlibs /home/gavin/R/devel/build/library the first entry there is because I have temporarily set R_LIBS to that directory via export R_LIBS=/home/gavin/R/devlibs. From there we see I have versions of the dependencies installed in this library and they are built with 3.0.0: installed.packages(~/R/devlibs/)[, Built, drop = FALSE] Built analogue 3.0.0 ctv 3.0.0 permute 3.0.0 princurve 3.0.0 rgl 3.0.0 scatterplot3d 3.0.0 vegan 3.0.0 Note that there are no other versions of vegan inadvertently installed to the build directory for R Under Development. Following advice in Writing R Extensions I have also created ~/build.Renviron and ~/check.Renviron and as these are non-standard I also followed the advice to set R_BUILD_ENVIRON and R_CHECK_ENVIRON again temporarily via export: $ cat $R_CHECK_ENVIRON R_LIBS=/home/gavin/R/devlibs $ cat $R_BUILD_ENVIRON R_LIBS=/home/gavin/R/devlibs Yet still I get errors building analogue: $ Rdevel CMD build ../analogue/pkg/ * checking for file ‘../analogue/pkg/DESCRIPTION’ ... OK * preparing ‘analogue’: * checking DESCRIPTION meta-information ... OK * cleaning src * installing the package to re-build vignettes --- * installing *source* package ‘analogue’ ... ** libs gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c c_distx.c -o c_distx.o gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c c_distxy.c -o c_distxy.o gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c distx.c -o distx.o gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c distxy.c -o distxy.o gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c wastats.c -o wastats.o gcc -std=gnu99 -shared -L/usr/local/lib64 -o analogue.so c_distx.o c_distxy.o distx.o distxy.o wastats.o installing to /tmp/Rtmpctxbtv/Rinst30e3f762569/analogue/libs ** R ** data ** inst ** byte-compile and prepare package for lazy loading Error : package ‘vegan’ was built before R 3.0.0: please re-install it ERROR: lazy loading failed for package ‘analogue’ * removing ‘/tmp/Rtmpctxbtv/Rinst30e3f762569/analogue’ --- ERROR: package installation failed Can anyone suggest where to go from here? TIA Gavin -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Dr. Gavin Simpson [t] +44 (0)20 7679 0522 ECRC, UCL Geography, [f] +44 (0)20 7679 0565 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/ UK. WC1E 6BT. [w] http://www.freshwaters.org.uk %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Trouble building package using R in development
As a follow-up, shortly after I clicked send I decided to do something silly and rename my ~/.Renviron (which set R_LIBS too). Silly because the Writing R Extensions (WRE) manual says that these startup files are not read as R is invoked with --vanilla. Once I renamed ~/.Renviron so it was not being read I was able to build the package using R Under Development following the remaining instructions in the WRE note [1] So I do wonder if I have misunderstood the note in WRE or if there is some other issue here? Starting R --vanilla with R Under Development wasn't reading ~/.Renviron, and by renaming ~/.Renviron that I was able to build the package indicates that this file was implicated in the problem I described. Is it intentional that R CMD build reads ~/.Renviron ? If it is, then WRE should ideally clarify this or make it explicit. If it wasn't supposed to be read, is there a bug here? All the best, Gavin [1] http://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Checking-and-building-packages On Wed, 2013-01-16 at 16:05 +0100, Gavin Simpson wrote: Dear List, I'm having considerable trouble setting up my environment (Linux, Fedora 16, Bash) to build and check packages under R Under Development (r61660). I'm doing this to better get a handle on difference in the output from running checks on examples in one of my packages. Note I compiled R Under Development myself The problem I am now having is whenever I try to build my analogue package using R Under Development, R complains about a dependency having been built before R 3.0.0. I obviously don't have my environment variables set correctly, but I don't see why or how R is finding my daily-use package library; if anything I would have expected it to fail with a missing dependency. If I start Rdevel with --vanilla (to mimic Rdevel CMD build) I see: .libPaths() [1] /home/gavin/R/devlibs /home/gavin/R/devel/build/library the first entry there is because I have temporarily set R_LIBS to that directory via export R_LIBS=/home/gavin/R/devlibs. From there we see I have versions of the dependencies installed in this library and they are built with 3.0.0: installed.packages(~/R/devlibs/)[, Built, drop = FALSE] Built analogue 3.0.0 ctv 3.0.0 permute 3.0.0 princurve 3.0.0 rgl 3.0.0 scatterplot3d 3.0.0 vegan 3.0.0 Note that there are no other versions of vegan inadvertently installed to the build directory for R Under Development. Following advice in Writing R Extensions I have also created ~/build.Renviron and ~/check.Renviron and as these are non-standard I also followed the advice to set R_BUILD_ENVIRON and R_CHECK_ENVIRON again temporarily via export: $ cat $R_CHECK_ENVIRON R_LIBS=/home/gavin/R/devlibs $ cat $R_BUILD_ENVIRON R_LIBS=/home/gavin/R/devlibs Yet still I get errors building analogue: $ Rdevel CMD build ../analogue/pkg/ * checking for file ‘../analogue/pkg/DESCRIPTION’ ... OK * preparing ‘analogue’: * checking DESCRIPTION meta-information ... OK * cleaning src * installing the package to re-build vignettes --- * installing *source* package ‘analogue’ ... ** libs gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c c_distx.c -o c_distx.o gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c c_distxy.c -o c_distxy.o gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c distx.c -o distx.o gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c distxy.c -o distxy.o gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c wastats.c -o wastats.o gcc -std=gnu99 -shared -L/usr/local/lib64 -o analogue.so c_distx.o c_distxy.o distx.o distxy.o wastats.o installing to /tmp/Rtmpctxbtv/Rinst30e3f762569/analogue/libs ** R ** data ** inst ** byte-compile and prepare package for lazy loading Error : package ‘vegan’ was built before R 3.0.0: please re-install it ERROR: lazy loading failed for package
Re: [Rd] Trouble building package using R in development
On Wed, Jan 16, 2013 at 7:25 AM, Gavin Simpson gavin.simp...@ucl.ac.uk wrote: As a follow-up, shortly after I clicked send I decided to do something silly and rename my ~/.Renviron (which set R_LIBS too). Silly because the Writing R Extensions (WRE) manual says that these startup files are not read as R is invoked with --vanilla. Once I renamed ~/.Renviron so it was not being read I was able to build the package using R Under Development following the remaining instructions in the WRE note [1] So I do wonder if I have misunderstood the note in WRE or if there is some other issue here? Starting R --vanilla with R Under Development wasn't reading ~/.Renviron, and by renaming ~/.Renviron that I was able to build the package indicates that this file was implicated in the problem I described. Is it intentional that R CMD build reads ~/.Renviron ? If it is, then WRE should ideally clarify this or make it explicit. If it wasn't supposed to be read, is there a bug here? FYI, related posts: * Rd thread 'R devel [and R 2.14.1 patched]: R CMD build now sources ~/.Rprofile' on Feb 23, 2012 [https://stat.ethz.ch/pipermail/r-devel/2012-February/063365.html] * Rd thread 'R CMD build/check on Windows 7' on Jul 17, 2012 [https://stat.ethz.ch/pipermail/r-devel/2012-July/064427.html] To circumvent this, I check using: R --no-init-file CMD check foo_1.0.tar.gz /Henrik All the best, Gavin [1] http://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Checking-and-building-packages On Wed, 2013-01-16 at 16:05 +0100, Gavin Simpson wrote: Dear List, I'm having considerable trouble setting up my environment (Linux, Fedora 16, Bash) to build and check packages under R Under Development (r61660). I'm doing this to better get a handle on difference in the output from running checks on examples in one of my packages. Note I compiled R Under Development myself The problem I am now having is whenever I try to build my analogue package using R Under Development, R complains about a dependency having been built before R 3.0.0. I obviously don't have my environment variables set correctly, but I don't see why or how R is finding my daily-use package library; if anything I would have expected it to fail with a missing dependency. If I start Rdevel with --vanilla (to mimic Rdevel CMD build) I see: .libPaths() [1] /home/gavin/R/devlibs /home/gavin/R/devel/build/library the first entry there is because I have temporarily set R_LIBS to that directory via export R_LIBS=/home/gavin/R/devlibs. From there we see I have versions of the dependencies installed in this library and they are built with 3.0.0: installed.packages(~/R/devlibs/)[, Built, drop = FALSE] Built analogue 3.0.0 ctv 3.0.0 permute 3.0.0 princurve 3.0.0 rgl 3.0.0 scatterplot3d 3.0.0 vegan 3.0.0 Note that there are no other versions of vegan inadvertently installed to the build directory for R Under Development. Following advice in Writing R Extensions I have also created ~/build.Renviron and ~/check.Renviron and as these are non-standard I also followed the advice to set R_BUILD_ENVIRON and R_CHECK_ENVIRON again temporarily via export: $ cat $R_CHECK_ENVIRON R_LIBS=/home/gavin/R/devlibs $ cat $R_BUILD_ENVIRON R_LIBS=/home/gavin/R/devlibs Yet still I get errors building analogue: $ Rdevel CMD build ../analogue/pkg/ * checking for file ‘../analogue/pkg/DESCRIPTION’ ... OK * preparing ‘analogue’: * checking DESCRIPTION meta-information ... OK * cleaning src * installing the package to re-build vignettes --- * installing *source* package ‘analogue’ ... ** libs gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c c_distx.c -o c_distx.o gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c c_distxy.c -o c_distxy.o gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c distx.c -o distx.o gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c distxy.c -o distxy.o gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
Re: [Rd] Trouble building package using R in development
On Wed, Jan 16, 2013 at 8:59 AM, Henrik Bengtsson h...@biostat.ucsf.edu wrote: On Wed, Jan 16, 2013 at 7:25 AM, Gavin Simpson gavin.simp...@ucl.ac.uk wrote: As a follow-up, shortly after I clicked send I decided to do something silly and rename my ~/.Renviron (which set R_LIBS too). Silly because the Writing R Extensions (WRE) manual says that these startup files are not read as R is invoked with --vanilla. Once I renamed ~/.Renviron so it was not being read I was able to build the package using R Under Development following the remaining instructions in the WRE note [1] So I do wonder if I have misunderstood the note in WRE or if there is some other issue here? Starting R --vanilla with R Under Development wasn't reading ~/.Renviron, and by renaming ~/.Renviron that I was able to build the package indicates that this file was implicated in the problem I described. Is it intentional that R CMD build reads ~/.Renviron ? If it is, then WRE should ideally clarify this or make it explicit. If it wasn't supposed to be read, is there a bug here? FYI, related posts: * Rd thread 'R devel [and R 2.14.1 patched]: R CMD build now sources ~/.Rprofile' on Feb 23, 2012 [https://stat.ethz.ch/pipermail/r-devel/2012-February/063365.html] * Rd thread 'R CMD build/check on Windows 7' on Jul 17, 2012 [https://stat.ethz.ch/pipermail/r-devel/2012-July/064427.html] To circumvent this, I check using: R --no-init-file CMD check foo_1.0.tar.gz Should have clarified that in your case you need to add '--no-environ'. /Henrik /Henrik All the best, Gavin [1] http://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Checking-and-building-packages On Wed, 2013-01-16 at 16:05 +0100, Gavin Simpson wrote: Dear List, I'm having considerable trouble setting up my environment (Linux, Fedora 16, Bash) to build and check packages under R Under Development (r61660). I'm doing this to better get a handle on difference in the output from running checks on examples in one of my packages. Note I compiled R Under Development myself The problem I am now having is whenever I try to build my analogue package using R Under Development, R complains about a dependency having been built before R 3.0.0. I obviously don't have my environment variables set correctly, but I don't see why or how R is finding my daily-use package library; if anything I would have expected it to fail with a missing dependency. If I start Rdevel with --vanilla (to mimic Rdevel CMD build) I see: .libPaths() [1] /home/gavin/R/devlibs /home/gavin/R/devel/build/library the first entry there is because I have temporarily set R_LIBS to that directory via export R_LIBS=/home/gavin/R/devlibs. From there we see I have versions of the dependencies installed in this library and they are built with 3.0.0: installed.packages(~/R/devlibs/)[, Built, drop = FALSE] Built analogue 3.0.0 ctv 3.0.0 permute 3.0.0 princurve 3.0.0 rgl 3.0.0 scatterplot3d 3.0.0 vegan 3.0.0 Note that there are no other versions of vegan inadvertently installed to the build directory for R Under Development. Following advice in Writing R Extensions I have also created ~/build.Renviron and ~/check.Renviron and as these are non-standard I also followed the advice to set R_BUILD_ENVIRON and R_CHECK_ENVIRON again temporarily via export: $ cat $R_CHECK_ENVIRON R_LIBS=/home/gavin/R/devlibs $ cat $R_BUILD_ENVIRON R_LIBS=/home/gavin/R/devlibs Yet still I get errors building analogue: $ Rdevel CMD build ../analogue/pkg/ * checking for file ‘../analogue/pkg/DESCRIPTION’ ... OK * preparing ‘analogue’: * checking DESCRIPTION meta-information ... OK * cleaning src * installing the package to re-build vignettes --- * installing *source* package ‘analogue’ ... ** libs gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c c_distx.c -o c_distx.o gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c c_distxy.c -o c_distxy.o gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c distx.c -o distx.o gcc -std=gnu99 -I/home/gavin/R/devel/build/include -DNDEBUG -I/usr/local/include-fpic -g -O2 -pipe -m64 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=core2 -fasynchronous-unwind-tables -c
Re: [Rd] Trouble building package using R in development
To circumvent this, I check using: R --no-init-file CMD check foo_1.0.tar.gz In devtools, we take considerable care to match the R you're running with the R you're checking in, so we also set the following environmental variables: env - c( LC_ALL = C, R_LIBS = paste(.libPaths(), collapse = .Platform$path.sep), CYGWIN = nodosfilewarning, R_TESTS = , NOT_CRAN = true, TAR = auto_tar(), ) and always run /path/to/current/R --vanilla CMD check ... Hadley -- Chief Scientist, RStudio http://had.co.nz/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Trouble building package using R in development
On Wed, 2013-01-16 at 14:39 -0600, Hadley Wickham wrote: To circumvent this, I check using: R --no-init-file CMD check foo_1.0.tar.gz In devtools, we take considerable care to match the R you're running with the R you're checking in, so we also set the following environmental variables: snip / Thanks Henrik Hadley, and always run /path/to/current/R --vanilla CMD check ... To what end is the --vanilla here? Writing R Extensions says that R CMD check (and R CMD build) are invoked via R --vanilla so that would seem redundant, although my experience from several hours working this through today suggests there is a difference between R --vanilla CMD check and R CMD check. G Hadley -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Dr. Gavin Simpson [t] +44 (0)20 7679 0522 ECRC, UCL Geography, [f] +44 (0)20 7679 0565 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/ UK. WC1E 6BT. [w] http://www.freshwaters.org.uk %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel