| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 |
|
| 24 | (define-module (gnu packages tbb)
|
| 25 | #:use-module (guix packages)
|
| 26 | #:use-module (guix licenses)
|
| 27 | #:use-module (guix gexp)
|
| 28 | #:use-module (guix git-download)
|
| 29 | #:use-module (guix utils)
|
| 30 | #:use-module (guix build-system cmake)
|
| 31 | #:use-module (guix build-system gnu)
|
| 32 | #:use-module (gnu packages))
|
| 33 |
|
| 34 | (define-public tbb
|
| 35 | (package
|
| 36 | (name "tbb")
|
| 37 | (version "2021.6.0")
|
| 38 | (source (origin
|
| 39 | (method git-fetch)
|
| 40 | (uri (git-reference
|
| 41 | (url "https://github.com/uxlfoundation/oneTBB/")
|
| 42 | (commit (string-append "v" version))))
|
| 43 | (file-name (git-file-name name version))
|
| 44 | (sha256
|
| 45 | (base32
|
| 46 | "039v4jmnkkxs7haxrfmk9j57vfbrwlhjynlm5byfaqddv4cbsy0p"))
|
| 47 | (patches (search-patches "tbb-other-arches.patch"
|
| 48 | "tbb-gcc-14.patch"))))
|
| 49 | (build-system cmake-build-system)
|
| 50 | (arguments
|
| 51 | `(#:parallel-tests? #f
|
| 52 | #:configure-flags
|
| 53 | '(,@(if (or (target-riscv64?)
|
| 54 | (target-ppc32?))
|
| 55 | '("-DTBB_TEST_LINK_FLAGS=-latomic")
|
| 56 | `())
|
| 57 | ,@(if (or (target-arm32?)
|
| 58 | (target-ppc32?))
|
| 59 | '("-DTBB_TEST_COMPILE_FLAGS=-DTBB_TEST_LOW_WORKLOAD")
|
| 60 | `())
|
| 61 | "-DTBB_STRICT=OFF") |
| 62 | #:phases
|
| 63 | (modify-phases %standard-phases
|
| 64 | ,@(cond
|
| 65 | ((target-arm32?)
|
| 66 | `((add-after 'unpack 'adjust-test-suite
|
| 67 | (lambda _
|
| 68 | (substitute* "test/CMakeLists.txt"
|
| 69 | |
| 70 | ((".*test_malloc_pools.*") ""))))))
|
| 71 | ((target-ppc32?)
|
| 72 | `((add-after 'unpack 'adjust-test-suite
|
| 73 | (lambda _
|
| 74 | (substitute* "test/CMakeLists.txt"
|
| 75 | |
| 76 | ((".*test_function_node.*") "")
|
| 77 | ((".*test_multifunction_node.*") "")
|
| 78 | ((".*test_async_node.*") ""))))))
|
| 79 | (else '())))))
|
| 80 | (home-page "https://uxlfoundation.github.io/oneTBB/")
|
| 81 | (synopsis "C++ library for parallel programming")
|
| 82 | (description
|
| 83 | "@acronym{TBB, Threading Building Blocks} is a C++ runtime library that
|
| 84 | abstracts the low-level threading details necessary for optimal multi-core
|
| 85 | performance. It uses common C++ templates and coding style to eliminate
|
| 86 | tedious threading implementation work. It provides parallel loop constructs,
|
| 87 | asynchronous tasks, synchronization primitives, atomic operations, and more.")
|
| 88 | (license asl2.0)))
|
| 89 |
|
| 90 | (define-public tbb-2020
|
| 91 | (package
|
| 92 | (name "tbb")
|
| 93 | (version "2020.3")
|
| 94 | (source (origin
|
| 95 | (method git-fetch)
|
| 96 | (uri (git-reference
|
| 97 | (url "https://github.com/01org/tbb")
|
| 98 | (commit (string-append "v" version))))
|
| 99 | (file-name (git-file-name name version))
|
| 100 | (sha256
|
| 101 | (base32
|
| 102 | "0r9axsdlmacjlcnax4vkzg86nwf8lsx7wbqdi3wnryaxk0xvdcx6"))
|
| 103 | (modules '((guix build utils)))
|
| 104 | (snippet
|
| 105 | '(begin
|
| 106 | (substitute* "build/common.inc"
|
| 107 | (("export tbb_build_prefix.+$")
|
| 108 | "export tbb_build_prefix?=guix\n"))
|
| 109 |
|
| 110 | |
| 111 | (substitute* "build/version_info_linux.sh"
|
| 112 | (("uname -srv") "uname -s")
|
| 113 | (("`date -u`") "01 Jan 1970"))
|
| 114 |
|
| 115 | (substitute* "build/linux.inc"
|
| 116 | (("os_kernel_version:=.*")
|
| 117 | "os_kernel_version:=5\n")
|
| 118 | (("os_version:=.*")
|
| 119 | "os_version:=1\n"))))))
|
| 120 | (outputs '("out" "doc"))
|
| 121 | (build-system gnu-build-system)
|
| 122 | (arguments
|
| 123 | `(#:test-target "test"
|
| 124 | #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
|
| 125 | (assoc-ref %outputs "out") "/lib")
|
| 126 | "CFLAGS=-fuse-ld=gold"
|
| 127 | ,(string-append "CXXFLAGS="
|
| 128 | " -Wno-error=changes-meaning"
|
| 129 | " -Wno-error=template-id-cdtor"))
|
| 130 | #:phases
|
| 131 | (modify-phases %standard-phases
|
| 132 | (add-after 'unpack 'fail-on-test-errors
|
| 133 | (lambda _
|
| 134 | (substitute* "Makefile"
|
| 135 | (("-\\$\\(MAKE") "$(MAKE"))))
|
| 136 | (replace 'configure
|
| 137 | (lambda* (#:key outputs #:allow-other-keys)
|
| 138 | (substitute* "build/linux.gcc.inc"
|
| 139 | (("LIB_LINK_FLAGS =")
|
| 140 | (string-append "LIB_LINK_FLAGS = -Wl,-rpath="
|
| 141 | (assoc-ref outputs "out") "/lib")))))
|
| 142 | (replace 'install
|
| 143 | (lambda* (#:key outputs #:allow-other-keys)
|
| 144 | (let* ((doc (string-append
|
| 145 | (assoc-ref outputs "doc") "/doc"))
|
| 146 | (examples (string-append doc "/examples"))
|
| 147 | (lib (string-append
|
| 148 | (assoc-ref outputs "out") "/lib"))
|
| 149 | (include (string-append
|
| 150 | (assoc-ref outputs "out") "/include")))
|
| 151 | (mkdir-p lib)
|
| 152 | (for-each
|
| 153 | (lambda (f)
|
| 154 | (copy-file f
|
| 155 | (string-append lib "/"
|
| 156 | (basename f))))
|
| 157 | (find-files "build/guix_release" "\\.so"))
|
| 158 | (copy-recursively "doc" doc)
|
| 159 | (copy-recursively "examples" examples)
|
| 160 | (copy-recursively "include" include)))))))
|
| 161 | (native-inputs
|
| 162 | |
| 163 | |
| 164 | |
| 165 | (list (module-ref (resolve-interface
|
| 166 | '(gnu packages commencement))
|
| 167 | 'ld-gold-wrapper)))
|
| 168 | (home-page "https://www.threadingbuildingblocks.org")
|
| 169 | (synopsis "C++ library for parallel programming")
|
| 170 | (description
|
| 171 | "Threading Building Blocks (TBB) is a C++ runtime library that abstracts
|
| 172 | the low-level threading details necessary for optimal multi-core performance.
|
| 173 | It uses common C++ templates and coding style to eliminate tedious threading
|
| 174 | implementation work. It provides parallel loop constructs, asynchronous
|
| 175 | tasks, synchronization primitives, atomic operations, and more.")
|
| 176 | (license asl2.0)))
|