RfastOfficial / Rfast2

A collection of Rfast2 functions for data analysis. Note 1: The vast majority of the functions accept matrices only, not data.frames. Note 2: Do not have matrices or vectors with have missing data (i.e NAs). We do no check about them and C++ internally transforms them into zeros (0), so you may get wrong results. Note 3: In general, make sure you give the correct input, in order to get the correct output. We do no checks and this is one of the many reasons we are fast.
38 stars 4 forks source link

Latest Rfast2 update is broken: error: no member named 'execution' in namespace 'std'; did you mean 'exception'? #23

Closed barracuda156 closed 1 year ago

barracuda156 commented 1 year ago

Now it fails to build on macOS 13:

  using C compiler: ‘clang version 15.0.7’
  using C++ compiler: ‘clang version 15.0.7’
  using C++17
  using SDK: ‘MacOSX13.3.sdk’
  /opt/local/bin/clang++-mp-15 -std=gnu++17 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/Rcpp/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/RcppArmadillo/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/RcppParallel/include' -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk   -fopenmp -fPIC  -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch x86_64  -c Eval.cpp -o Eval.o
  In file included from Eval.cpp:7:
  In file included from ../inst/include/Rfast2/templates.h:10:
  ../inst/include/Rfast2/parallel.h:15:9: warning: 201703L [-W#pragma-messages]
  #pragma message STR(__cplusplus)
          ^
  ../inst/include/Rfast2/parallel.h:19:9: warning: Parallel is supported [-W#pragma-messages]
  #pragma message "Parallel is supported"
          ^
  ../inst/include/Rfast2/parallel.h:43:28: error: no member named 'execution' in namespace 'std'; did you mean 'exception'?
              std::sort(std::execution::par, begin, end);
                        ~~~~~^~~~~~~~~
                             exception
  /opt/local/libexec/llvm-15/bin/../include/c++/v1/exception:100:29: note: 'exception' declared here
  class _LIBCPP_EXCEPTION_ABI exception
                              ^
  In file included from Eval.cpp:7:
  In file included from ../inst/include/Rfast2/templates.h:10:
  ../inst/include/Rfast2/parallel.h:43:39: error: no member named 'par' in 'std::exception'
              std::sort(std::execution::par, begin, end);
                        ~~~~~~~~~~~~~~~~^
  ../inst/include/Rfast2/parallel.h:60:35: error: no member named 'execution' in namespace 'std'; did you mean 'exception'?
              std::nth_element(std::execution::par, begin, middle, end);
                               ~~~~~^~~~~~~~~
                                    exception
  /opt/local/libexec/llvm-15/bin/../include/c++/v1/exception:100:29: note: 'exception' declared here
  class _LIBCPP_EXCEPTION_ABI exception
                              ^
  In file included from Eval.cpp:7:
  In file included from ../inst/include/Rfast2/templates.h:10:
  ../inst/include/Rfast2/parallel.h:60:46: error: no member named 'par' in 'std::exception'
              std::nth_element(std::execution::par, begin, middle, end);
                               ~~~~~~~~~~~~~~~~^
  ../inst/include/Rfast2/parallel.h:77:35: error: no member named 'execution' in namespace 'std'; did you mean 'exception'?
              std::nth_element(std::execution::par, begin, middle, end, cmp);
                               ~~~~~^~~~~~~~~
                                    exception
  /opt/local/libexec/llvm-15/bin/../include/c++/v1/exception:100:29: note: 'exception' declared here
  class _LIBCPP_EXCEPTION_ABI exception
                              ^
  In file included from Eval.cpp:7:
  In file included from ../inst/include/Rfast2/templates.h:10:
  ../inst/include/Rfast2/parallel.h:77:46: error: no member named 'par' in 'std::exception'
              std::nth_element(std::execution::par, begin, middle, end, cmp);
                               ~~~~~~~~~~~~~~~~^
  2 warnings and 6 errors generated.
  make: *** [Eval.o] Error 1
  ERROR: compilation failed for package ‘Rfast2’
barracuda156 commented 1 year ago

@ManosPapadakis95 @statlink Could you please take a look into this?

barracuda156 commented 1 year ago

Also fails on Linux: https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-fedora-clang/Rfast2-00install.html

ManosPapadakis95 commented 1 year ago

I am aware of this error. I have fixed it and wait for the mac builder's confirmation. Sorry for the inconvenience.

barracuda156 commented 1 year ago

Got it, thank you. Could you refer to the commit fixing it? I will pick that for a patch in Macports.

ManosPapadakis95 commented 1 year ago

I haven't committed yet and I left home. As soon as I return I will commit the changes. Thanks 🙏.

ManosPapadakis95 commented 1 year ago

Got it, thank you. Could you refer to the commit fixing it? I will pick that for a patch in Macports.

Choose the Dev branch. The latest commit is the fix for this. I am still waiting for the mac builder.

barracuda156 commented 1 year ago

@ManosPapadakis95 Thank you. As a temporary fix yesterday I patched the header to disable parallelization for Clangs. I guess you will make a new release for CRAN, given the problem is not local? If so, I will update the port with the new version rather than swiping one patch for another.

ManosPapadakis95 commented 1 year ago

Yes. I have to update with the fixed version but the mac builder is not responding! I will sent an email. I hope they will answer before the 9 of August where the deadline is.

Στις Τετ 19 Ιουλ 2023, 18:25 ο χρήστης Sergey Fedorov < @.***> έγραψε:

@ManosPapadakis95 https://github.com/ManosPapadakis95 Thank you. As a temporary fix yesterday I patched the header to disable parallelization for Clangs. I guess you will make a new release for CRAN, given the problem is not local? If so, I will update the port with the new version rather than swiping one patch for another.

— Reply to this email directly, view it on GitHub https://github.com/RfastOfficial/Rfast2/issues/23#issuecomment-1642300527, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANPP3FOUKG6IL4UKN4A6JB3XQ736LANCNFSM6AAAAAA2OT236U . You are receiving this because you were mentioned.Message ID: @.***>

barracuda156 commented 1 year ago

@ManosPapadakis95 On a side note, welcome to maintain your package in Macports! Just ping me if you decide to. Our buildbots test on 10.6 through 13 (unfortunately, no PowerPC as of now on build bots, but everything else is there).

ManosPapadakis95 commented 1 year ago

Thank you! For now I just want to update Rfast2 with any more moves 🤣.

durandg12 commented 1 year ago

Hello, any update? I have the same issue (on macOS 12.6).

This is the temporary fix I have found, it uses the remotes package and @ManosPapadakis95 previous answer: remotes::install_github("RfastOfficial/Rfast2", ref="Dev")

On a side note, I am suprised that the CRAN maintainers let this issue through, but I don't know about their processes.

ManosPapadakis95 commented 1 year ago

For now the submissions are closed due to vacation.

They left it because it is a small bug. All the other systems are ok.

barracuda156 commented 1 year ago

@ManosPapadakis95 The bug may be small as such, but it has broken Clangs builds on macOS (which is the standard compiler presently) and at least some Linuxes. “All other” are BeOS, DragonFlyBSD and AmigaOS? :)

ManosPapadakis95 commented 1 year ago

In linux you can choose gcc instead which is quite better! Personally, I don't know any person that uses linux with clang. I am sure there are some people out there but they must consider to change to gcc. Again, my opinion. For macos I don't have a solution. Maybe the guys in clang should make faster updates because they have left quite behind. The execution policy is tremendous addition to C++ and the macos people can't enjoy that perfomance.

barracuda156 commented 1 year ago

I actually use GCC on macOS, so you do not need to convince me, but Macports base defaults are beyond my control.

ManosPapadakis95 commented 1 year ago

Hahaha. I wonder those guys what were thinking. Anyway, I am not gonna add naything else in the dev repository. I am gonna release an new master and in 2 weeks from I will upload it to the cran.

barracuda156 commented 1 year ago

All looks good now, CI passed with Clangs.