Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved OS X Rcpp Compiler Information #433

Merged
merged 3 commits into from
Feb 7, 2016
Merged

Improved OS X Rcpp Compiler Information #433

merged 3 commits into from
Feb 7, 2016

Conversation

coatless
Copy link
Contributor

@coatless coatless commented Feb 7, 2016

Per discussion on the Rcpp dev list, here is a list of proposed changes for the OS X compilation section.

@eddelbuettel
Copy link
Member

OS X users: @kevinushey @jjallaire @thirdwing Any comments or good as is?

@thirdwing
Copy link
Member

👍

@hrbrmstr
Copy link

hrbrmstr commented Feb 7, 2016

In the patched Rnw file, when I compile it to PDF I'm not seeing any of the command lines in the

<<osx_xcode,engine='bash', eval = F>>=

and:

<<osx_openmp, engine="Rcpp", eval = F>>=

blocks (but this could just be me not compiling the Rnw file properly)

There are some refs to Maverick when it should be Mavericks.

\url{thecoatlessprofessor.com/programming/r-compiler-tools-for-rcpp-on-os-x/}

needs an http:// in front of it to be "clickable" in Preview.app

+100 for inclusion of the 4.8.2 gfortran d/l & install instructions.

Apart from that, these are really helpful instructions for folks on OS X, are spot-on, and pretty much (except for OpenMP which I don't use right now) all things I've had to do (and mimic what I've done).

I'd make the Rnw changes myself but remember just enough latex to be dangerous.

Side note: I'd feel a bit better if there was a "dummy" post written to r-sig-mac with some of the advice on The Coatless Professor's blog & linking to those vs linking to what could be a transient resource (if the r-sig-mac list archives go away then R is prbly gone too :-)

@coatless
Copy link
Contributor Author

coatless commented Feb 7, 2016

@eddelbuettel

  • It seems as if the FAQ is not 100% knitr based?
    • e.g. some section have <<lang=bash>> and <<lang=cpp>> instead of <<engine='bash'>> and <<engine='Rcpp'>>

@hrbrmstr

  • Fixed the one maverick reference & update url to have http://
  • The Coatless Professor will be around for a long time as it is my personal website and playground for new tech.
  • Instead of posting to r-sig-mac, it probably would be better if R updated: https://cran.r-project.org/bin/macosx/tools/ as it is currently sitting on gfortran 4.2.3

@hrbrmstr
Copy link

hrbrmstr commented Feb 7, 2016

Wasn't implying anything abt you speficially @coatless :-) I've got a longstanding personal site as well but wouldn't suggest linking to it as an official documentation source as I'm just a person vs an org. Just a personal pref.

@eddelbuettel
Copy link
Member

Just in from a longish run. To you young'nes: There was a time when we all wrote vignettes with Sweave. Nuttin' wrong with. Outside of R CMD foo ... it works eg via the (old) shell script below. I would not (have) let a tool as immature as knitr at my vignettes :) (but do know for shorter/other ones as eg in drat).

Will comment on substantial issues in a bit.

edd@max:~/bin$ cat sweave 
#!/bin/bash -e

function errorexit () {
    echo "Error: $1"
    exit 1
}

function filetest () {
    if [ ! -f $1 ]; then
       errorexit "File $1 not found"
    fi
    return 0
}


if [ "$#" -lt 1 ]; then
    errorexit "Need to specify argument file"
fi


BASENAME=$(basename $1 .Rnw)

RNWFILE=$BASENAME.Rnw
filetest $RNWFILE
echo "library(tools); Sweave(\"$RNWFILE\")" \
      | R --no-save --no-restore --slave

LATEXFILE=$BASENAME.tex
filetest $LATEXFILE && pdflatex $LATEXFILE

PDFFILE=$BASENAME.pdf
#filetest $PDFFILE && acroread $PDFFILE &
#filetest $PDFFILE && xpdf $PDFFILE &
#filetest $PDFFILE && kpdf $PDFFILE &
edd@max:~/bin$ 

eddelbuettel added a commit that referenced this pull request Feb 7, 2016
Improved OS X Rcpp Compiler Information
@eddelbuettel eddelbuettel merged commit 3e0e2ae into RcppCore:master Feb 7, 2016
@eddelbuettel
Copy link
Member

Turns out that script no longer works due to extra $ hanging around. Tst tst.

Oh wait. It's because I am loosing my marbles -- it is because we use the even-less-standard driver based on highlight. My apologies. This script does it:

edd@max:~/git/rcpp/vignettes(master)$ cat ~/bin/hilightsweave.R 
#!/usr/bin/Rscript

## use given argument(s) as target files, or else default to .Rnw files in directory
files <- if (length(commandArgs(TRUE)) == 0) dir(pattern="*.Rnw") else commandArgs(TRUE)

## convert all files from Rnw to pdf using the highlight driver
invisible(sapply(files, function(srcfile) {
    Sweave(srcfile, driver=highlight::HighlightWeaveLatex(boxes=TRUE))
    tools::texi2pdf(gsub(".Rnw", ".tex", srcfile))
    tools::texi2pdf(gsub(".Rnw", ".tex", srcfile), texi2dvi="pdflatex")
}))
edd@max:~/git/rcpp/vignettes(master)$ 

But for ease-of-use I replaced the 'published' version on my site with the current draft, so see here. Time to brew a new coffee and go over that.

With that, big thanks to @coatless and @hrbrmstr for updates and reviews!

@eddelbuettel
Copy link
Member

Some of James' markup was not of the right kind for our (admittedly non-standard) use of highlight.

I fixed that in 08ceaaf. New version copied to the same URL as above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants