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

duration.cpp:96:7: error: no viable overloaded '-=' with nanotime 0.3.0 on Travis MacOS #74

Closed
mattdowle opened this issue Aug 7, 2020 · 5 comments

Comments

@mattdowle
Copy link
Contributor

mattdowle commented Aug 7, 2020

Just seen this from Travis MacOS. (Travis Linux seems ok, and it's ok on Linux locally for me).
https://travis-ci.org/github/Rdatatable/data.table/jobs/715689511

trying URL 'https://cloud.r-project.org/src/contrib/nanotime_0.3.0.tar.gz'
Content type 'application/x-gzip' length 535610 bytes (523 KB)
==================================================
downloaded 523 KB
* installing *source* package ‘nanotime’ ...
** package ‘nanotime’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Users/travis/R/Library/Rcpp/include' -I'/Users/travis/R/Library/RcppCCTZ/include' -I'/Users/travis/R/Library/RcppDate/include' -I/usr/local/include  -I../inst/include -fPIC  -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Users/travis/R/Library/Rcpp/include' -I'/Users/travis/R/Library/RcppCCTZ/include' -I'/Users/travis/R/Library/RcppDate/include' -I/usr/local/include  -I../inst/include -fPIC  -Wall -g -O2  -c duration.cpp -o duration.o
duration.cpp:96:7: error: no viable overloaded '-='
    d -= ns * std::chrono::nanoseconds(1);
    ~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode-9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/chrono:578:71: note: candidate function not viable: no known conversion from 'duration<[...], ratio<[...], 1000000000>>' to 'const duration<[...], ratio<[...], 1000000>>' for 1st argument
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator-=(const duration& __d) {__rep_ -= __d.count(); return *this;}
                                                                      ^
1 error generated.
make: *** [duration.o] Error 1
ERROR: compilation failed for package ‘nanotime’
* removing ‘/Users/travis/R/Library/nanotime’
* restoring previous ‘/Users/travis/R/Library/nanotime’
@eddelbuettel
Copy link
Owner

Uh-oh. We'll take a look. And make 0.3.1 if we need to.

@eddelbuettel
Copy link
Owner

Do we know "which" clang++ that is? clang++-9 on Ubuntu works fine (modulo some warnings...).

@eddelbuettel
Copy link
Owner

Same with -10.

@lsilvest
Copy link
Collaborator

lsilvest commented Aug 7, 2020

The issue is that std::chrono::system_cock is defined with microseconds instead of nanoseconds like on the other platforms. Not a difficult fix: I have tested it with clang under MacOS, and g++ under Ubuntu and will test on Windows in the unlikely event it causes an issue there.

@eddelbuettel
Copy link
Owner

The issue is that std::chrono::system_cock is defined with microseconds instead of nanoseconds like on the other platforms.

Ah yes. I think I once knew that too. But now I don't recall how e.g. RcppCCTZ danced around it ...

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