[Beignet] [PATCH] buildsys: Use CMRT_LIBDIR instead of CMRT_LIBRARY_DIRS

Armin K. krejzi at email.com
Sat Oct 8 08:50:17 UTC 2016


On 8.10.2016 4:18, Guo, Yejun wrote:
> Hi Armin,
>
> thanks for your patch.
>
> We use pkg_check_modules(CMRT libcmrt) in path_of_beignet/CMakeList.txt Line 173 to detect libcmrt.  CMRT_INCLUDE_DIRS and CMRT_LIBRARY_DIRS are the expected macro to use, see https://cmake.org/cmake/help/v3.0/module/FindPkgConfig.html or https://cmake.org/cmake/help/v2.8.12/cmake.html. Could you explain a bit more of your environment? thanks.
>
> btw, do you use the feature to "make Beignet as intermedia layer of CMRT"? Want to know if any real cases from the community.
>
> thanks
> yejun
>

Hi Yejun,

As noted in the patch reply, CMRT_LIBRARY_DIRS is empty here.

Per cmake docs:

"<XPREFIX>_LIBRARY_DIRS   ... the paths of the libraries (w/o the '-L')"

There is no "-L..." in Libs: section of the libcmrt.pc file, because the 
file is installed in /usr/lib/pkgconfig, and autotools/pkgconfig will 
strip /usr/lib from library paths and /usr/include from include paths 
(per pkg-config default configuration).

CMRT_LIBDIR is however always set, as it reads libdir variable from the 
.pc file, and that one is expected to be always set.

And I don't use cmrt feature at all, I just happened to have libcmrt 
installed because I have intel-hybrid-driver for Skylake VP9 hybrid decoder.

Without this patch, the utest testing the cmrt code will fail. See also:

https://bugs.freedesktop.org/show_bug.cgi?id=94636

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Armin K
> Sent: Wednesday, October 05, 2016 10:33 PM
> To: beignet at lists.freedesktop.org
> Cc: Armin K
> Subject: [Beignet] [PATCH] buildsys: Use CMRT_LIBDIR instead of CMRT_LIBRARY_DIRS
>
> CMRT_LIBRARY_DIRS doesn't include any library paths
> when the library is installed system-wide, such as
> /usr.
>
> Also dlopen versioned library, as distros tend to
> split non-versioned sonames into -devel packages.
>
> Signed-off-by: Armin K <krejzi at email.com>
> ---
>  src/CMakeLists.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
> index a002865..82be7ff 100644
> --- a/src/CMakeLists.txt
> +++ b/src/CMakeLists.txt
> @@ -103,7 +103,7 @@ endif (X11_FOUND)
>
>  if (CMRT_FOUND)
>    set(CMAKE_CXX_FLAGS "-DHAS_CMRT ${CMAKE_CXX_FLAGS}")
> -  set(CMAKE_CXX_FLAGS "-DCMRT_PATH=${CMRT_LIBRARY_DIRS}/libcmrt.so ${CMAKE_CXX_FLAGS}")
> +  set(CMAKE_CXX_FLAGS "-DCMRT_PATH=${CMRT_LIBDIR}/libcmrt.so.1 ${CMAKE_CXX_FLAGS}")
>    set(CMAKE_C_FLAGS "-DHAS_CMRT ${CMAKE_C_FLAGS}")
>    set(OPENCL_SRC ${OPENCL_SRC} cl_cmrt.cpp)
>  endif (CMRT_FOUND)
>


More information about the Beignet mailing list