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

R CMD build ignores CXX_STD #83

Closed
pat-s opened this issue Sep 25, 2018 · 8 comments
Closed

R CMD build ignores CXX_STD #83

pat-s opened this issue Sep 25, 2018 · 8 comments

Comments

@pat-s
Copy link
Contributor

pat-s commented Sep 25, 2018

Weird error, no clue if there is any relation to rcmdcheck(). However, I have no experience with setting compiler flags and I am wondering about the following behavior:

On Appveyor, the package gets installed successfully when using devtools::document() with -std=gnu99 https://ci.appveyor.com/project/pat-s/mlr#L13401

A few lines down in the rcmdcheck() process R CMD build is called and its not using the c++99 standard and fails therefore: https://ci.appveyor.com/project/pat-s/mlr#L13695

I've even set CXX_STD = CXX11 in src/Makevars but it seems to get ignored.
Any help here would be highly appreciated!

@gaborcsardi
Copy link
Member

Hi, I think this is probably a pkgbuild bug: r-lib/pkgbuild#46

@jimhester is there a manual workaround to add this flag, until pkgbuild is updated on CRAN?

@pat-s
Copy link
Contributor Author

pat-s commented Sep 25, 2018

Ah cool, that helps!

If there is no easy other option, maybe you can set Remotes: r-lib/pkgbuild in DESCRIPTION as a workaround until the CRAN version is released? This way I wouldn't have to use two forks on my side.

@jimhester
Copy link
Member

There isn't a great workaround unfortunately, I am going to submit a new version of pkgbuild soon however, so this should be fairly transient

@gaborcsardi
Copy link
Member

@pat-s Maybe you can call R CMD build manually, and then rcmdcheck() on the tarball. Then pkgbuild::build() won't be called.

@pat-s
Copy link
Contributor Author

pat-s commented Sep 25, 2018

@gaborcsardi
Copy link
Member

This is fixed in pkgbuild I believe.

@pat-s
Copy link
Contributor Author

pat-s commented Oct 23, 2018

While thepkgbuild update removed the lock of predefined compiler flags, I am desperately trying to set them correctly on appveyor.

As the pkgbuild code shows, it looks for user Makevars files: r-lib/pkgbuild@60162f8

However, creating one on appveyor or setting a pkg Makevars file as an alternative have no effect.
I also tried setting them as build_args but I thinks that's wrong: rcmdcheck(build_args = "--configure-args=-std=gnu99")

Spent hours already trying various options. I have no exp with CPP, just trying to get appveyor running again :/ Any help would be highly appreciated!

Here is an exemplary failing build: https://ci.appveyor.com/project/mlr-org/mlr/builds/19737175

cc @jimhester

@pat-s
Copy link
Contributor Author

pat-s commented Oct 24, 2018

Ok, got it working - issue posting helps ;) https://ci.appveyor.com/project/mlr-org/mlr/builds/19737512

Solution was to create a src/Makevars with the following contents:

PKG_CPPFLAGS += -std=gnu99

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

No branches or pull requests

3 participants