summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorGlenn Johnson <glenn-johnson@uiowa.edu>2022-02-04 10:56:21 -0600
committerGitHub <noreply@github.com>2022-02-04 10:56:21 -0600
commitd0019d704908f790386d2463fb33d1b36e4187b7 (patch)
treef78b2c3961b3c46d2575f50786bc5052e1e8bdd0 /var
parentcaa1a5cec7c0572284a9b9ee27b5004af80a853f (diff)
downloadspack-d0019d704908f790386d2463fb33d1b36e4187b7.tar.gz
spack-d0019d704908f790386d2463fb33d1b36e4187b7.tar.bz2
spack-d0019d704908f790386d2463fb33d1b36e4187b7.tar.xz
spack-d0019d704908f790386d2463fb33d1b36e4187b7.zip
cntk: fix build and add comments (#28676)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/cntk/package.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/cntk/package.py b/var/spack/repos/builtin/packages/cntk/package.py
index 12fdb857af..2973122db1 100644
--- a/var/spack/repos/builtin/packages/cntk/package.py
+++ b/var/spack/repos/builtin/packages/cntk/package.py
@@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+import os
+
from spack import *
@@ -15,6 +17,7 @@ class Cntk(Package):
url = "https://github.com/Microsoft/CNTK/archive/v2.0.tar.gz"
git = "https://github.com/Microsoft/CNTK.git"
+ # CNTK is not an active project since April 2019.
version('master', branch='master')
version('2.0', sha256='3adee17f166e2a682dfb551ca017ae5c3836ca9772c0af14215a7e76254f201c')
@@ -29,11 +32,11 @@ class Cntk(Package):
depends_on('openblas')
depends_on('mpi')
depends_on('boost')
- depends_on('protobuf')
+ depends_on('protobuf@3.10')
# CNTK depends on kaldi@c02e8.
# See https://github.com/Microsoft/CNTK/blob/master/Tools/docker/CNTK-CPUOnly-Image/Dockerfile#L105-L125
depends_on('kaldi@2015-10-07', when='+kaldi')
- depends_on('opencv', when='+opencv')
+ depends_on('opencv@:3+imgcodecs+imgproc', when='+opencv')
depends_on('cuda', when='+cuda')
depends_on('cub@1.4.1', when='+cuda')
depends_on('cudnn@5.1', when='+cuda')
@@ -49,6 +52,22 @@ class Cntk(Package):
# Patch to change behaviour of lock file - https://github.com/Microsoft/CNTK/issues/62
patch('lock-file.patch')
+ # It seems that cntk, at least version 2.0, can not be built with GCC
+ # beyond 4.8.5.
+ conflicts('%gcc@5:')
+
+ def patch(self):
+ protobuf_path = os.path.split(self.spec['protobuf'].libs[0])
+ protobuf_ld_flags = self.spec['protobuf'].libs.ld_flags
+
+ filter_file(r'(protobuf_check=)lib/libprotobuf\.a',
+ r'\1{0}/{1}'.format(os.path.basename(protobuf_path[0]),
+ protobuf_path[1]),
+ 'configure')
+ filter_file(r'\$\(PROTOBUF_PATH\)/lib/libprotobuf.a',
+ protobuf_ld_flags,
+ 'Makefile')
+
def install(self, spec, prefix):
args = []