oneDPL icon indicating copy to clipboard operation
oneDPL copied to clipboard

CMake config cannot be used with macOS Homebrew

Open omor1 opened this issue 4 years ago • 5 comments

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)

omor1 avatar Apr 27 '20 21:04 omor1

Changing the pstlvars scripts would be necessary as well for this solution, of course.

omor1 avatar Apr 27 '20 21:04 omor1

vcpkg is doing something similar, which is a further signal that this may be the right approach (and that an upstream fix is necessary).

omor1 avatar Apr 27 '20 22:04 omor1

@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.

AlexVeprev avatar Apr 28 '20 07:04 AlexVeprev

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

omor1 avatar Apr 28 '20 20:04 omor1

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.

MikeDvorskiy avatar Apr 29 '20 15:04 MikeDvorskiy