aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/tbb.scm
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-10-18 20:50:40 +0000
committerRicardo Wurmus <rekado@elephly.net>2021-10-19 06:28:26 +0000
commit0ceb01a1ed86df0b7f5e57d90efba1949f73e480 (patch)
tree066a160f246f6a0fa5b5a69593444f93e2b48e03 /gnu/packages/tbb.scm
parente486b2b674badc80627b11077b7df2ac1cab92d8 (diff)
downloadguix-0ceb01a1ed86df0b7f5e57d90efba1949f73e480.tar
guix-0ceb01a1ed86df0b7f5e57d90efba1949f73e480.tar.gz
gnu: Add tbb-for-salmon.
* gnu/packages/tbb.scm (tbb-for-salmon): New variable.
Diffstat (limited to 'gnu/packages/tbb.scm')
-rw-r--r--gnu/packages/tbb.scm78
1 files changed, 78 insertions, 0 deletions
diff --git a/gnu/packages/tbb.scm b/gnu/packages/tbb.scm
index 2aa31225df..252dc98f7c 100644
--- a/gnu/packages/tbb.scm
+++ b/gnu/packages/tbb.scm
@@ -25,6 +25,7 @@
#:use-module (guix git-download)
#:use-module (guix utils)
#:use-module (guix build-system cmake)
+ #:use-module (guix build-system gnu)
#:use-module (gnu packages))
(define-public tbb
@@ -52,3 +53,80 @@ It uses common C++ templates and coding style to eliminate tedious threading
implementation work. It provides parallel loop constructs, asynchronous
tasks, synchronization primitives, atomic operations, and more.")
(license asl2.0)))
+
+(define-public tbb-for-salmon
+ (package
+ (name "tbb")
+ (version "2020.3")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/01org/tbb")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0r9axsdlmacjlcnax4vkzg86nwf8lsx7wbqdi3wnryaxk0xvdcx6"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ (substitute* "build/common.inc"
+ (("export tbb_build_prefix.+$")
+ "export tbb_build_prefix?=guix\n"))
+
+ ;; Don't capture the build time and kernel version.
+ (substitute* "build/version_info_linux.sh"
+ (("uname -srv") "uname -s")
+ (("`date -u`") "01 Jan 1970"))
+
+ (substitute* "build/linux.inc"
+ (("os_kernel_version:=.*")
+ "os_kernel_version:=5\n")
+ (("os_version:=.*")
+ "os_version:=1\n"))))))
+ (outputs '("out" "doc"))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:test-target "test"
+ #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
+ (assoc-ref %outputs "out") "/lib"))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fail-on-test-errors
+ (lambda _
+ (substitute* "Makefile"
+ (("-\\$\\(MAKE") "$(MAKE"))))
+ (replace 'configure
+ (lambda* (#:key outputs #:allow-other-keys)
+ (substitute* "build/linux.gcc.inc"
+ (("LIB_LINK_FLAGS =")
+ (string-append "LIB_LINK_FLAGS = -Wl,-rpath="
+ (assoc-ref outputs "out") "/lib")))))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((doc (string-append
+ (assoc-ref outputs "doc") "/doc"))
+ (examples (string-append doc "/examples"))
+ (lib (string-append
+ (assoc-ref outputs "out") "/lib"))
+ (include (string-append
+ (assoc-ref outputs "out") "/include")))
+ (mkdir-p lib)
+ (for-each
+ (lambda (f)
+ (copy-file f
+ (string-append lib "/"
+ (basename f))))
+ (find-files "build/guix_release" "\\.so"))
+ (copy-recursively "doc" doc)
+ (copy-recursively "examples" examples)
+ (copy-recursively "include" include)))))))
+ (home-page "https://www.threadingbuildingblocks.org")
+ (synopsis "C++ library for parallel programming")
+ (description
+ "Threading Building Blocks (TBB) is a C++ runtime library that abstracts
+the low-level threading details necessary for optimal multi-core performance.
+It uses common C++ templates and coding style to eliminate tedious threading
+implementation work. It provides parallel loop constructs, asynchronous
+tasks, synchronization primitives, atomic operations, and more.")
+ (license asl2.0)))