1 # Copyright (c) 2018 Stefan Seefeld
3 # Use, modification and distribution is subject to the Boost Software
4 # License Version 1.0. (See accompanying file LICENSE_1_0.txt or
5 # http://www.boost.org/LICENSE_1_0.txt)
7 # Supports the clblas library
9 # After 'using clblas', the following targets are available:
11 # /clblas//clblas -- The clblas library
17 import "class" : new ;
21 import toolset : using ;
30 if --debug-configuration in [ modules.peek : ARGV ]
35 # Initializes the clblas library.
37 # Options for configuring clblas::
40 # The directory containing the clblas library.
42 # Overrides the default library name.
44 # The directory containing the clblas headers.
48 # # Find clblas in the default system location
50 # # Find clblas in /usr/local
51 # using clblas : 1.2.7
52 # : <include>/usr/local/include <search>/usr/local/lib ;
54 rule init ( version ? : # The clblas version (currently ignored)
55 options * : # A list of the options to use
56 requirements * ) # The requirements for the clblas target
58 local caller = [ project.current ] ;
64 project.initialize $(__name__) ;
65 .project = [ project.current ] ;
69 local library-path = [ feature.get-values <search> : $(options) ] ;
70 local include-path = [ feature.get-values <include> : $(options) ] ;
71 local library-name = [ feature.get-values <name> : $(options) ] ;
73 if ! $(library-path) && ! $(include-path) && ! $(library-name)
78 condition = [ property-set.create $(requirements) ] ;
79 condition = [ property-set.create [ $(condition).base ] ] ;
81 if $(.configured.$(condition))
87 ECHO "notice: [clblas] clblas is already configured" ;
92 errors.user-error "clblas is already configured" ;
100 ECHO "notice: [clblas] Using pre-installed library" ;
103 ECHO "notice: [clblas] Condition" [ $(condition).raw ] ;
107 local mt = [ new ac-library clblas : $(.project) : $(condition) :
108 $(include-path) : $(library-path) : $(library-name) ] ;
109 $(mt).set-header $(header) ;
110 $(mt).set-default-names $(names) ;
111 targets.main-target-alternative $(mt) ;
113 .configured.$(condition) = true ;