summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/cntk/lock-file.patch20
-rw-r--r--var/spack/repos/builtin/packages/cntk/package.py2
2 files changed, 22 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/cntk/lock-file.patch b/var/spack/repos/builtin/packages/cntk/lock-file.patch
new file mode 100644
index 0000000000..0e0a7811e7
--- /dev/null
+++ b/var/spack/repos/builtin/packages/cntk/lock-file.patch
@@ -0,0 +1,20 @@
+diff --git a/Source/Common/CrossProcessMutex.h b/Source/Common/CrossProcessMutex.h
+index 2f3ce70..f0fcd42 100644
+--- a/Source/Common/CrossProcessMutex.h
++++ b/Source/Common/CrossProcessMutex.h
+@@ -127,9 +127,13 @@ class CrossProcessMutex
+
+ public:
+ CrossProcessMutex(const std::string& name)
+- : m_fd(-1),
+- m_fileName("/var/lock/" + name)
++ : m_fd(-1)
+ {
++ const char * const envLockDir = getenv("CNTK_LOCK_DIR");
++ if (envLockDir != NULL)
++ m_fileName = envLockDir + ('/' + name);
++ else
++ m_fileName = "/var/lock/" + name;
+ }
+
+ // Acquires the mutex. If 'wait' is true and mutex is acquired by someone else then
diff --git a/var/spack/repos/builtin/packages/cntk/package.py b/var/spack/repos/builtin/packages/cntk/package.py
index d58165379c..dfc515730b 100644
--- a/var/spack/repos/builtin/packages/cntk/package.py
+++ b/var/spack/repos/builtin/packages/cntk/package.py
@@ -64,6 +64,8 @@ class Cntk(Package):
patch('build.patch')
# Patch to fix BLAS inconsistency between CNTK and KaldiReader
patch('kaldireader-openblas.patch')
+ # Patch to change behaviour of lock file - https://github.com/Microsoft/CNTK/issues/62
+ patch('lock-file.patch')
def install(self, spec, prefix):
args = []