]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/numeric/ublas/clblas.jam
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / numeric / ublas / clblas.jam
1 # Copyright (c) 2018 Stefan Seefeld
2 #
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)
6
7 # Supports the clblas library
8 #
9 # After 'using clblas', the following targets are available:
10 #
11 # /clblas//clblas -- The clblas library
12
13 import project ;
14 import ac ;
15 import errors ;
16 import feature ;
17 import "class" : new ;
18 import targets ;
19 import modules ;
20 import property-set ;
21 import toolset : using ;
22
23 using opencl ;
24
25 header = clBLAS.h ;
26 names = clBLAS ;
27
28 library-id = 0 ;
29
30 if --debug-configuration in [ modules.peek : ARGV ]
31 {
32 .debug = true ;
33 }
34
35 # Initializes the clblas library.
36 #
37 # Options for configuring clblas::
38 #
39 # <search>
40 # The directory containing the clblas library.
41 # <name>
42 # Overrides the default library name.
43 # <include>
44 # The directory containing the clblas headers.
45 #
46 # Examples::
47 #
48 # # Find clblas in the default system location
49 # using clblas ;
50 # # Find clblas in /usr/local
51 # using clblas : 1.2.7
52 # : <include>/usr/local/include <search>/usr/local/lib ;
53 #
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
57 {
58 local caller = [ project.current ] ;
59
60 if ! $(.initialized)
61 {
62 .initialized = true ;
63
64 project.initialize $(__name__) ;
65 .project = [ project.current ] ;
66 project clblas ;
67 }
68
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) ] ;
72
73 if ! $(library-path) && ! $(include-path) && ! $(library-name)
74 {
75 is-default = true ;
76 }
77
78 condition = [ property-set.create $(requirements) ] ;
79 condition = [ property-set.create [ $(condition).base ] ] ;
80
81 if $(.configured.$(condition))
82 {
83 if $(is-default)
84 {
85 if $(.debug)
86 {
87 ECHO "notice: [clblas] clblas is already configured" ;
88 }
89 }
90 else
91 {
92 errors.user-error "clblas is already configured" ;
93 }
94 return ;
95 }
96 else
97 {
98 if $(.debug)
99 {
100 ECHO "notice: [clblas] Using pre-installed library" ;
101 if $(condition)
102 {
103 ECHO "notice: [clblas] Condition" [ $(condition).raw ] ;
104 }
105 }
106
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) ;
112 }
113 .configured.$(condition) = true ;
114 }