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

Build failure on MacOS 14.7.1 #300

Open
lucbv opened this issue Jan 16, 2025 · 5 comments
Open

Build failure on MacOS 14.7.1 #300

lucbv opened this issue Jan 16, 2025 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@lucbv
Copy link

lucbv commented Jan 16, 2025

Hi all,
I am trying to build the library on my mac and hit the following build failure:

Building CXX object tests/native/CMakeFiles/gemv_no_ambig.dir/gemv_no_ambig.cpp.o
/Users/lberge/Research/kokkos_eco/sources/stdblas/tests/native/gemv_no_ambig.cpp:47:43: error: no member named 'par' in namespace 'std::execution'
   47 |     matrix_vector_product(std::execution::par,
      |                           ~~~~~~~~~~~~~~~~^

My compiler version is:

Apple clang version 16.0.0 (clang-1600.0.26.4)
Target: arm64-apple-darwin23.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

@lucbv lucbv added the bug Something isn't working label Jan 16, 2025
@lucbv
Copy link
Author

lucbv commented Jan 16, 2025

So to get passed this I simply hard coded #undef LINALG_HAS_EXECUTION in my local copy of stdblas.
Creating a CMake option that allows me to explicitly disable LINALG_HAS_EXECUTION would be helpful.

@lucbv
Copy link
Author

lucbv commented Jan 16, 2025

A second issue I run into now is the following:

In file included from /Users/lberge/Research/kokkos_eco/sources/stdblas/tests/native/iterator.cpp:1:
In file included from /Users/lberge/Research/kokkos_eco/sources/stdblas/tests/native/./gtest_fixtures.hpp:21:
In file included from /Users/lberge/Research/kokkos_eco/installs/gtest/include/gtest/gtest.h:55:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/memory:937:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__memory/ranges_uninitialized_algorithms.h:22:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__memory/uninitialized_algorithms.h:13:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__algorithm/copy.h:12:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__algorithm/copy_move_common.h:12:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__algorithm/iterator_operations.h:15:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__iterator/advance.h:58:7: error: no viable overloaded '+='
   58 |   __i += __n;
      |   ~~~ ^  ~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__iterator/advance.h:71:8: note: in instantiation of function template specialization 'std::__advance<(anonymous namespace)::MdspanRandomAccessIterator<double, Kokkos::extents<unsigned long, 18446744073709551615>, Kokkos::layout_stride, Kokkos::default_accessor<double>>>' requested here
   71 |   std::__advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());
      |        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__iterator/next.h:35:8: note: in instantiation of function template specialization 'std::advance<(anonymous namespace)::MdspanRandomAccessIterator<double, Kokkos::extents<unsigned long, 18446744073709551615>, Kokkos::layout_stride, Kokkos::default_accessor<double>>, long, long, void>' requested here
   35 |   std::advance(__x, __n);
      |        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__algorithm/iterator_operations.h:149:17: note: in instantiation of function template specialization 'std::next<(anonymous namespace)::MdspanRandomAccessIterator<double, Kokkos::extents<unsigned long, 18446744073709551615>, Kokkos::layout_stride, Kokkos::default_accessor<double>>, 0>' requested here
  149 |     return std::next(std::forward<_Iter>(__it), __n);
      |                 ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__algorithm/rotate.h:162:31: note: in instantiation of function template specialization 'std::_IterOps<std::_ClassicAlgPolicy>::next<(anonymous namespace)::MdspanRandomAccessIterator<double, Kokkos::extents<unsigned long, 18446744073709551615>, Kokkos::layout_stride, Kokkos::default_accessor<double>> &>' requested here
  162 |     if (_IterOps<_AlgPolicy>::next(__first) == __middle)
      |                               ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__algorithm/rotate.h:183:24: note: in instantiation of function template specialization 'std::__rotate_impl<std::_ClassicAlgPolicy, (anonymous namespace)::MdspanRandomAccessIterator<double, Kokkos::extents<unsigned long, 18446744073709551615>, Kokkos::layout_stride, Kokkos::default_accessor<double>>>' requested here
  183 |   auto __result = std::__rotate_impl<_AlgPolicy>(std::move(__first), std::move(__middle), __last_iter, _IterCategory());
      |                        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__algorithm/rotate.h:191:15: note: in instantiation of function template specialization 'std::__rotate<std::_ClassicAlgPolicy, (anonymous namespace)::MdspanRandomAccessIterator<double, Kokkos::extents<unsigned long, 18446744073709551615>, Kokkos::layout_stride, Kokkos::default_accessor<double>>, (anonymous namespace)::MdspanRandomAccessIterator<double, Kokkos::extents<unsigned long, 18446744073709551615>, Kokkos::layout_stride, Kokkos::default_accessor<double>>>' requested here
  191 |   return std::__rotate<_ClassicAlgPolicy>(std::move(__first), std::move(__middle), std::move(__last)).first;
      |               ^
/Users/lberge/Research/kokkos_eco/sources/stdblas/tests/native/iterator.cpp:239:10: note: in instantiation of function template specialization 'std::rotate<(anonymous namespace)::MdspanRandomAccessIterator<double, Kokkos::extents<unsigned long, 18446744073709551615>, Kokkos::layout_stride, Kokkos::default_accessor<double>>>' requested here
  239 |     std::rotate(begin(x), begin(x) + 1, end(x));
      |          ^
/Users/lberge/Research/kokkos_eco/sources/stdblas/tests/native/iterator.cpp:334:25: note: in instantiation of function template specialization '(anonymous namespace)::testRotateSort<double, Kokkos::extents<unsigned long, 18446744073709551615>, Kokkos::layout_stride, Kokkos::default_accessor<double>>' requested here
  334 |     const bool ok_col = testRotateSort(A_col0);
      |                         ^

@mhoemmen
Copy link
Contributor

Hi Luc! Could you try commenting out the definition of LINALG_HAS_EXECUTION on line 53? Lines 46 - 54 of include/experimental/__p1673_bits/macros.hpp would look like this as a result.

#if defined(__NVCOMPILER)
#  define LINALG_HAS_EXECUTION 1
#elif ! defined(__clang__) && ! defined(_MSC_VER) && ! defined(_INTEL_COMPILER) && ! defined(_INTEL_LLMV_COMPILER) && defined(__GNUC__)
#  if defined(LINALG_ENABLE_TBB)
#    define LINALG_HAS_EXECUTION 1
#  endif
#else
// #  define LINALG_HAS_EXECUTION 1
#endif

If that works, then we should be able to figure out a nicer way to express your compiler's needs. Thanks!

@lucbv
Copy link
Author

lucbv commented Jan 17, 2025

Hi Mark, commenting out the macro definition on line 53 does work as well.
Regarding the issue reported above with the missing operator+= of MdspanRandomAccessIterator , defining the operator in that class make the error disappear, now hitting a new issue:

In file included from /Users/lberge/Research/kokkos_eco/sources/stdblas/tests/native/iterator.cpp:2:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/algorithm:1847:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__algorithm/nth_element.h:15:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__algorithm/sort.h:573:40: error: invalid operands to binary expression ('(anonymous namespace)::MdspanRandomAccessIterator<double, Kokkos::extents<unsigned long, 18446744073709551615>, Kokkos::layout_stride, Kokkos::default_accessor<double>>' and '(anonymous namespace)::MdspanRandomAccessIterator<double, Kokkos::extents<unsigned long, 18446744073709551615>, Kokkos::layout_stride, Kokkos::default_accessor<double>>')
  573 |   bool __already_partitioned = __first >= __last;
      |                                ~~~~~~~ ^  ~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__algorithm/sort.h:844:42: note: in instantiation of function template specialization 'std::__bitset_partition<std::_ClassicAlgPolicy, (anonymous namespace)::MdspanRandomAccessIterator<double, Kokkos::extents<unsigned long, 18446744073709551615>, Kokkos::layout_stride, Kokkos::default_accessor<double>>, std::__less<void, void> &>' requested here
  844 |                                   ? std::__bitset_partition<_AlgPolicy, _RandomAccessIterator, _Compare>(__first, __last, __comp)
      |                                          ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__algorithm/sort.h:929:8: note: in instantiation of function template specialization 'std::__introsort<std::_ClassicAlgPolicy, std::__less<void, void> &, (anonymous namespace)::MdspanRandomAccessIterator<double, Kokkos::extents<unsigned long, 18446744073709551615>, Kokkos::layout_stride, Kokkos::default_accessor<double>>, false>' requested here
  929 |   std::__introsort<_AlgPolicy,
      |        ^
/Users/lberge/Research/kokkos_eco/sources/stdblas/tests/native/iterator.cpp:339:25: note: in instantiation of function template specialization '(anonymous namespace)::testRotateSort<double, Kokkos::extents<unsigned long, 18446744073709551615>, Kokkos::layout_stride, Kokkos::default_accessor<double>>' requested here
  339 |     const bool ok_col = testRotateSort(A_col0);
...

Help with this would also be greatly appreciated : )

@mhoemmen
Copy link
Contributor

I think I know what happened with LINALG_HAS_EXECUTION. Originally there were a few PRs (see e.g., #257 ) that aimed to fix it more comprehensively by adding CMake options (e.g., for enabling TBB). However, we ran out of time and ultimately had to fix use of the macro throughout the code base, without updating the logic for enabling it.

The iterators are completely superfluous; we should actually remove them from the repository.

I don't have a way to test on MacOS right now. Would you consider submitting a PR to fix this issues and verifying the fix locally? Thanks! : - )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants