gnu: tensorflow: Enable parallel build (at least partially).
There are still many parts of the build that happen sequentially, but at least this hastens the long build somewhat. * gnu/packages/machine-learning.scm (tensorflow)[phases]: Remove trailing #t. {build-pip-package}: Honor the PARALLEL-BUILD? argument.
This commit is contained in:
parent
a91eaf1bdc
commit
92c3d1c3d0
1 changed files with 8 additions and 6 deletions
|
@ -1853,8 +1853,7 @@ set(eigen_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/external/eigen_archive "
|
||||||
(("tf_core_cpu grpc") "tf_core_cpu"))
|
(("tf_core_cpu grpc") "tf_core_cpu"))
|
||||||
|
|
||||||
;; This directory is a dependency of many targets.
|
;; This directory is a dependency of many targets.
|
||||||
(mkdir-p "protobuf")
|
(mkdir-p "protobuf")))
|
||||||
#t))
|
|
||||||
(add-after 'configure 'unpack-third-party-sources
|
(add-after 'configure 'unpack-third-party-sources
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
;; This is needed to configure bundled packages properly.
|
;; This is needed to configure bundled packages properly.
|
||||||
|
@ -1932,11 +1931,14 @@ COMPILE_FLAGS ${target_compile_flags} \
|
||||||
INSTALL_RPATH_USE_LINK_PATH TRUE \
|
INSTALL_RPATH_USE_LINK_PATH TRUE \
|
||||||
INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n")))))
|
INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n")))))
|
||||||
(add-after 'build 'build-pip-package
|
(add-after 'build 'build-pip-package
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs parallel-build? #:allow-other-keys)
|
||||||
(setenv "LDFLAGS"
|
(setenv "LDFLAGS"
|
||||||
(string-append "-Wl,-rpath="
|
(string-append "-Wl,-rpath="
|
||||||
(assoc-ref outputs "out") "/lib"))
|
(assoc-ref outputs "out") "/lib"))
|
||||||
(invoke "make" "tf_python_build_pip_package")))
|
(invoke "make" "-j" (if parallel-build?
|
||||||
|
(number->string (parallel-job-count))
|
||||||
|
"1")
|
||||||
|
"tf_python_build_pip_package")))
|
||||||
(add-after 'build-pip-package 'install-python
|
(add-after 'build-pip-package 'install-python
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||||
(let ((out (assoc-ref outputs "out"))
|
(let ((out (assoc-ref outputs "out"))
|
||||||
|
|
Reference in a new issue