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

Fresh CRAN issue on recent clang++ version #9

Closed
eddelbuettel opened this issue Sep 13, 2024 · 5 comments · Fixed by #10
Closed

Fresh CRAN issue on recent clang++ version #9

eddelbuettel opened this issue Sep 13, 2024 · 5 comments · Fixed by #10
Assignees

Comments

@eddelbuettel
Copy link
Owner

eddelbuettel commented Sep 13, 2024

Via two emails from CRAN:

Dear maintainer,

Please see the problems shown on
https://cran.r-project.org/web/checks/check_results_RcppFastAD.html.

Please correct before 2024-09-27 to safely retain your package on CRAN.

The CRAN Team

and

This looked like clang being picky, but it flagged a bigger problem in a
submission.

The overdue but supposedly imminent LLVM 19 has a different wording and
reports a different flag:

../inst/include/fastad_bits/forward/core/forward.hpp:107:63: warning:
passing no argument for the '...' parameter of a variadic macro is a C++20
extension [-Wc++20-extensions]

I will try to reproduce on the weekend and look into what may need fixing. @JamesYang007 if you have moment, take a peek too. We should be able to get clang18 in Ubuntu 25.04 containers (see here) and likely in Debian unstable. (Yup, clang-18 at version 18.1.8 in Debian unstable, easily accessible via r-base Rocker container.)

@eddelbuettel
Copy link
Owner Author

Can confirm that a) under clang++-18 (as in Debian) we see the warnings and that b) it goes away when we make it C++20:

root@37586cbd9d9d:/work# ./cleanup 
root@37586cbd9d9d:/work# R CMD INSTALL .
* installing to library ‘/usr/local/lib/R/site-library’
* installing *source* package ‘RcppFastAD’ ...
** using staged installation
** libs
using C++ compiler: ‘Debian clang version 18.1.8 (9)’
using C++20
clang++-18  -std=gnu++20 -I"/usr/share/R/include" -DNDEBUG -I../inst/include -I'/usr/lib/R/site-library/Rcpp/include' -I'/usr/lib/R/site-library/RcppEigen/include'     -fpic  -O2 -Wall -pipe -pedantic -Wno-unused-but-set-variable -fdiagnostics-color=always -Wformat    -c RcppExports.cpp -o RcppExports.o
clang++-18  -std=gnu++20 -I"/usr/share/R/include" -DNDEBUG -I../inst/include -I'/usr/lib/R/site-library/Rcpp/include' -I'/usr/lib/R/site-library/RcppEigen/include'     -fpic  -O2 -Wall -pipe -pedantic -Wno-unused-but-set-variable -fdiagnostics-color=always -Wformat    -c black_scholes.cpp -o black_scholes.o
clang++-18  -std=gnu++20 -I"/usr/share/R/include" -DNDEBUG -I../inst/include -I'/usr/lib/R/site-library/Rcpp/include' -I'/usr/lib/R/site-library/RcppEigen/include'     -fpic  -O2 -Wall -pipe -pedantic -Wno-unused-but-set-variable -fdiagnostics-color=always -Wformat    -c linear_regression.cpp -o linear_regression.o
clang++-18  -std=gnu++20 -I"/usr/share/R/include" -DNDEBUG -I../inst/include -I'/usr/lib/R/site-library/Rcpp/include' -I'/usr/lib/R/site-library/RcppEigen/include'     -fpic  -O2 -Wall -pipe -pedantic -Wno-unused-but-set-variable -fdiagnostics-color=always -Wformat    -c quadratic_expression.cpp -o quadratic_expression.o
clang++-18 -std=gnu++20 -Wl,-S -shared -L/usr/lib/R/lib -Wl,-z,relro -o RcppFastAD.so RcppExports.o black_scholes.o linear_regression.o quadratic_expression.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/00LOCK-work/00new/RcppFastAD/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (RcppFastAD)
root@37586cbd9d9d:/work# 

(This also adds -Wno-unused-but-set-variable to suppress some noise we get from RcppEigen.)

@eddelbuettel
Copy link
Owner Author

I am planning to make a new CRAN release, simply setting C++20 as the compilation standard. That forward path code is nifty and reasonably complex so best to leave it as is for now.

@JamesYang007
Copy link
Collaborator

Thanks for resolving this issue! Sorry I've been away on vacation.

@eddelbuettel
Copy link
Owner Author

No problem. It's not 'really resolved' more circumvented. If you need a little puzzle take a look at if / how we could make it C++17 compliant. Otherwise C++20 is an easy-ish way out. (And I proceeded because of the deadline, the change to C++20 is of course not meant to be final or definitive.)

@JamesYang007
Copy link
Collaborator

This looked like clang being picky, but it flagged a bigger problem in a
submission.

The overdue but supposedly imminent LLVM 19 has a different wording and
reports a different flag:

../inst/include/fastad_bits/forward/core/forward.hpp:107:63: warning:
passing no argument for the '...' parameter of a variadic macro is a C++20
extension [-Wc++20-extensions]

Grr this is annoying. I have a quick fix (though not as elegant as I would like). I'll submit a PR and link it.

@JamesYang007 JamesYang007 reopened this Sep 16, 2024
@JamesYang007 JamesYang007 linked a pull request Sep 16, 2024 that will close this issue
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 a pull request may close this issue.

2 participants