1 |
commit: 023edbbca8c5bb368ed32ce0fe44b54f9a537de4 |
2 |
Author: Sébastien Fabbro <bicatali <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jan 4 05:09:09 2017 +0000 |
4 |
Commit: Sebastien Fabbro <bicatali <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 4 06:02:05 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=023edbbc |
7 |
|
8 |
sci-libs/clblas: initial import |
9 |
|
10 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
11 |
|
12 |
sci-libs/clblas/Manifest | 1 + |
13 |
sci-libs/clblas/clblas-2.10.ebuild | 102 +++++++++++++++++++++ |
14 |
.../clblas-2.10-disable-multilib-cflags.patch | 20 ++++ |
15 |
.../files/clblas-2.10-fix-blas-dot-calls.patch | 59 ++++++++++++ |
16 |
.../files/clblas-2.10-fix-doxygen-output-dir.patch | 16 ++++ |
17 |
.../files/clblas-2.10-fix-pthread-linkage.patch | 18 ++++ |
18 |
.../files/clblas-2.10-use-boost-dynamic-libs.patch | 16 ++++ |
19 |
.../files/clblas-2.10-use-system-mathjax.patch | 18 ++++ |
20 |
sci-libs/clblas/metadata.xml | 29 ++++++ |
21 |
9 files changed, 279 insertions(+) |
22 |
|
23 |
diff --git a/sci-libs/clblas/Manifest b/sci-libs/clblas/Manifest |
24 |
new file mode 100644 |
25 |
index 00000000..7431ba3 |
26 |
--- /dev/null |
27 |
+++ b/sci-libs/clblas/Manifest |
28 |
@@ -0,0 +1 @@ |
29 |
+DIST clblas-2.10.tar.gz 1154117 SHA256 72a46cb92f6057d10b503ce23d62db73d7332eb0645bb8bca3337f4c0558b429 SHA512 5ed43104aae565292e0df4cc9e014cf483ccc0ff89257ebb5817f6508bfc9593585ed658da639f2167fbfb5d92ef116be4d5de3694f56e1a1e228bd42b1c05c6 WHIRLPOOL 1a96142dc0e7aad076d1e61508b943da8ac176bd889cac89a3cab1aab64a1d8a6bc207bda4483be7dc726af600b660370548ee06db4d28d4b6643b7bff9419e8 |
30 |
|
31 |
diff --git a/sci-libs/clblas/clblas-2.10.ebuild b/sci-libs/clblas/clblas-2.10.ebuild |
32 |
new file mode 100644 |
33 |
index 00000000..1769b44 |
34 |
--- /dev/null |
35 |
+++ b/sci-libs/clblas/clblas-2.10.ebuild |
36 |
@@ -0,0 +1,102 @@ |
37 |
+# Copyright 1999-2017 Gentoo Foundation |
38 |
+# Distributed under the terms of the GNU General Public License v2 |
39 |
+# $Id$ |
40 |
+ |
41 |
+EAPI=6 |
42 |
+ |
43 |
+PYTHON_COMPAT=( python{2_7,3_4,3_5} ) |
44 |
+FORTRAN_NEEDED=test |
45 |
+ |
46 |
+inherit cmake-utils python-single-r1 toolchain-funcs fortran-2 |
47 |
+ |
48 |
+MYPN="clBLAS" |
49 |
+ |
50 |
+DESCRIPTION="Library containing BLAS routines for OpenCL" |
51 |
+HOMEPAGE="https://github.com/clMathLibraries/clBLAS" |
52 |
+SRC_URI="https://github.com/clMathLibraries/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
53 |
+ |
54 |
+LICENSE="Apache-2.0" |
55 |
+SLOT="0/2" # soname version |
56 |
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" |
57 |
+IUSE="+client doc examples ktest performance test" |
58 |
+ |
59 |
+REQUIRED_USE="performance? ( ${PYTHON_REQUIRED_USE} )" |
60 |
+ |
61 |
+RDEPEND=" |
62 |
+ virtual/opencl |
63 |
+ doc? ( dev-libs/mathjax ) |
64 |
+ performance? ( ${PYTHON_DEPS} ) |
65 |
+" |
66 |
+DEPEND="${RDEPEND} |
67 |
+ doc? ( app-doc/doxygen ) |
68 |
+ test? ( |
69 |
+ dev-cpp/gtest |
70 |
+ dev-libs/boost |
71 |
+ virtual/pkgconfig |
72 |
+ virtual/blas |
73 |
+ ) |
74 |
+" |
75 |
+ |
76 |
+S="${WORKDIR}/${MYPN}-${PV}" |
77 |
+CMAKE_USE_DIR="${S}/src" |
78 |
+ |
79 |
+PATCHES=( |
80 |
+ "${FILESDIR}"/${P}-disable-multilib-cflags.patch |
81 |
+ "${FILESDIR}"/${P}-fix-blas-dot-calls.patch |
82 |
+ "${FILESDIR}"/${P}-fix-doxygen-output-dir.patch |
83 |
+ "${FILESDIR}"/${P}-fix-pthread-linkage.patch |
84 |
+ "${FILESDIR}"/${P}-use-boost-dynamic-libs.patch |
85 |
+ "${FILESDIR}"/${P}-use-system-mathjax.patch |
86 |
+) |
87 |
+ |
88 |
+src_configure() { |
89 |
+ local mycmakeargs=( |
90 |
+ -DBUILD_SHARED_LIBS=ON |
91 |
+ -DBUILD_RUNTIME=ON |
92 |
+ -DBUILD_SAMPLE=OFF |
93 |
+ -DBUILD_CLIENT="$(usex client)" |
94 |
+ -DBUILD_KTEST="$(usex ktest)" |
95 |
+ -DBUILD_PERFORMANCE="$(usex performance)" |
96 |
+ ) |
97 |
+ if use test; then |
98 |
+ mycmakeargs+=( |
99 |
+ -DBUILD_TEST=ON |
100 |
+ -DUSE_SYSTEM_GTEST=ON |
101 |
+ -DBLAS_LIBRARIES="$($(tc-getPKG_CONFIG) --libs blas)" |
102 |
+ ) |
103 |
+ else |
104 |
+ mycmakeargs+=( -DBUILD_TEST=OFF ) |
105 |
+ fi |
106 |
+ cmake-utils_src_configure |
107 |
+} |
108 |
+ |
109 |
+src_compile() { |
110 |
+ cmake-utils_src_compile |
111 |
+ if use doc; then |
112 |
+ cd doc |
113 |
+ doxygen clBLAS.doxy || die |
114 |
+ fi |
115 |
+} |
116 |
+ |
117 |
+src_test() { |
118 |
+ pushd "${BUILD_DIR}/staging" > /dev/null |
119 |
+ LD_LIBRARY_PATH="${BUILD_DIR}/library:${LD_LIBRARY_PATH}" \ |
120 |
+ ./test-short |
121 |
+ popd > /dev/null |
122 |
+ |
123 |
+ # horrible hack to avoid installing compiled tests |
124 |
+ # this will trigger some overcompilation |
125 |
+ mycmakeargs+=( -DBUILD_TEST=OFF ) |
126 |
+ cmake-utils_src_configure |
127 |
+} |
128 |
+ |
129 |
+src_install() { |
130 |
+ use doc && HTML_DOCS=( doc/html/. ) |
131 |
+ cmake-utils_src_install |
132 |
+ dodoc CHANGELOG CONTRIBUTING.md NOTICE README.md |
133 |
+ if use examples; then |
134 |
+ insinto /usr/share/doc/${PF}/examples |
135 |
+ doins -r src/samples/* |
136 |
+ docompress -x /usr/share/doc/${PF}/examples |
137 |
+ fi |
138 |
+} |
139 |
|
140 |
diff --git a/sci-libs/clblas/files/clblas-2.10-disable-multilib-cflags.patch b/sci-libs/clblas/files/clblas-2.10-disable-multilib-cflags.patch |
141 |
new file mode 100644 |
142 |
index 00000000..a7e59d9 |
143 |
--- /dev/null |
144 |
+++ b/sci-libs/clblas/files/clblas-2.10-disable-multilib-cflags.patch |
145 |
@@ -0,0 +1,20 @@ |
146 |
+Description: disable multilib flags |
147 |
+Author: Ghislain Antony Vaillant <ghisvail@×××××.com> |
148 |
+Forwarded: not-needed |
149 |
+--- |
150 |
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ |
151 |
+--- a/src/CMakeLists.txt |
152 |
++++ b/src/CMakeLists.txt |
153 |
+@@ -296,9 +296,9 @@ |
154 |
+ # Don't use -rpath. |
155 |
+ set(CMAKE_SKIP_RPATH ON CACHE BOOL "Skip RPATH" FORCE) |
156 |
+ |
157 |
+- set(CMAKE_C_FLAGS "-m${TARGET_PLATFORM} ${CMAKE_C_FLAGS}") |
158 |
+- set(CMAKE_CXX_FLAGS "-m${TARGET_PLATFORM} ${CMAKE_CXX_FLAGS}") |
159 |
+- set(CMAKE_Fortran_FLAGS "-m${TARGET_PLATFORM} ${CMAKE_Fortran_FLAGS}") |
160 |
++ #set(CMAKE_C_FLAGS "-m${TARGET_PLATFORM} ${CMAKE_C_FLAGS}") |
161 |
++ #set(CMAKE_CXX_FLAGS "-m${TARGET_PLATFORM} ${CMAKE_CXX_FLAGS}") |
162 |
++ #set(CMAKE_Fortran_FLAGS "-m${TARGET_PLATFORM} ${CMAKE_Fortran_FLAGS}") |
163 |
+ |
164 |
+ if(TARGET_PLATFORM EQUAL 32) |
165 |
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-builtin") |
166 |
|
167 |
diff --git a/sci-libs/clblas/files/clblas-2.10-fix-blas-dot-calls.patch b/sci-libs/clblas/files/clblas-2.10-fix-blas-dot-calls.patch |
168 |
new file mode 100644 |
169 |
index 00000000..cc2c6c3 |
170 |
--- /dev/null |
171 |
+++ b/sci-libs/clblas/files/clblas-2.10-fix-blas-dot-calls.patch |
172 |
@@ -0,0 +1,59 @@ |
173 |
+diff --git a/src/tests/correctness/blas-lapack.c b/src/tests/correctness/blas-lapack.c |
174 |
+index 9687bdf..54666b1 100644 |
175 |
+--- a/src/tests/correctness/blas-lapack.c |
176 |
++++ b/src/tests/correctness/blas-lapack.c |
177 |
+@@ -655,7 +655,7 @@ complex cdotu( int n, complex *x, int incx, complex *y, int incy) |
178 |
+ #elif defined( __APPLE__) |
179 |
+ cblas_cdotu_sub(n, x, incx, y, incy, &ans); |
180 |
+ #else |
181 |
+- cdotusub_(&n, x, &incx, y, &incy, &ans); |
182 |
++ ans = cdotu_(&n, x, &incx, y, &incy); |
183 |
+ #endif |
184 |
+ |
185 |
+ return ans; |
186 |
+@@ -670,7 +670,7 @@ doublecomplex zdotu( int n, doublecomplex *x, int incx, doublecomplex *y, int i |
187 |
+ #elif defined(__APPLE__) |
188 |
+ cblas_zdotu_sub(n, x, incx, y, incy, &ans); |
189 |
+ #else |
190 |
+- zdotusub_(&n, x, &incx, y, &incy, &ans); |
191 |
++ ans = zdotu_(&n, x, &incx, y, &incy); |
192 |
+ #endif |
193 |
+ |
194 |
+ return ans; |
195 |
+@@ -685,7 +685,7 @@ complex cdotc( int n, complex *x, int incx, complex *y, int incy) |
196 |
+ #elif defined(__APPLE__) |
197 |
+ cblas_cdotc_sub(n, x, incx, y, incy, &ans); |
198 |
+ #else |
199 |
+- cdotcsub_(&n, x, &incx, y, &incy, &ans); |
200 |
++ ans = cdotc_(&n, x, &incx, y, &incy); |
201 |
+ #endif |
202 |
+ |
203 |
+ return ans; |
204 |
+@@ -700,7 +700,7 @@ doublecomplex zdotc( int n, doublecomplex *x, int incx, doublecomplex *y, int i |
205 |
+ #elif defined(__APPLE__) |
206 |
+ cblas_zdotc_sub(n, x, incx, y, incy, &ans); |
207 |
+ #else |
208 |
+- zdotcsub_(&n, x, &incx, y, &incy, &ans); |
209 |
++ ans = zdotc_(&n, x, &incx, y, &incy); |
210 |
+ #endif |
211 |
+ |
212 |
+ return ans; |
213 |
+diff --git a/src/tests/correctness/blas-lapack.h b/src/tests/correctness/blas-lapack.h |
214 |
+index d2db1aa..8619e1e 100644 |
215 |
+--- a/src/tests/correctness/blas-lapack.h |
216 |
++++ b/src/tests/correctness/blas-lapack.h |
217 |
+@@ -1170,10 +1170,10 @@ double ddot_(int *n, double *x, int *incx, double* y, int *incy); |
218 |
+ complex cdotc_(int *n, complex *x, int *incx, complex* y, int *incy); |
219 |
+ doublecomplex zdotc_(int *n, doublecomplex *x, int *incx, doublecomplex* y, int *incy); |
220 |
+ #else |
221 |
+- void cdotusub_(int *n, complex *x, int *incx, complex* y, int *incy, complex *ans); |
222 |
+- void zdotusub_(int *n, doublecomplex *x, int *incx, doublecomplex* y, int *incy, doublecomplex *ans); |
223 |
+- void cdotcsub_(int *n, complex *x, int *incx, complex* y, int *incy, complex *ans); |
224 |
+- void zdotcsub_(int *n, doublecomplex *x, int *incx, doublecomplex* y, int *incy, doublecomplex *ans); |
225 |
++ complex cdotu_(int *n, complex *x, int *incx, complex* y, int *incy); |
226 |
++ doublecomplex zdotu_(int *n, doublecomplex *x, int *incx, doublecomplex* y, int *incy); |
227 |
++ complex cdotc_(int *n, complex *x, int *incx, complex* y, int *incy); |
228 |
++ doublecomplex zdotc_(int *n, doublecomplex *x, int *incx, doublecomplex* y, int *incy); |
229 |
+ #endif |
230 |
+ |
231 |
+ void sswap_(int *n, float *x, int *incx, float* y, int *incy); |
232 |
|
233 |
diff --git a/sci-libs/clblas/files/clblas-2.10-fix-doxygen-output-dir.patch b/sci-libs/clblas/files/clblas-2.10-fix-doxygen-output-dir.patch |
234 |
new file mode 100644 |
235 |
index 00000000..31abb89 |
236 |
--- /dev/null |
237 |
+++ b/sci-libs/clblas/files/clblas-2.10-fix-doxygen-output-dir.patch |
238 |
@@ -0,0 +1,16 @@ |
239 |
+Description: use system mathjax instead of remote |
240 |
+Author: Ghislain Antony Vaillant <ghisvail@×××××.com> |
241 |
+Forwarded: not-needed |
242 |
+--- |
243 |
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ |
244 |
+--- a/doc/clBLAS.doxy |
245 |
++++ b/doc/clBLAS.doxy |
246 |
+@@ -52,7 +52,7 @@ |
247 |
+ # If a relative path is entered, it will be relative to the location |
248 |
+ # where doxygen was started. If left blank the current directory will be used. |
249 |
+ |
250 |
+-OUTPUT_DIRECTORY = ..\..\bin\clBLAS.doxy |
251 |
++OUTPUT_DIRECTORY = |
252 |
+ |
253 |
+ # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create |
254 |
+ # 4096 sub-directories (in 2 levels) under the output directory of each output |
255 |
|
256 |
diff --git a/sci-libs/clblas/files/clblas-2.10-fix-pthread-linkage.patch b/sci-libs/clblas/files/clblas-2.10-fix-pthread-linkage.patch |
257 |
new file mode 100644 |
258 |
index 00000000..aa99529 |
259 |
--- /dev/null |
260 |
+++ b/sci-libs/clblas/files/clblas-2.10-fix-pthread-linkage.patch |
261 |
@@ -0,0 +1,18 @@ |
262 |
+Description: fix missing linkage with pthread |
263 |
+Author: Ghislain Antony Vaillant <ghisvail@×××××.com> |
264 |
+Forwarded: no |
265 |
+--- |
266 |
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ |
267 |
+--- a/src/library/CMakeLists.txt |
268 |
++++ b/src/library/CMakeLists.txt |
269 |
+@@ -888,6 +888,10 @@ |
270 |
+ set_target_properties( clBLAS PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/staging" ) |
271 |
+ target_link_libraries(clBLAS ${OPENCL_LIBRARIES} ${MATH_LIBRARY}) |
272 |
+ |
273 |
++set(THREADS_PREFER_PTHREAD_FLAG ON) |
274 |
++find_package(Threads REQUIRED) |
275 |
++target_link_libraries(clBLAS ${CMAKE_THREAD_LIBS_INIT}) |
276 |
++ |
277 |
+ # CPack configuration; include the executable into the package |
278 |
+ install( TARGETS clBLAS |
279 |
+ EXPORT Library |
280 |
|
281 |
diff --git a/sci-libs/clblas/files/clblas-2.10-use-boost-dynamic-libs.patch b/sci-libs/clblas/files/clblas-2.10-use-boost-dynamic-libs.patch |
282 |
new file mode 100644 |
283 |
index 00000000..57c585d |
284 |
--- /dev/null |
285 |
+++ b/sci-libs/clblas/files/clblas-2.10-use-boost-dynamic-libs.patch |
286 |
@@ -0,0 +1,16 @@ |
287 |
+Description: use Boost shared libraries instead of static |
288 |
+Author: Ghislain Antony Vaillant <ghisvail@×××××.com> |
289 |
+Forwarded: no |
290 |
+--- |
291 |
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ |
292 |
+--- a/src/CMakeLists.txt |
293 |
++++ b/src/CMakeLists.txt |
294 |
+@@ -270,7 +270,7 @@ |
295 |
+ |
296 |
+ # Find Boost on the system, and configure the type of boost build we want |
297 |
+ set( Boost_USE_MULTITHREADED ON ) |
298 |
+-set( Boost_USE_STATIC_LIBS ON ) |
299 |
++set( Boost_USE_STATIC_LIBS OFF ) |
300 |
+ set( Boost_DETAILED_FAILURE_MSG ON ) |
301 |
+ set( Boost_DEBUG ON ) |
302 |
+ set( Boost_ADDITIONAL_VERSIONS "1.44.0" "1.44" "1.47.0" "1.47" ) |
303 |
|
304 |
diff --git a/sci-libs/clblas/files/clblas-2.10-use-system-mathjax.patch b/sci-libs/clblas/files/clblas-2.10-use-system-mathjax.patch |
305 |
new file mode 100644 |
306 |
index 00000000..775a669 |
307 |
--- /dev/null |
308 |
+++ b/sci-libs/clblas/files/clblas-2.10-use-system-mathjax.patch |
309 |
@@ -0,0 +1,18 @@ |
310 |
+Description: fix output directory for documentation |
311 |
+ Use default doxygen directory, i.e. under docs/html, rather than the |
312 |
+ inappropriate path set by upstream. |
313 |
+Author: Ghislain Antony Vaillant <ghisvail@×××××.com> |
314 |
+Forwarded: no |
315 |
+--- |
316 |
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ |
317 |
+--- a/doc/clBLAS.doxy |
318 |
++++ b/doc/clBLAS.doxy |
319 |
+@@ -1223,7 +1223,7 @@ |
320 |
+ # installing MathJax. However, it is strongly recommended to install a local |
321 |
+ # copy of MathJax from http://www.mathjax.org before deployment. |
322 |
+ |
323 |
+-MATHJAX_RELPATH = http://www.mathjax.org/mathjax |
324 |
++MATHJAX_RELPATH = /usr/share/javascript/mathjax |
325 |
+ |
326 |
+ # The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension |
327 |
+ # names that should be enabled during MathJax rendering. |
328 |
|
329 |
diff --git a/sci-libs/clblas/metadata.xml b/sci-libs/clblas/metadata.xml |
330 |
new file mode 100644 |
331 |
index 00000000..cad01ed |
332 |
--- /dev/null |
333 |
+++ b/sci-libs/clblas/metadata.xml |
334 |
@@ -0,0 +1,29 @@ |
335 |
+<?xml version="1.0" encoding="UTF-8"?> |
336 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
337 |
+<pkgmetadata> |
338 |
+ <maintainer type="project"> |
339 |
+ <email>sci@g.o</email> |
340 |
+ <name>Gentoo Science Project</name> |
341 |
+ </maintainer> |
342 |
+ <longdescription> |
343 |
+ clBLAS is the code for the OpenCL BLAS portion of clMath. The |
344 |
+ complete set of BLAS level 1, 2 and 3 routines is implemented. See |
345 |
+ Netlib BLAS for the list of supported routines. In addition to GPU |
346 |
+ devices, the library also supports running on CPU devices to |
347 |
+ facilitate debugging and multicore programming. |
348 |
+ </longdescription> |
349 |
+ <use> |
350 |
+ <flag name="client"> |
351 |
+ Build a command line clBLAS client program. |
352 |
+ </flag> |
353 |
+ <flag name="ktest"> |
354 |
+ A command line tool for testing single clBLAS kernel. |
355 |
+ </flag> |
356 |
+ <flag name="performance"> |
357 |
+ Copy performance scripts that can measure and graph performance. |
358 |
+ </flag> |
359 |
+ </use> |
360 |
+ <upstream> |
361 |
+ <remote-id type="github">clMathLibraries/clBLAS</remote-id> |
362 |
+ </upstream> |
363 |
+</pkgmetadata> |