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

clang16 warnings #34

Closed
Quentin62 opened this issue Jan 20, 2023 · 3 comments
Closed

clang16 warnings #34

Quentin62 opened this issue Jan 20, 2023 · 3 comments
Assignees
Labels
MixtComp Concern the C++ library RMixtCompIO Concern the RMixtCompIO package: R interface of the C++ library

Comments

@Quentin62
Copy link
Collaborator

Message from Brian:

clang 16 is being prepared for release in early March, so it is time to
start reporting its issues. See
https://www.stats.ox.ac.uk/pub/bdr/clang16/

Shortly these logs will appear as 'clang16' additional issues.

Please correct before 2023-02-16 to safely retain your package on CRAN.
(Some have much closer deadlines for other issues.)

README.txt

Tests as for fedora-clang but using clang 16.0.0git rather than 15.0.7.
This is scheduled for release on Mar 7th.

Currently using C23 as the default C standard (but C23 issues are
reported elsewhare).

Other details as
https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-devel-linux-x86_64-fedora-clang

References for Rf_length in system headers come from includeing R headers
before system headers rather than after: see 'Writing R Extnesions'.

The [-Wenum-constexpr-conversion] errors seen in

RSQLite

are from the old Boost headers.

std:unary_function was deprecated in C+11 and removed in C++17, and finally
in clang 16 in C++17 mode. Boost 1.80 was still using it.

RMixtCompIO.out

  • using log directory ‘/data/gannet/ripley/R/packages/tests-clang-trunk/RMixtCompIO.Rcheck’
  • using R Under development (unstable) (2023-01-20 r83646)
  • using platform: x86_64-pc-linux-gnu (64-bit)
  • R was compiled by
    clang version 16.0.0 (https://github.com/llvm/llvm-project.git 2133e8b9f942f91ec54e28c580fccf6d6b26c62e)
    GNU Fortran (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)
  • running under: Fedora Linux 36 (Workstation Edition)
  • using session charset: UTF-8
  • using option ‘--no-stop-on-test-error’
  • checking for file ‘RMixtCompIO/DESCRIPTION’ ... OK
  • checking extension type ... Package
  • this is package ‘RMixtCompIO’ version ‘4.0.8’
  • package encoding: UTF-8
  • checking package namespace information ... OK
  • checking package dependencies ... OK
  • checking if this is a source package ... OK
  • checking if there is a namespace ... OK
  • checking for executable files ... OK
  • checking for hidden files and directories ... OK
  • checking for portable file names ... OK
  • checking for sufficient/correct file permissions ... OK
  • checking whether package ‘RMixtCompIO’ can be installed ... [454s/374s] ERROR
    Installation failed.
    See ‘/data/gannet/ripley/R/packages/tests-clang-trunk/RMixtCompIO.Rcheck/00install.out’ for details.
  • DONE

Status: 1 ERROR
See
‘/data/gannet/ripley/R/packages/tests-clang-trunk/RMixtCompIO.Rcheck/00check.log’
for details.

Command exited with non-zero status 1
Time 6:16.95, 436.39 + 19.82

RMixtCompIO.log

@Quentin62 Quentin62 added MixtComp Concern the C++ library RMixtCompIO Concern the RMixtCompIO package: R interface of the C++ library labels Jan 20, 2023
@Quentin62
Copy link
Collaborator Author

the error seems to come from the sort overload for custom matrix
https://github.com/modal-inria/MixtComp/blob/master/MixtComp/src/lib/LinAlg/EigenMatrixBaseAddons.h#L237-L240

In file included from lib/Mixture/Functional/FunctionCS.cpp:23:
In file included from lib/Mixture/Functional/FuncCSClass.h:26:
In file included from lib/LinAlg/LinAlg.h:26:
In file included from lib/LinAlg/Typedef.h:27:
In file included from /usr/local/clang-trunk/bin/../include/c++/v1/string:576:
In file included from /usr/local/clang-trunk/bin/../include/c++/v1/string_view:1025:
In file included from /usr/local/clang-trunk/bin/../include/c++/v1/algorithm:1771:
In file included from /usr/local/clang-trunk/bin/../include/c++/v1/__algorithm/nth_element.h:15:
/usr/local/clang-trunk/bin/../include/c++/v1/__algorithm/sort.h:656:11: error: no viable overloaded '-='
__lm1 -= (__right_bitset == 0) ? difference_type(__detail::__block_size) : difference_type(0);
~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/clang-trunk/bin/../include/c++/v1/__algorithm/sort.h:859:20: note: in instantiation of function template specialization 'std::__bitset_partition<std::_ClassicAlgPolicy, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0>>::Iterator, std::__less &>' requested here
? std::__bitset_partition<_AlgPolicy, _RandomAccessIterator, _Compare>(__first, __last, __comp)
^
/usr/local/clang-trunk/bin/../include/c++/v1/__algorithm/sort.h:919:8: note: in instantiation of function template specialization 'std::__introsort<std::_ClassicAlgPolicy, std::__less &, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0>>::Iterator, false>' requested here
std::__introsort<_AlgPolicy,
^
/usr/local/clang-trunk/bin/../include/c++/v1/__algorithm/sort.h:983:10: note: in instantiation of function template specialization 'std::__sort<std::__less &, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0>>::Iterator>' requested here
std::__sort<_WrappedComp>(std::__unwrap_iter(__first), std::__unwrap_iter(__last), __wrapped_comp);
^
/usr/local/clang-trunk/bin/../include/c++/v1/__algorithm/sort.h:990:8: note: in instantiation of function template specialization 'std::__sort_impl<std::_ClassicAlgPolicy, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0>>::Iterator, std::__less>' requested here
std::__sort_impl<_ClassicAlgPolicy>(std::move(__first), std::move(__last), __comp);
^
/usr/local/clang-trunk/bin/../include/c++/v1/__algorithm/sort.h:996:8: note: in instantiation of function template specialization 'std::sort<Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0>>::Iterator, std::__less>' requested here
std::sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
^
lib/LinAlg/EigenMatrixBaseAddons.h:239:7: note: in instantiation of function template specialization 'std::sort<Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0>>::Iterator>' requested here
std::sort(derived().begin(), derived().end());
^
lib/Mixture/Functional/FunctionCS.cpp:237:10: note: in instantiation of member function 'Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0>>::sort' requested here
sortedT.sort();

@Quentin62
Copy link
Collaborator Author

Dockerfile provided by Vincent Dorie

Hi all,

I managed to get clang16 and libc++ (which was the real culprit for my package) built using Docker, built R itself, and reproduced the errors on the check page. I've attached the Docker file. Unfortunately, I'm using Apple silicon so things will need to be modified x86. Since I wasn't familiar with Docker to start, the procedure for me was:

  1. Install Docker, cd to folder with the Docker file
  2. Execute docker build -t clang .
  3. Execute docker run -i -t clang /bin/bash
  4. Run bin/R to install dependencies or compile packages

I hope that helps! I'm happy to answer any questions, but I would not say that I'm any kind of expert.

Best,
Vince

@Quentin62
Copy link
Collaborator Author

R-hub now provides a docker container and a github actions: r-hub/rhub-linux-builders#67 (comment)

@Quentin62 Quentin62 self-assigned this Feb 11, 2023
@Quentin62 Quentin62 mentioned this issue Feb 11, 2023
Quentin62 added a commit that referenced this issue Feb 12, 2023
* -= method for iterators

* boost -> std in multinomial statistics

* postfix operators for iterators

* prefix ++ -- return the value before application

* tests(MixtComp): change tolerance

* refactor(MixtComp): refactor deprecated std::iterator #38

* feat(RMixtCompIO): use c++17 as standard

* .clang-format added and applied on two sources

* doc

* doc

* corecting the corrections

* iterator include removed

* Correcting the corrections, once again

* missing ref

* trivial copy constructors removed

* unuglyfying

* ConstIterator(Iterator &other)

* ConstIterator(const Iterator &other)

---------

Co-authored-by: Vincent KUBICKI <vincent.kubicki@laposte.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MixtComp Concern the C++ library RMixtCompIO Concern the RMixtCompIO package: R interface of the C++ library
Projects
None yet
Development

No branches or pull requests

1 participant