[clblas] 62/125: Improved detection of the OpenCL dependencies during the 'copy' step A little refactoring of the FindOpenCL to make it more standard

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Fri May 29 06:57:22 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository clblas.

commit f607ed6026d4e7c84e933e2d93f4557133d142bb
Author: Kent Knox <kent.knox at amd>
Date:   Thu Mar 27 14:45:49 2014 -0500

    Improved detection of the OpenCL dependencies during the 'copy' step
    A little refactoring of the FindOpenCL to make it more standard
---
 src/FindOpenCL.cmake                    | 58 ++++++++++++++++-----------------
 src/tests/copyTestDependencies.cmake.in | 10 +++++-
 2 files changed, 38 insertions(+), 30 deletions(-)

diff --git a/src/FindOpenCL.cmake b/src/FindOpenCL.cmake
index 4491269..8725612 100644
--- a/src/FindOpenCL.cmake
+++ b/src/FindOpenCL.cmake
@@ -46,23 +46,17 @@
 #    target_link_libraries(foo ${OPENCL_LIBRARIES})
 #
 #-----------------------
-if( DEFINED ENV{AMDAPPSDKROOT} )
-	set( OPENCL_ROOT $ENV{AMDAPPSDKROOT} CACHE PATH "Environment variable defining the root of OPENCL implementation" )
-elseif( DEFINED ENV{CUDA_PATH} )
-        set( OPENCL_ROOT $ENV{CUDA_PATH} CACHE PATH "Environment variable defining the root of OPENCL implementation" )
-else( )
-	set( OPENCL_ROOT "/usr/lib" CACHE PATH "Environment variable defining the root of OPENCL implementation" )
-endif( )
 
 find_path(OPENCL_INCLUDE_DIRS
-	NAMES OpenCL/cl.h CL/cl.h
+    NAMES OpenCL/cl.h CL/cl.h
     HINTS
-		${OPENCL_ROOT}/include
-		ENV AMDAPPSDKROOT/include
-	PATHS
-		/usr/include
-		/usr/local/include
-	DOC "OpenCL header file path"
+        ${OPENCL_ROOT}/include
+        $ENV{AMDAPPSDKROOT}/include
+        $ENV{CUDA_PATH}/include
+    PATHS
+        /usr/include
+        /usr/local/include
+    DOC "OpenCL header file path"
 )
 mark_as_advanced( OPENCL_INCLUDE_DIRS )
 
@@ -70,23 +64,29 @@ mark_as_advanced( OPENCL_INCLUDE_DIRS )
 get_property( LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS )
 
 if( LIB64 )
-	find_library( OPENCL_LIBRARIES
-		NAMES OpenCL
-		HINTS
+    find_library( OPENCL_LIBRARIES
+        NAMES OpenCL
+        HINTS
             ${OPENCL_ROOT}/lib
-            ENV AMDAPPSDKROOT/lib
-		DOC "OpenCL dynamic library path"
-		PATH_SUFFIXES x86_64 x64
-	)
+            $ENV{AMDAPPSDKROOT}/lib
+            $ENV{CUDA_PATH}/lib
+        DOC "OpenCL dynamic library path"
+        PATH_SUFFIXES x86_64 x64
+        PATHS
+            /usr/lib
+    )
 else( )
-	find_library( OPENCL_LIBRARIES
-		NAMES OpenCL
-		HINTS
+    find_library( OPENCL_LIBRARIES
+        NAMES OpenCL
+        HINTS
             ${OPENCL_ROOT}/lib
-            ENV AMDAPPSDKROOT/lib
-		DOC "OpenCL dynamic library path"
-		PATH_SUFFIXES x86 Win32
-	)
+            $ENV{AMDAPPSDKROOT}/lib
+            $ENV{CUDA_PATH}/lib
+        DOC "OpenCL dynamic library path"
+        PATH_SUFFIXES x86 Win32
+        PATHS
+            /usr/lib
+    )
 endif( )
 mark_as_advanced( OPENCL_LIBRARIES )
 
@@ -94,5 +94,5 @@ include( FindPackageHandleStandardArgs )
 FIND_PACKAGE_HANDLE_STANDARD_ARGS( OPENCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS )
 
 if( NOT OPENCL_FOUND )
-	message( STATUS "FindOpenCL looked for libraries named: OpenCL" )
+    message( STATUS "FindOpenCL looked for libraries named: OpenCL" )
 endif()
diff --git a/src/tests/copyTestDependencies.cmake.in b/src/tests/copyTestDependencies.cmake.in
index 357ac7a..e42ddb8 100644
--- a/src/tests/copyTestDependencies.cmake.in
+++ b/src/tests/copyTestDependencies.cmake.in
@@ -34,13 +34,21 @@ endif( )
 set( depList "" )
 
 if( EXISTS "@ACML_ROOT@" )
-    list( APPEND depList "@ACML_ROOT@/lib" )
+    list( APPEND depList "@ACML_ROOT@/@ACML_SUBDIR@/lib" )
 endif( )
 
 if( EXISTS "@GTEST_ROOT@" )
     list( APPEND depList "@GTEST_ROOT@/lib at SUFFIX_LIB@" )
 endif( )
 
+if( EXISTS "@OPENCL_LIBRARIES@" )
+    get_filename_component( clLibName "@OPENCL_LIBRARIES@" NAME )
+    string( REPLACE ${clLibName} "" clLibDir "@OPENCL_LIBRARIES@" )
+    string( REGEX REPLACE "/+$" "" clLibDir ${clLibDir} )
+
+    list( APPEND depList "${clLibDir}" )
+endif( )
+ 
 if( EXISTS "${testDir}" )
     list( APPEND depList "${testDir}" )
     # On linux, the .so files are not staged with the rest of the executables

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/clblas.git



More information about the debian-science-commits mailing list