diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2019-08-14 12:34:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-14 12:34:00 -0500 |
commit | 0f075b0cc8a17f956aa412dcd5282d4e1da49c4a (patch) | |
tree | 7945154a3ef7213d3af4cbff0a130020a9d615fe | |
parent | e620883a3cfc28d8cd80456368e122e5330a0191 (diff) | |
download | spack-0f075b0cc8a17f956aa412dcd5282d4e1da49c4a.tar.gz spack-0f075b0cc8a17f956aa412dcd5282d4e1da49c4a.tar.bz2 spack-0f075b0cc8a17f956aa412dcd5282d4e1da49c4a.tar.xz spack-0f075b0cc8a17f956aa412dcd5282d4e1da49c4a.zip |
NCCL: fix build on older Linux systems (#12415)
-rw-r--r-- | var/spack/repos/builtin/packages/nccl/package.py | 4 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/nccl/so_reuseport.patch | 16 |
2 files changed, 19 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/nccl/package.py b/var/spack/repos/builtin/packages/nccl/package.py index a64efc4c29..9f5d976adb 100644 --- a/var/spack/repos/builtin/packages/nccl/package.py +++ b/var/spack/repos/builtin/packages/nccl/package.py @@ -17,12 +17,14 @@ class Nccl(MakefilePackage): version('2.4.2-1', sha256='e3dd04b22eb541394bd818e5f78ac23a09cc549690d5d55d6fccc1a36155385a') version('2.3.7-1', sha256='e6eff80d9d2db13c61f8452e1400ca2f098d2dfe42857cb23413ce081c5b9e9b') version('2.3.5-5', sha256='bac9950b4d3980c25baa8e3e4541d2dfb4d21edf32ad3b89022d04920357142f') - version('2.2', '5b9ce7fbdce0fde68e0f66318e6ff422') version('1.3.4-1', '5b9ce7fbdce0fde68e0f66318e6ff422') version('1.3.0-1', 'f6fb1d56913a7d212ca0c300e76f01fb') depends_on('cuda') + # https://github.com/NVIDIA/nccl/issues/244 + patch('so_reuseport.patch', when='@2.3.7-1:2.4.8-1') + @property def build_targets(self): return ['CUDA_HOME={0}'.format(self.spec['cuda'].prefix)] diff --git a/var/spack/repos/builtin/packages/nccl/so_reuseport.patch b/var/spack/repos/builtin/packages/nccl/so_reuseport.patch new file mode 100644 index 0000000000..22202a87ee --- /dev/null +++ b/var/spack/repos/builtin/packages/nccl/so_reuseport.patch @@ -0,0 +1,16 @@ +diff --git a/src/include/socket.h b/src/include/socket.h +index 68ce235..b4f09b9 100644 +--- a/src/include/socket.h ++++ b/src/include/socket.h +@@ -327,7 +327,11 @@ static ncclResult_t createListenSocket(int *fd, union socketAddress *localAddr) + if (socketToPort(&localAddr->sa)) { + // Port is forced by env. Make sure we get the port. + int opt = 1; ++#if defined(SO_REUSEPORT) + SYSCHECK(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR | SO_REUSEPORT, &opt, sizeof(opt)), "setsockopt"); ++#else ++ SYSCHECK(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)), "setsockopt"); ++#endif + } + + // localAddr port should be 0 (Any port) |