Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

first crack at checking compiler versions from R#474

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
eddelbuettel merged 1 commit intomasterfromfeature/minimal-compiler
May 14, 2016

Conversation

@eddelbuettel
Copy link
Member

currently limited to g++

works reasonably well -- log from my Ubuntu 15.10 box below

edd@max:~$ g++ --version | head -1                                  # defaultg++ (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010edd@max:~$ Rscript -e 'Rcpp:::compilerCheck("5.2.1")' [1] TRUEedd@max:~$ Rscript -e 'Rcpp:::compilerCheck("4.6.0")' [1] TRUEedd@max:~$ Rscript -e 'Rcpp:::compilerCheck("5.3.1")'               # what 16.04 has[1] FALSEedd@max:~$ CXX=g++-4.5 Rscript -e 'Rcpp:::compilerCheck("4.6.0")'   # old version[1] FALSEedd@max:~$

@JanMarvin
Copy link

intgccver(){return(  __GNUC__ *10000 +  \    __GNUC_MINOR__ *100     +  \    __GNUC_PATCHLEVEL__);}

Isn't this what you want?

@eddelbuettel
Copy link
MemberAuthor

@JanMarvin: Thanks. In fact,@dcdillon made a similar point ("just compileg++ -std=c+11 hello.cpp"). But I wanted something a little simpler and quicker.

We do actually have some tests in Rcpp already:

  • inst/include/Rcpp/platform/compiler.h tests for a variety of features needed around/before TR1
  • inst/discovery/cxx0x.R is an old (and outdated) check for minimal standards version

so I don't think the last word has been said. Right now it is more about helping usersright at the start of a build process, ie inconfigure. We had a number of unfortunate error reports when folks on older RHEL/CentOS attempted to build RcppArmadillo, and of course flamed out fabulously asg++-4.4 doesn't even buy you half a cup of joe anymore.

@eddelbuettel
Copy link
MemberAuthor

I'm going to merge this in, it is unlikely to cause harm as it isn't even exported yet.

@eddelbuetteleddelbuettel merged commit7a1dfa3 intomasterMay 14, 2016
@eddelbuetteleddelbuettel deleted the feature/minimal-compiler branchMay 14, 2016 13:44
@jjallaire
Copy link
Member

It would be cool to have a variation of this which could be called from Makevars and which throws an error when the minimum compiler version isn't met. The error would have a nice clear message indicating that the issue is the compiler version.

@eddelbuettel
Copy link
MemberAuthor

eddelbuettel commentedMay 14, 2016
edited
Loading

Certainly. The bigger question really is whether we want

  • full-blown compiler-based tests which actually test particular compiler features (a laplatform/compiler.h in the sources)
  • something lightweight to throw decent error messages either via Makevars (but then everybody has to modifyMakevars again)
  • or just build on this and call viaRscript from a shell scriptconfigure which people copy as is into their projects (if they currently do not useconfigure).

Making the error message nicer/more informative is easy. I was just happy when I realized that I could testg++ as well as the common environment variablesfrom R and use R to compare versions strings correctly. What we have here is a start, and possibly 'good enough' to replace what I just did in RcppArmadillo.

@jjallaire
Copy link
Member

I think that#2 (have folks add a line to Makevars) strikes the best
balance, especially since everyone already has a Makevars and this is
pretty much a boilderplate one-liner.

On Sat, May 14, 2016 at 12:27 PM, Dirk Eddelbuettel <
notifications@github.com> wrote:

Certainly. The bigger question really is whether we want

  • full-blown compiler-based tests which actually test particular
    compiler features (a la platform/compiler.h in the sources)
  • something lightweight to throw decent error messages either via
    Makevars (but then everybody has to modify Makevars again)
  • or just build on this and call via Rscript from a shell script
    configure which people call?

Making the error message nicer/more informative is easy. I was just happy
when I realized that I could test g++ as well as the common environment
variablesfrom R and use R to compare versions strings correctly. What
we have here is a start, and possibly 'good enough' to replace what I just
did in RcppArmadillo.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#474 (comment)

@eddelbuettel
Copy link
MemberAuthor

How do you suggest to hook it in? It is not just an expansion asPKG_CXXFLAGS ?

Or expand to something which gets called and remains silent on success but emits loud and clear error messages on failure?

@jjallaire
Copy link
Member

Yeah, I'd say silent on success and loud and clear error messages on
failure.

On Sat, May 14, 2016 at 12:33 PM, Dirk Eddelbuettel <
notifications@github.com> wrote:

How do you suggest to hook it in? It is not just an expansion as
PKG_CXXFLAGS ?

Or expand to something which gets called and remains silent on success but
emits loud and clear error messages on failure?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#474 (comment)

@eddelbuettel
Copy link
MemberAuthor

I thought about that while going for a run and I am not so sure we can 'break' cleanly there. It is R calling make calling our (Rscript-based ?) snippet. I still thinkconfigure is cleaner. To be seen...

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@eddelbuettel@JanMarvin@jjallaire

[8]ページ先頭

©2009-2025 Movatter.jp