eddelbuettel / rcppsimdjson

Rcpp Bindings for the 'simdjson' Header Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: C++17 standard requested but CXX17 is not defined

mem48 opened this issue · comments

Hi,

I'm testing RcppSimdJson to be a dependency for my package to replace rjson.

RcppSimdJson works well on my local machine, but I'm having problems with Travis when it tries to install the package

* installing *source* package ‘RcppSimdJson’ ...

** package ‘RcppSimdJson’ successfully unpacked and MD5 sums checked

** using staged installation

** setting up C++17

** libs

Error: C++17 standard requested but CXX17 is not defined

* removing ‘/home/travis/R/Library/RcppSimdJson’

Error in i.p(...) : 

  (converted from warning) installation of package ‘RcppSimdJson’ had non-zero exit status

Calls: <Anonymous> ... with_rprofile_user -> with_envvar -> force -> force -> i.p

Execution halted

The command "Rscript -e 'deps <- remotes::dev_package_deps(dependencies = NA);remotes::install_deps(dependencies = TRUE);if (!all(deps$package %in% installed.packages())) { message("missing: ", paste(setdiff(deps$package, installed.packages()), collapse=", ")); q(status = 1, save = "no")}'" failed and exited with 1 during .

Your build has been stopped.

I've tried adjusting my travis.yml based on what you have but I can't get it to work. DO you know why it is failing and how it can get it to work?

The branch of my package that I'm trying to get working is here: https://github.com/ropensci/opentripplanner/tree/newjson

You can look at what I do for Travis: https://github.com/eddelbuettel/rcppsimdjson/blob/master/.travis.yml

The "R pretends to have C++17 but doesn't really" error is also what we used to get on Solaris, but apparently the powers-that-be decided that it is not worth trying (we agree!) and the package is no longer built on Solaris.

Otherwise, these days, the code demands less than in the very beginning but a decent compiler is important. So maybe do as I do and roll your Travis to bionic if you can. If you are using somebody else's Travis framework, ask them. I happen to use my own which, oddly enough, "works for me". 😉

I tried just copying your yml but it did not work, you can see the last 3 commits in the build history are my trying different yml files https://travis-ci.org/github/ropensci/opentripplanner/builds

I've just pushed a change to dist: bionic to see if that works

Unfortunately not

You are mixing and matching the (default) Travis R setup and mine. That is not how it works.

If you're comfortable with Docker you can also use Docker inside Travis. See for example what I do for Rcpp. That way you can test locally til it works and then commit.

In any event: this is not a RcppSimdJson bug. Maybe the package simply has requirements outside of where you deploy your package, and if you can't change that, maybe just don't sweat it and stick with another JSON reader?

I suggest we close this.

@mem48 Travis is not using bionic... look...

Build system information
8Build language: r
9Build dist: bionic
10Build id: 715219972
11Job id: 715219973
12Runtime kernel version: 4.15.0-1028-gcp
13travis-build version: ab037d6b
14Build image provisioning date and time
15Mon Mar 25 16:52:50 UTC 2019
16Operating System Details
17Distributor ID:	Ubuntu
18Description:	Ubuntu 16.04.6 LTS
19Release:	16.04
20Codename:	xenial

The difference between you and @eddelbuettel appears to be that he requests "language:c" and you request "language:r". Travis explicitly states that R is not supported, it is only "community maintained".

Travis explicitly states that R is not supported, it is only "community maintained".

That is true but lots of R packages use Travis for CI, so it is a barrier to adopting RcppSimdJson

I appreciate that it is not a "bug"but I thought you may have come across this problem and know a quick fix. If you don't think you can help then close the issue.

That is true but lots of R packages use Travis for CI

And so does this one! The quick fix is to understand what Travis does, and needs. That ball is in your court for your package. Happy to help, but not something the package you filed an issue with needs to address as we build in both our own CI setup (also at Travis as I explained) and more importantly on every machine CRAN uses for us (apart from the two oldrel with old toolchains).

@mem48

I'll take a look.

I case anybody else has this problem the solution is to change your .travis.yml file like this:

language: R
cache: packages

before_install:
  - mkdir -p ~/.R
  - echo 'CXX17 = g++-7 -std=gnu++17 -fPIC' > ~/.R/Makevars

addons:
  apt:
    sources:
      - sourceline: 'ppa:ubuntu-toolchain-r/test'
    packages:
      - g++-7