| Issue |
58155
|
| Summary |
failed to build libcxx with LIBCXX_ENABLE_PARALLEL_ALGORITHMS=ON in release/15.x and main branch
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
multiSnow
|
cmake:
```shell
cd "<llvm-project>"
mkdir .build
cd .build
cmake \
-DLLVM_ENABLE_RUNTIMES='pstl;libcxxabi;libcxx' \
-DLIBCXX_ENABLE_PARALLEL_ALGORITHMS=ON \
-DCMAKE_BUILD_TYPE=Release \
../
```
error message (gcc 12.2.0):
```
In file included from <llvm-project>/pstl/include/__pstl_algorithm:13,
from <llvm-project>/.build/include/c++/v1/algorithm:1911,
from <llvm-project>/.build/include/c++/v1/array:536,
from <llvm-project>/.build/include/c++/v1/__functional/boyer_moore_searcher.h:24,
from <llvm-project>/.build/include/c++/v1/functional:515,
from <llvm-project>/libcxx/src/atomic.cpp:14:
<llvm-project>/pstl/include/pstl/internal/glue_algorithm_impl.h: In function ‘__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool> std::all_of(_ExecutionPolicy&&,
_ForwardIterator, _ForwardIterator, _Pred)’:
<llvm-project>/pstl/include/pstl/internal/glue_algorithm_impl.h:47:87: error: ‘not_fn’ is not a member of ‘std’
47 | return !std::any_of(std::forward<_ExecutionPolicy>(__exec), __first, __last, std::not_fn(__pred));
| ^~~~~~
<llvm-project>/pstl/include/pstl/internal/glue_algorithm_impl.h:23:1: note: ‘std::not_fn’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
22 | #include "execution_impl.h"
+++ |+#include <functional>
23 |
<llvm-project>/pstl/include/pstl/internal/glue_algorithm_impl.h: In function ‘__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::find_if_not(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate)’:
<llvm-project>/pstl/include/pstl/internal/glue_algorithm_impl.h:96:87: error: ‘not_fn’ is not a member of ‘std’
96 | return std::find_if(std::forward<_ExecutionPolicy>(__exec), __first, __last, std::not_fn(__pred));
| ^~~~~~
<llvm-project>/pstl/include/pstl/internal/glue_algorithm_impl.h:96:87: note: ‘std::not_fn’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
<llvm-project>/pstl/include/pstl/internal/glue_algorithm_impl.h: In function ‘__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::remove_copy_if(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Predicate)’:
<llvm-project>/pstl/include/pstl/internal/glue_algorithm_impl.h:444:97: error: ‘not_fn’ is not a member of ‘std’
444 | return std::copy_if(std::forward<_ExecutionPolicy>(__exec), __first, __last, __result, std::not_fn(__pred));
| ^~~~~~
<llvm-project>/pstl/include/pstl/internal/glue_algorithm_impl.h:444:97: note: ‘std::not_fn’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
make[2]: *** [libcxx/src/CMakeFiles/cxx_shared.dir/build.make:104: libcxx/src/CMakeFiles/cxx_shared.dir/atomic.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2616: libcxx/src/CMakeFiles/cxx_shared.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
```
error message (clang 15.0.1)
```
In file included from <llvm-project>/libcxx/src/atomic.cpp:14:
In file included from <llvm-project>/.build/include/c++/v1/functional:515:
In file included from <llvm-project>/.build/include/c++/v1/__functional/boyer_moore_searcher.h:24:
In file included from <llvm-project>/.build/include/c++/v1/array:536:
In file included from <llvm-project>/.build/include/c++/v1/algorithm:1911:
In file included from <llvm-project>/pstl/include/__pstl_algorithm:13:
<llvm-project>/pstl/include/pstl/internal/glue_algorithm_impl.h:47:87: error: no member named 'not_fn' in namespace 'std'
return !std::any_of(std::forward<_ExecutionPolicy>(__exec), __first, __last, std::not_fn(__pred));
~~~~~^
<llvm-project>/pstl/include/pstl/internal/glue_algorithm_impl.h:96:87: error: no member named 'not_fn' in namespace 'std'
return std::find_if(std::forward<_ExecutionPolicy>(__exec), __first, __last, std::not_fn(__pred));
~~~~~^
<llvm-project>/pstl/include/pstl/internal/glue_algorithm_impl.h:444:97: error: no member named 'not_fn' in namespace 'std'
return std::copy_if(std::forward<_ExecutionPolicy>(__exec), __first, __last, __result, std::not_fn(__pred));
~~~~~^
3 errors generated.
make[2]: *** [libcxx/src/CMakeFiles/cxx_shared.dir/build.make:104: libcxx/src/CMakeFiles/cxx_shared.dir/atomic.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2616: libcxx/src/CMakeFiles/cxx_shared.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
```
no error in building release/14.x
system: Linux 5.19.0-2-amd64
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs