From f6e2320ef07c6b2a30c4d725e598cb70fafafde1 Mon Sep 17 00:00:00 2001 From: Jimmy Tang Date: Sun, 2 Jul 2017 14:26:23 +0100 Subject: Apply patch to allow users to change path of lock file (#4649) See - https://github.com/Microsoft/CNTK/issues/62 --- .../repos/builtin/packages/cntk/lock-file.patch | 20 ++++++++++++++++++++ var/spack/repos/builtin/packages/cntk/package.py | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 var/spack/repos/builtin/packages/cntk/lock-file.patch (limited to 'var') 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 = [] -- cgit v1.2.3-70-g09d2