oneDPL
oneDPL copied to clipboard
CMake config cannot be used with macOS Homebrew
This is a problem with some similarities to #16; see discussion on https://github.com/Homebrew/homebrew-core/issues/53751.
The gist is that CMake doesn't install stdlib
and that Homebrew (rightly) doesn't want to link the directory into /usr/local
. /usr/local/lib/cmake/ParallelSTL
is a symbolic link to the true install directory /usr/local/Cellar/parallelstl/<version>/lib/cmake/ParallelSTL
, but ParallelSTLTargets.cmake
doesn't recognize this, so tries to find stdlib
in /usr/local
rather than in /usr/local/Cellar/parallelstl/<version>
.
I'm not sure what the proper solution from your end is, but one way might be to install stdlib
into ${CMAKE_INSTALL_PREFIX}/include/pstl
and adjusting the INSTALL_INTERFACE
to accommodate:
- $<INSTALL_INTERFACE:stdlib>)
+ $<INSTALL_INTERFACE:include/pstl/stdlib>)
...
+install(DIRECTORY stdlib
+ DESTINATION include/pstl)
Changing the pstlvars
scripts would be necessary as well for this solution, of course.
vcpkg is doing something similar, which is a further signal that this may be the right approach (and that an upstream fix is necessary).
@MikeDvorskiy, could you please take a look? As you can see there is a request to install files from stdlib
along with other Parallel STL headers. If CMakeLists.txt
is supposed to be aligned with LLVM upstream, then this request should be considered in the upstream context.
LLVM upstream seems to handle this differently. The pstl stdlib headers are in the include
directory, but prefixed with __pstl_
(e.g. include/__pstl_algorithm
). The standard headers in the libcxx project will include the pstl headers if the Parallel STL was configured:
/* libcxx/include/algorithm */
#if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17
# include <__pstl_algorithm>
#endif
Alexey, I think the changes you mean (in CMakeLists.txt) should not be aligned with LLVM upstream. The "pseudo-standard" headers include/algorithm are not up-streamed/sync to LLVM repo.