Closed fgregg closed 13 years ago
I cannot reproduce this using R 2.12, pgfSweave 1.1.1 on my x86_64 Linux machine. Is there any other circumstances that cause the hang?
The namespace file for pgfSweave is fairly benign:
export("pgfSweaveDriver")
export("pgfSweave")
import(utils)
importFrom(digest, "digest")
importFrom(tools, "texi2dvi")
Could any of these things be causing it?
hmm... not sure. Where are the export, import, and importFrom functions from, so I can test this?
I dont actually know where you can access these functions, they are made available when loading a package namespace via loadNamespace
. See:
http://cran.r-project.org/doc/manuals/R-exts.html#Package-name-spaces
Does
loadNamespace('pgfSweave')
work?
No, it hangs! Well, we are narrowing it down.
The export, import, and importFrom functions seem to come from here: http://www.inside-r.org/r-doc/base/loadingNamespaceInfo
Not sure how to call them directly though, i.e.: namespaceExport("pgfSweave", "pgfSweaveDriver") Error in environmentIsLocked(ns) : not an environment
I am really stumped now, I cant see what would be causing the hang on your machine in particular. Do you have anything in your .Rprofile that could be conflicting or any other special configuration?
did you find the problem?
No, I haven't. I'm pretty stumped too.
I can send you the output of debug(loadNamespace) loadNamespace('pgfSweave')
I was just wondering since you closed the issue, I have reopened it.
Sure, you can post the output.
Would it be possible for you to hack the NAMESPACE file in pgfSweave to take out lines, reload the package and try again? If not I can send you versions of the package with different lines taken out. This would help to narrow down things even more.
Hmm... I could not reproduce this one either---using Ubuntu 10.04, R 2.12.1 from CRAN Debian package and pgfSweave 1.1.2.
Hmm.. so I hacked on the NAMESPACE file, for every combination, including an completely empty file, loadNamespace('pgfSweave') continues to hang.
I reinstalled pgfSweave and the install looks okay, but I post it here.
install.packages('pgfSweave')
Installing package(s) into '/home/fgregg/R/x86_64-redhat-linux-gnu-library/2.12'
(as 'lib' is unspecified)
trying URL 'http://cran.opensourceresources.org/src/contrib/pgfSweave_1.1.2.tar.gz'
Content type 'application/x-gzip' length 891660 bytes (870 Kb)
opened URL
==================================================
downloaded 870 Kb
* installing *source* package 'pgfSweave' ...
** libs
/usr/lib64/R/bin/Rscript ../exec/install-script.R
***********************
Failed to install custom pgfsweave script:
Thats ok! You can manually install it later.
***********************
gcc -m64 -std=gnu99 -I/usr/include/R -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c dummy.c -o dummy.o
gcc -m64 -std=gnu99 -shared -L/usr/local/lib64 -o pgfSweave.so dummy.o -L/usr/lib64/R/lib -lR
installing to /mnt/ide0/home/fgregg/R/x86_64-redhat-linux-gnu-library/2.12/pgfSweave/libs
** R
** exec
** inst
** preparing package for lazy loading
Loading required package: filehash
filehash: Simple key-value database (2.1-1 2010-10-04)
A Set of Tools for Administering SHared Repositories (0.3-3 2009-03-26)
tikzDevice: A Device for R Graphics Output in PGF/TikZ Format (v0.5.3)
Checking for a LaTeX compiler...
A working LaTeX compiler was found by checking:
The PATH using the command pdflatex
Global option tikzLatex set to:
/usr/bin/pdflatex
pdfeTeX 3.141592-1.21a-2.2 (Web2C 7.5.4)
kpathsea version 3.5.4
Loading required package: tools
Loading required package: codetools
Loading required package: parser
Loading required package: Rcpp
** help
*** installing help indices
converting help for package 'pgfSweave'
finding HTML links ... done
pgfSweave html
Rd warning: /var/tmp/RtmpF2AKlD/R.INSTALL2e00517d/pgfSweave/man/pgfSweave.Rd:74: missing file link 'tikzDevice'
pgfSweaveDriver html
Rd warning: /var/tmp/RtmpF2AKlD/R.INSTALL2e00517d/pgfSweave/man/pgfSweaveDriver.Rd:31: missing file link 'cacheSweaveDriver'
Rd warning: /var/tmp/RtmpF2AKlD/R.INSTALL2e00517d/pgfSweave/man/pgfSweaveDriver.Rd:53: missing file link 'tikzDevice'
Rd warning: /var/tmp/RtmpF2AKlD/R.INSTALL2e00517d/pgfSweave/man/pgfSweaveDriver.Rd:92: missing file link 'tikzDevice'
** building package indices ...
** testing if installed package can be loaded
* DONE (pgfSweave)
The downloaded packages are in
'/var/tmp/RtmpVVghnY/downloaded_packages'
Did you reinstall the version of the package that contains the edited namespace file? I may not have been clear in explaining, but I meant something like:
wget http://cran.r-project.org/src/contrib/pgfSweave_1.1.2.tar.gz
tar -xzf pgfSweave_1.1.2.tar.gz
cd pgfSweave
# edit NAMESPACE file in here
R CMD INSTALL .
# start R and try to load namespace...
# if it doesn't work, try a different combo in the NAMESPACE file,
# re-edit and try again
No joy.
hmm... What if you just remove the NAMESPACE file all together, then re-install the source package?
I get an error that pgfSweave does not have a name space.
Perhaps the problem is not the loading of the actual NAMESPACE file but what is hooked on to .onLoad http://www.inside-r.org/r-doc/base/.onLoad
Yeah, well it doesn't seem that one of the dependent packages is hanging so maybe it is the check for the correct version of pgf.
can you edit the R/zzz.R
file and remove the line in the .onLoad
function that calls checkPGFVersion2orDie()
? Then reinstall/reload.
It may be that this check is hanging.
That seems to have done it. Both loadNamespace('pgfSweave') and library(pgfSweave) work now.
Alright! Now we are getting somewhere.
Can you kindly download the following file
https://github.com/downloads/cameronbracken/pgfSweave/checkPGFVersion2orDie.R
Then run the following commands in a fresh R session. My guess is that it will hang.
library(tikzDevice)
source("checkPGFVersion2orDie.R")
checkPGFVersion2orDie()
so the problem seems to be that test-for-pgf.tex makes my pdflatex very unhappy. Here's a log file:
This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) (format=pdflatex 2010.12.14) 5 JAN 2011 16:13 entering extended mode **test-for-pgf.tex (./test-for-pgf.tex LaTeX2e <2003/12/01> Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur kish, ukrainian, nohyphenation, loaded. (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2004/02/16 v1.4f Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo File: size10.clo 2004/02/16 v1.4f Standard LaTeX file (size option) ) \c@part=\count79 \c@section=\count80 \c@subsection=\count81 \c@subsubsection=\count82 \c@paragraph=\count83 \c@subparagraph=\count84 \c@figure=\count85 \c@table=\count86 \abovecaptionskip=\skip41 \belowcaptionskip=\skip42 \bibindent=\dimen102 ) (/home/fgregg/share/texmf/tex/latex/pgf/frontendlayer/tikz.sty (/usr/share/texmf/tex/latex/pgf/pgf.sty Package: pgf 2004/10/08 ver 0.65 \pgf@objectcount=\count87
(/usr/share/texmf/tex/latex/graphics/graphicx.sty Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
(/usr/share/texmf/tex/latex/graphics/keyval.sty Package: keyval 1999/03/16 v1.13 key=value parser (DPC) \KV@toks@=\toks14 ) (/usr/share/texmf/tex/latex/graphics/graphics.sty Package: graphics 2001/07/07 v1.0n Standard LaTeX Graphics (DPC,SPQR)
(/usr/share/texmf/tex/latex/graphics/trig.sty Package: trig 1999/03/16 v1.09 sin cos tan (DPC) ) (/usr/share/texmf/tex/latex/graphics/graphics.cfg File: graphics.cfg 2005/02/03 v1.3 graphics configuration of teTeX/TeXLive ) Package graphics Info: Driver file: pdftex.def on input line 80.
(/usr/share/texmf/tex/latex/graphics/pdftex.def File: pdftex.def 2002/06/19 v0.03k graphics/color for pdftex \Gread@gobject=\count88 )) \Gin@req@height=\dimen103 \Gin@req@width=\dimen104 ) (/usr/share/texmf/tex/latex/xcolor/xcolor.sty Package: xcolor 2004/07/04 v2.00 LaTeX color extensions (UK)
(/usr/share/texmf/tex/latex/graphics/color.cfg
File: color.cfg 2005/02/03 v1.3 color configuration of teTeX/TeXLive
)
Package xcolor Info: Driver file: pdftex.def on input line 136.
Package xcolor Info: Color model cmy' added on input line 972. Package xcolor Info: Color model
hsb' added on input line 980.
Package xcolor Info: Color model HTML' added on input line 1000. Package xcolor Info: Color model
HSB' added on input line 1006.
Package xcolor Info: Color model `Gray' added on input line 1012.
)
\pgfex=\dimen105
\pgfem=\dimen106
\pgf@linewidth=\dimen107
\pgfpic=\box26
\pgf@hbox=\box27
\pgf@tempbox=\box28
\pgf@aax=\dimen108
\pgf@aay=\dimen109
\pgf@abx=\dimen110
\pgf@aby=\dimen111
\pgf@bax=\dimen112
\pgf@bay=\dimen113
\pgf@bbx=\dimen114
\pgf@bby=\dimen115
\pgf@tempdim=\dimen116
\pgf@x=\dimen117
\pgf@y=\dimen118
\pgf@xa=\dimen119
\pgf@ya=\dimen120
\pgf@xb=\dimen121
\pgf@yb=\dimen122
\pgf@xc=\dimen123
\pgf@yc=\dimen124
\pgfobjectbox=\box29
\pgf@xx=\dimen125
\pgf@xy=\dimen126
\pgf@yx=\dimen127
\pgf@yy=\dimen128
\pgf@zx=\dimen129
\pgf@zy=\dimen130
\pgf@counta=\count89
\pgf@countb=\count90
)
(/home/fgregg/share/texmf/tex/latex/pgf/utilities/pgffor.sty
(/home/fgregg/share/texmf/tex/latex/pgf/utilities/pgfrcs.sty
(/home/fgregg/share/texmf/tex/generic/pgf/utilities/pgfutil-common.tex
\pgfutil@everybye=\toks15
)
(/home/fgregg/share/texmf/tex/generic/pgf/utilities/pgfutil-latex.def
\pgfutil@abb=\box30
(/usr/share/texmf/tex/latex/ms/everyshi.sty Package: everyshi 2001/05/15 v3.00 EveryShipout Package (MS) )) (/home/fgregg/share/texmf/tex/generic/pgf/utilities/pgfrcs.code.tex Package: pgfrcs 2010/10/25 v2.10 (rcs-revision 1.24) )) (/home/fgregg/share/texmf/tex/latex/pgf/utilities/pgfkeys.sty (/home/fgregg/share/texmf/tex/generic/pgf/utilities/pgfkeys.code.tex \pgfkeys@pathtoks=\toks16 \pgfkeys@temptoks=\toks17
(/home/fgregg/share/texmf/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex \pgfkeys@tmptoks=\toks18 ))) (/home/fgregg/share/texmf/tex/generic/pgf/utilities/pgffor.code.tex Package: pgffor 2010/03/23 v2.10 (rcs-revision 1.18) \pgffor@iter=\dimen131 \pgffor@skip=\dimen132 \pgffor@stack=\toks19 \pgffor@toks=\toks20 )) (/home/fgregg/share/texmf/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex Package: tikz 2010/10/13 v2.10 (rcs-revision 1.76)
(/home/fgregg/share/texmf/tex/generic/pgf/libraries/pgflibraryplothandlers.code .tex File: pgflibraryplothandlers.code.tex 2010/05/31 v2.10 (rcs-revision 1.15)
! Undefined control sequence. \pgfsetplottension ...ttension {\pgf@sys@tonumber \pgf@x } l.104 \pgfsetplottension{0.5}
? \pgf@plot@mark@count=\count91 \pgfplotmarksize=\dimen133 ) \tikz@lastx=\dimen134 \tikz@lasty=\dimen135 \tikz@lastxsaved=\dimen136 \tikz@lastysaved=\dimen137 \tikzleveldistance=\dimen138 \tikzsiblingdistance=\dimen139 \tikz@figbox=\box31 \tikz@tempbox=\box32 \tikztreelevel=\count92 \tikznumberofchildren=\count93 \tikznumberofcurrentchild=\count94 \tikz@fig@count=\count95
! Package xcolor Error: Undefined color `pgftransparent'.
See the xcolor package documentation for explanation.
Type H
l.408 ...til@colorlet{transparent}{pgftransparent}
? ! Undefined control sequence. l.447 \pgfdeclareverticalshading [tikz@axis@top,tikz@axis@middle,tikz@axis@bo...
?
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H
l.447 \pgfdeclareverticalshading[ tikz@axis@top,tikz@axis@middle,tikz@axis@bo...
?
Overfull \hbox (91.14009pt too wide) in paragraph at lines 447--453 []\OT1/cmr/m/n/10 [tikz@axis@top,tikz@axis@middle,tikz@axis@bottom]axis100bpcol or(0bp)=(tikz@axis@bottom); []
Overfull \hbox (87.93637pt too wide) in paragraph at lines 447--453 \OT1/cmr/m/n/10 color(25bp)=(tikz@axis@bottom); color(50bp)=(tikz@axis@middle); color(75bp)=(tikz@axis@top); []
! Undefined control sequence. l.458 \pgfdeclareradialshading [tikz@ball]{ball}{\pgfqpoint{-10bp}{10bp}}{% ?
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H
l.458 \pgfdeclareradialshading[ tikz@ball]{ball}{\pgfqpoint{-10bp}{10bp}}{% ? ! Undefined control sequence. l.458 ...radialshading[tikz@ball]{ball}{\pgfqpoint {-10bp}{10bp}}{% ?
Overfull \hbox (66.26031pt too wide) in paragraph at lines 458--464 []\OT1/cmr/m/n/10 [tikz@ball]ball-10bp10bpcolor(0bp)=(tikz@ball!15!white); colo r(9bp)=(tikz@ball!75!white); []
Overfull \hbox (42.49178pt too wide) in paragraph at lines 458--464 \OT1/cmr/m/n/10 color(18bp)=(tikz@ball!70!black); color(25bp)=(tikz@ball!50!bla ck); color(50bp)=(black) []
! Undefined control sequence. l.467 \pgfdeclareradialshading [tikz@radial@inner,tikz@radial@outer]{radial}{...
?
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H
l.467 \pgfdeclareradialshading[ tikz@radial@inner,tikz@radial@outer]{radial}{...
? ! Undefined control sequence. l.467 ...ikz@radial@outer]{radial}{\pgfpointorigin }{% ?
Overfull \hbox (4.94533pt too wide) in paragraph at lines 467--471 []\OT1/cmr/m/n/10 [tikz@radial@inner,tikz@radial@outer]radialcolor(0bp)=(tikz@r adial@inner); []
! Undefined control sequence. l.720 \pgfresetnontranslationattimetrue % ? ! Undefined control sequence.
Wow, thats nasty. I don't have the know-how to diagnose this but it seems there a problem with your pgf/xcolor installation. The test-for-pgf.tex
file is literally 6 lines:
\documentclass{article}
\usepackage{tikz}
\batchmode
\makeatletter
\typeout{PGFVersion=\pgfversion}
\@@end
Can you load tikz in any other latex file?
\makeatletter
\typeout{PGFVersion=\pgfversion}
\@@end
It might be prudent to place the \typeout
before the \makeatletter
command. \makeatletter
is only required to invoke \@@end
(literally, "make @
a letter" so commands containing @
become valid and enabled)---while it is effect all sorts of things become "valid" LaTeX commands that maybe should not be.
good call, maybe try compiling
\documentclass{article}
\usepackage{tikz}
\batchmode
\typeout{PGFVersion=\pgfversion}
\makeatletter
\@@end
okay, I think the problem is that the pdflatex is loading the shared version of pgf.sty which is very old (ver 0.65) and not my local one. So one way you could test this with \usepackage{pgf} and looking at the log file for the version loaded
Yup, that was it. Made some changes to the directory where my local version of pgf was installed, and everything works now. Thanks for your help!
Awesome! Glad that got worked out.
pgfSweave 1.1.1 R 2.12 x86_64 GNU/Linux
To reproduce: library(tikzDevice) library(cacheSweave) library(highlight) library(getopt)
the
loadNamespace
function call hangs within