summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Tang <jcftang@gmail.com>2017-07-02 14:26:23 +0100
committerAdam J. Stewart <ajstewart426@gmail.com>2017-07-02 08:26:23 -0500
commitf6e2320ef07c6b2a30c4d725e598cb70fafafde1 (patch)
tree60a1b7a991bcc0c9c51628ae574282477be55216
parent182554520f68a742f3c2fb15f7121e1faf583aaa (diff)
downloadspack-f6e2320ef07c6b2a30c4d725e598cb70fafafde1.tar.gz
spack-f6e2320ef07c6b2a30c4d725e598cb70fafafde1.tar.bz2
spack-f6e2320ef07c6b2a30c4d725e598cb70fafafde1.tar.xz
spack-f6e2320ef07c6b2a30c4d725e598cb70fafafde1.zip
Apply patch to allow users to change path of lock file (#4649)
See - https://github.com/Microsoft/CNTK/issues/62
-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 = []