We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
CUDA stubs path missing
In order for the NVML and other libraries to be found, one needs to add 
$CUDA_ROOT/lib64/stubs to $LIBRARY_PATH (not $LD_LIBRARY_PATH)



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `easybuild/easyblocks/c/cuda.py`
Content:
```
1 ##
2 # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild
3 #
4 # Copyright:: Copyright 2012-2018 Cyprus Institute / CaSToRC, Uni.Lu, NTUA, Ghent University, Forschungszentrum Juelich GmbH
5 # Authors::   George Tsouloupas <g.tsouloupas@cyi.ac.cy>, Fotis Georgatos <fotis@cern.ch>, Kenneth Hoste, Damian Alvarez
6 # License::   MIT/GPL
7 # $Id$
8 #
9 # This work implements a part of the HPCBIOS project and is a component of the policy:
10 # http://hpcbios.readthedocs.org/en/latest/HPCBIOS_2012-99.html
11 ##
12 """
13 EasyBuild support for CUDA, implemented as an easyblock
14 
15 Ref: https://speakerdeck.com/ajdecon/introduction-to-the-cuda-toolkit-for-building-applications
16 
17 @author: George Tsouloupas (Cyprus Institute)
18 @author: Fotis Georgatos (Uni.lu)
19 @author: Kenneth Hoste (Ghent University)
20 @author: Damian Alvarez (Forschungszentrum Juelich)
21 """
22 import os
23 import stat
24 
25 from distutils.version import LooseVersion
26 
27 from easybuild.easyblocks.generic.binary import Binary
28 from easybuild.framework.easyconfig import CUSTOM
29 from easybuild.tools.filetools import adjust_permissions, patch_perl_script_autoflush, write_file
30 from easybuild.tools.run import run_cmd, run_cmd_qa
31 from easybuild.tools.systemtools import get_shared_lib_ext
32 
33 # Wrapper script definition
34 WRAPPER_TEMPLATE = """#!/bin/sh
35 echo "$@" | grep -e '-ccbin' -e '--compiler-bindir' > /dev/null
36 if [ $? -eq 0 ];
37 then
38         echo "ERROR: do not set -ccbin or --compiler-bindir when using the `basename $0` wrapper"
39 else
40         nvcc -ccbin=%s "$@"
41         exit $?
42 fi """
43 
44 class EB_CUDA(Binary):
45     """
46     Support for installing CUDA.
47     """
48 
49     @staticmethod
50     def extra_options():
51         """Create a set of wrappers based on a list determined by the easyconfig file"""
52         extra_vars = {
53             'host_compilers': [None, "Host compilers for which a wrapper will be generated", CUSTOM]
54         }
55         return Binary.extra_options(extra_vars)
56 
57     def extract_step(self):
58         """Extract installer to have more control, e.g. options, patching Perl scripts, etc."""
59         execpath = self.src[0]['path']
60         run_cmd("/bin/sh " + execpath + " --noexec --nox11 --target " + self.builddir)
61         self.src[0]['finalpath'] = self.builddir
62 
63     def install_step(self):
64         """Install CUDA using Perl install script."""
65 
66         # define how to run the installer
67         # script has /usr/bin/perl hardcoded, but we want to have control over which perl is being used
68         if LooseVersion(self.version) <= LooseVersion("5"):
69             install_script = "install-linux.pl"
70             self.cfg.update('installopts', '--prefix=%s' % self.installdir)
71         else:
72             install_script = "cuda-installer.pl"
73             # note: also including samples (via "-samplespath=%(installdir)s -samples") would require libglut
74             self.cfg.update('installopts', "-verbose -silent -toolkitpath=%s -toolkit" % self.installdir)
75 
76         cmd = "%(preinstallopts)s perl ./%(script)s %(installopts)s" % {
77             'preinstallopts': self.cfg['preinstallopts'],
78             'script': install_script,
79             'installopts': self.cfg['installopts']
80         }
81 
82         # prepare for running install script autonomously
83         qanda = {}
84         stdqa = {
85             # this question is only asked if CUDA tools are already available system-wide
86             r"Would you like to remove all CUDA files under .*? (yes/no/abort): ": "no",
87         }
88         noqanda = [
89             r"^Configuring",
90             r"Installation Complete",
91             r"Verifying archive integrity.*",
92             r"^Uncompressing NVIDIA CUDA",
93             r".* -> .*",
94         ]
95 
96         # patch install script to handle Q&A autonomously
97         patch_perl_script_autoflush(os.path.join(self.builddir, install_script))
98 
99         # make sure $DISPLAY is not defined, which may lead to (weird) problems
100         # this is workaround for not being able to specify --nox11 to the Perl install scripts
101         if 'DISPLAY' in os.environ:
102             os.environ.pop('DISPLAY')
103 
104         #overriding maxhits default value to 300 (300s wait for nothing to change in the output without seeing a known question)
105         run_cmd_qa(cmd, qanda, std_qa=stdqa, no_qa=noqanda, log_all=True, simple=True, maxhits=300)
106 
107     def post_install_step(self):
108         """Create wrappers for the specified host compilers"""
109         def create_wrapper(wrapper_name, wrapper_comp):
110             """Create for a particular compiler, with a particular name"""
111             wrapper_f = os.path.join(self.installdir, 'bin', wrapper_name)
112             write_file(wrapper_f, WRAPPER_TEMPLATE % wrapper_comp)
113             adjust_permissions(wrapper_f, stat.S_IXUSR|stat.S_IRUSR|stat.S_IXGRP|stat.S_IRGRP|stat.S_IXOTH|stat.S_IROTH)
114 
115         # Prepare wrappers to handle a default host compiler other than g++
116         for comp in (self.cfg['host_compilers'] or []):
117             create_wrapper('nvcc_%s' % comp, comp)
118 
119         super(EB_CUDA, self).post_install_step()
120 
121     def sanity_check_step(self):
122         """Custom sanity check for CUDA."""
123         shlib_ext = get_shared_lib_ext()
124 
125         chk_libdir = ["lib64"]
126 
127         # Versions higher than 6 do not provide 32 bit libraries
128         if LooseVersion(self.version) < LooseVersion("6"):
129             chk_libdir += ["lib"]
130 
131         custom_paths = {
132             'files': ["bin/%s" % x for x in ["fatbinary", "nvcc", "nvlink", "ptxas"]] +
133                      ["%s/lib%s.%s" % (x, y, shlib_ext) for x in chk_libdir for y in ["cublas", "cudart", "cufft",
134                                                                                       "curand", "cusparse"]],
135             'dirs': ["include"],
136         }
137 
138         if LooseVersion(self.version) < LooseVersion('7'):
139             custom_paths['files'].append('open64/bin/nvopencc')
140         if LooseVersion(self.version) >= LooseVersion('7'):
141             custom_paths['files'].append("extras/CUPTI/lib64/libcupti.%s" % shlib_ext)
142             custom_paths['dirs'].append("extras/CUPTI/include")
143 
144 
145         super(EB_CUDA, self).sanity_check_step(custom_paths=custom_paths)
146 
147     def make_module_req_guess(self):
148         """Specify CUDA custom values for PATH etc."""
149 
150         guesses = super(EB_CUDA, self).make_module_req_guess()
151 
152         # The dirs should be in the order ['open64/bin', 'bin']
153         bin_path = []
154         if LooseVersion(self.version) < LooseVersion('7'):
155             bin_path.append('open64/bin')
156         bin_path.append('bin')
157 
158         lib_path = ['lib64']
159         inc_path = ['include']
160         if LooseVersion(self.version) >= LooseVersion('7'):
161             lib_path.append('extras/CUPTI/lib64')
162             inc_path.append('extras/CUPTI/include')
163 
164         guesses.update({
165             'PATH': bin_path,
166             'LD_LIBRARY_PATH': lib_path,
167             'CPATH': inc_path,
168             'CUDA_HOME': [''],
169             'CUDA_ROOT': [''],
170             'CUDA_PATH': [''],
171         })
172 
173         return guesses
174
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/easybuild/easyblocks/c/cuda.py b/easybuild/easyblocks/c/cuda.py
--- a/easybuild/easyblocks/c/cuda.py
+++ b/easybuild/easyblocks/c/cuda.py
@@ -160,10 +160,14 @@
         if LooseVersion(self.version) >= LooseVersion('7'):
             lib_path.append('extras/CUPTI/lib64')
             inc_path.append('extras/CUPTI/include')
+            bin_path.append('nvvm/bin')
+            lib_path.append('nvvm/lib64')
+            inc_path.append('nvvm/include')
 
         guesses.update({
             'PATH': bin_path,
             'LD_LIBRARY_PATH': lib_path,
+            'LIBRARY_PATH': ['lib64', 'lib64/stubs'],
             'CPATH': inc_path,
             'CUDA_HOME': [''],
             'CUDA_ROOT': [''],

{"golden_diff": "diff --git a/easybuild/easyblocks/c/cuda.py b/easybuild/easyblocks/c/cuda.py\n--- a/easybuild/easyblocks/c/cuda.py\n+++ b/easybuild/easyblocks/c/cuda.py\n@@ -160,10 +160,14 @@\n         if LooseVersion(self.version) >= LooseVersion('7'):\n             lib_path.append('extras/CUPTI/lib64')\n             inc_path.append('extras/CUPTI/include')\n+            bin_path.append('nvvm/bin')\n+            lib_path.append('nvvm/lib64')\n+            inc_path.append('nvvm/include')\n \n         guesses.update({\n             'PATH': bin_path,\n             'LD_LIBRARY_PATH': lib_path,\n+            'LIBRARY_PATH': ['lib64', 'lib64/stubs'],\n             'CPATH': inc_path,\n             'CUDA_HOME': [''],\n             'CUDA_ROOT': [''],\n", "issue": "CUDA stubs path missing\nIn order for the NVML and other libraries to be found, one needs to add \r\n$CUDA_ROOT/lib64/stubs to $LIBRARY_PATH (not $LD_LIBRARY_PATH)\r\n\r\n\n", "before_files": [{"content": "##\n# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild\n#\n# Copyright:: Copyright 2012-2018 Cyprus Institute / CaSToRC, Uni.Lu, NTUA, Ghent University, Forschungszentrum Juelich GmbH\n# Authors::   George Tsouloupas <g.tsouloupas@cyi.ac.cy>, Fotis Georgatos <fotis@cern.ch>, Kenneth Hoste, Damian Alvarez\n# License::   MIT/GPL\n# $Id$\n#\n# This work implements a part of the HPCBIOS project and is a component of the policy:\n# http://hpcbios.readthedocs.org/en/latest/HPCBIOS_2012-99.html\n##\n\"\"\"\nEasyBuild support for CUDA, implemented as an easyblock\n\nRef: https://speakerdeck.com/ajdecon/introduction-to-the-cuda-toolkit-for-building-applications\n\n@author: George Tsouloupas (Cyprus Institute)\n@author: Fotis Georgatos (Uni.lu)\n@author: Kenneth Hoste (Ghent University)\n@author: Damian Alvarez (Forschungszentrum Juelich)\n\"\"\"\nimport os\nimport stat\n\nfrom distutils.version import LooseVersion\n\nfrom easybuild.easyblocks.generic.binary import Binary\nfrom easybuild.framework.easyconfig import CUSTOM\nfrom easybuild.tools.filetools import adjust_permissions, patch_perl_script_autoflush, write_file\nfrom easybuild.tools.run import run_cmd, run_cmd_qa\nfrom easybuild.tools.systemtools import get_shared_lib_ext\n\n# Wrapper script definition\nWRAPPER_TEMPLATE = \"\"\"#!/bin/sh\necho \"$@\" | grep -e '-ccbin' -e '--compiler-bindir' > /dev/null\nif [ $? -eq 0 ];\nthen\n        echo \"ERROR: do not set -ccbin or --compiler-bindir when using the `basename $0` wrapper\"\nelse\n        nvcc -ccbin=%s \"$@\"\n        exit $?\nfi \"\"\"\n\nclass EB_CUDA(Binary):\n    \"\"\"\n    Support for installing CUDA.\n    \"\"\"\n\n    @staticmethod\n    def extra_options():\n        \"\"\"Create a set of wrappers based on a list determined by the easyconfig file\"\"\"\n        extra_vars = {\n            'host_compilers': [None, \"Host compilers for which a wrapper will be generated\", CUSTOM]\n        }\n        return Binary.extra_options(extra_vars)\n\n    def extract_step(self):\n        \"\"\"Extract installer to have more control, e.g. options, patching Perl scripts, etc.\"\"\"\n        execpath = self.src[0]['path']\n        run_cmd(\"/bin/sh \" + execpath + \" --noexec --nox11 --target \" + self.builddir)\n        self.src[0]['finalpath'] = self.builddir\n\n    def install_step(self):\n        \"\"\"Install CUDA using Perl install script.\"\"\"\n\n        # define how to run the installer\n        # script has /usr/bin/perl hardcoded, but we want to have control over which perl is being used\n        if LooseVersion(self.version) <= LooseVersion(\"5\"):\n            install_script = \"install-linux.pl\"\n            self.cfg.update('installopts', '--prefix=%s' % self.installdir)\n        else:\n            install_script = \"cuda-installer.pl\"\n            # note: also including samples (via \"-samplespath=%(installdir)s -samples\") would require libglut\n            self.cfg.update('installopts', \"-verbose -silent -toolkitpath=%s -toolkit\" % self.installdir)\n\n        cmd = \"%(preinstallopts)s perl ./%(script)s %(installopts)s\" % {\n            'preinstallopts': self.cfg['preinstallopts'],\n            'script': install_script,\n            'installopts': self.cfg['installopts']\n        }\n\n        # prepare for running install script autonomously\n        qanda = {}\n        stdqa = {\n            # this question is only asked if CUDA tools are already available system-wide\n            r\"Would you like to remove all CUDA files under .*? (yes/no/abort): \": \"no\",\n        }\n        noqanda = [\n            r\"^Configuring\",\n            r\"Installation Complete\",\n            r\"Verifying archive integrity.*\",\n            r\"^Uncompressing NVIDIA CUDA\",\n            r\".* -> .*\",\n        ]\n\n        # patch install script to handle Q&A autonomously\n        patch_perl_script_autoflush(os.path.join(self.builddir, install_script))\n\n        # make sure $DISPLAY is not defined, which may lead to (weird) problems\n        # this is workaround for not being able to specify --nox11 to the Perl install scripts\n        if 'DISPLAY' in os.environ:\n            os.environ.pop('DISPLAY')\n\n        #overriding maxhits default value to 300 (300s wait for nothing to change in the output without seeing a known question)\n        run_cmd_qa(cmd, qanda, std_qa=stdqa, no_qa=noqanda, log_all=True, simple=True, maxhits=300)\n\n    def post_install_step(self):\n        \"\"\"Create wrappers for the specified host compilers\"\"\"\n        def create_wrapper(wrapper_name, wrapper_comp):\n            \"\"\"Create for a particular compiler, with a particular name\"\"\"\n            wrapper_f = os.path.join(self.installdir, 'bin', wrapper_name)\n            write_file(wrapper_f, WRAPPER_TEMPLATE % wrapper_comp)\n            adjust_permissions(wrapper_f, stat.S_IXUSR|stat.S_IRUSR|stat.S_IXGRP|stat.S_IRGRP|stat.S_IXOTH|stat.S_IROTH)\n\n        # Prepare wrappers to handle a default host compiler other than g++\n        for comp in (self.cfg['host_compilers'] or []):\n            create_wrapper('nvcc_%s' % comp, comp)\n\n        super(EB_CUDA, self).post_install_step()\n\n    def sanity_check_step(self):\n        \"\"\"Custom sanity check for CUDA.\"\"\"\n        shlib_ext = get_shared_lib_ext()\n\n        chk_libdir = [\"lib64\"]\n\n        # Versions higher than 6 do not provide 32 bit libraries\n        if LooseVersion(self.version) < LooseVersion(\"6\"):\n            chk_libdir += [\"lib\"]\n\n        custom_paths = {\n            'files': [\"bin/%s\" % x for x in [\"fatbinary\", \"nvcc\", \"nvlink\", \"ptxas\"]] +\n                     [\"%s/lib%s.%s\" % (x, y, shlib_ext) for x in chk_libdir for y in [\"cublas\", \"cudart\", \"cufft\",\n                                                                                      \"curand\", \"cusparse\"]],\n            'dirs': [\"include\"],\n        }\n\n        if LooseVersion(self.version) < LooseVersion('7'):\n            custom_paths['files'].append('open64/bin/nvopencc')\n        if LooseVersion(self.version) >= LooseVersion('7'):\n            custom_paths['files'].append(\"extras/CUPTI/lib64/libcupti.%s\" % shlib_ext)\n            custom_paths['dirs'].append(\"extras/CUPTI/include\")\n\n\n        super(EB_CUDA, self).sanity_check_step(custom_paths=custom_paths)\n\n    def make_module_req_guess(self):\n        \"\"\"Specify CUDA custom values for PATH etc.\"\"\"\n\n        guesses = super(EB_CUDA, self).make_module_req_guess()\n\n        # The dirs should be in the order ['open64/bin', 'bin']\n        bin_path = []\n        if LooseVersion(self.version) < LooseVersion('7'):\n            bin_path.append('open64/bin')\n        bin_path.append('bin')\n\n        lib_path = ['lib64']\n        inc_path = ['include']\n        if LooseVersion(self.version) >= LooseVersion('7'):\n            lib_path.append('extras/CUPTI/lib64')\n            inc_path.append('extras/CUPTI/include')\n\n        guesses.update({\n            'PATH': bin_path,\n            'LD_LIBRARY_PATH': lib_path,\n            'CPATH': inc_path,\n            'CUDA_HOME': [''],\n            'CUDA_ROOT': [''],\n            'CUDA_PATH': [''],\n        })\n\n        return guesses\n", "path": "easybuild/easyblocks/c/cuda.py"}], "after_files": [{"content": "##\n# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild\n#\n# Copyright:: Copyright 2012-2018 Cyprus Institute / CaSToRC, Uni.Lu, NTUA, Ghent University, Forschungszentrum Juelich GmbH\n# Authors::   George Tsouloupas <g.tsouloupas@cyi.ac.cy>, Fotis Georgatos <fotis@cern.ch>, Kenneth Hoste, Damian Alvarez\n# License::   MIT/GPL\n# $Id$\n#\n# This work implements a part of the HPCBIOS project and is a component of the policy:\n# http://hpcbios.readthedocs.org/en/latest/HPCBIOS_2012-99.html\n##\n\"\"\"\nEasyBuild support for CUDA, implemented as an easyblock\n\nRef: https://speakerdeck.com/ajdecon/introduction-to-the-cuda-toolkit-for-building-applications\n\n@author: George Tsouloupas (Cyprus Institute)\n@author: Fotis Georgatos (Uni.lu)\n@author: Kenneth Hoste (Ghent University)\n@author: Damian Alvarez (Forschungszentrum Juelich)\n\"\"\"\nimport os\nimport stat\n\nfrom distutils.version import LooseVersion\n\nfrom easybuild.easyblocks.generic.binary import Binary\nfrom easybuild.framework.easyconfig import CUSTOM\nfrom easybuild.tools.filetools import adjust_permissions, patch_perl_script_autoflush, write_file\nfrom easybuild.tools.run import run_cmd, run_cmd_qa\nfrom easybuild.tools.systemtools import get_shared_lib_ext\n\n# Wrapper script definition\nWRAPPER_TEMPLATE = \"\"\"#!/bin/sh\necho \"$@\" | grep -e '-ccbin' -e '--compiler-bindir' > /dev/null\nif [ $? -eq 0 ];\nthen\n        echo \"ERROR: do not set -ccbin or --compiler-bindir when using the `basename $0` wrapper\"\nelse\n        nvcc -ccbin=%s \"$@\"\n        exit $?\nfi \"\"\"\n\nclass EB_CUDA(Binary):\n    \"\"\"\n    Support for installing CUDA.\n    \"\"\"\n\n    @staticmethod\n    def extra_options():\n        \"\"\"Create a set of wrappers based on a list determined by the easyconfig file\"\"\"\n        extra_vars = {\n            'host_compilers': [None, \"Host compilers for which a wrapper will be generated\", CUSTOM]\n        }\n        return Binary.extra_options(extra_vars)\n\n    def extract_step(self):\n        \"\"\"Extract installer to have more control, e.g. options, patching Perl scripts, etc.\"\"\"\n        execpath = self.src[0]['path']\n        run_cmd(\"/bin/sh \" + execpath + \" --noexec --nox11 --target \" + self.builddir)\n        self.src[0]['finalpath'] = self.builddir\n\n    def install_step(self):\n        \"\"\"Install CUDA using Perl install script.\"\"\"\n\n        # define how to run the installer\n        # script has /usr/bin/perl hardcoded, but we want to have control over which perl is being used\n        if LooseVersion(self.version) <= LooseVersion(\"5\"):\n            install_script = \"install-linux.pl\"\n            self.cfg.update('installopts', '--prefix=%s' % self.installdir)\n        else:\n            install_script = \"cuda-installer.pl\"\n            # note: also including samples (via \"-samplespath=%(installdir)s -samples\") would require libglut\n            self.cfg.update('installopts', \"-verbose -silent -toolkitpath=%s -toolkit\" % self.installdir)\n\n        cmd = \"%(preinstallopts)s perl ./%(script)s %(installopts)s\" % {\n            'preinstallopts': self.cfg['preinstallopts'],\n            'script': install_script,\n            'installopts': self.cfg['installopts']\n        }\n\n        # prepare for running install script autonomously\n        qanda = {}\n        stdqa = {\n            # this question is only asked if CUDA tools are already available system-wide\n            r\"Would you like to remove all CUDA files under .*? (yes/no/abort): \": \"no\",\n        }\n        noqanda = [\n            r\"^Configuring\",\n            r\"Installation Complete\",\n            r\"Verifying archive integrity.*\",\n            r\"^Uncompressing NVIDIA CUDA\",\n            r\".* -> .*\",\n        ]\n\n        # patch install script to handle Q&A autonomously\n        patch_perl_script_autoflush(os.path.join(self.builddir, install_script))\n\n        # make sure $DISPLAY is not defined, which may lead to (weird) problems\n        # this is workaround for not being able to specify --nox11 to the Perl install scripts\n        if 'DISPLAY' in os.environ:\n            os.environ.pop('DISPLAY')\n\n        #overriding maxhits default value to 300 (300s wait for nothing to change in the output without seeing a known question)\n        run_cmd_qa(cmd, qanda, std_qa=stdqa, no_qa=noqanda, log_all=True, simple=True, maxhits=300)\n\n    def post_install_step(self):\n        \"\"\"Create wrappers for the specified host compilers\"\"\"\n        def create_wrapper(wrapper_name, wrapper_comp):\n            \"\"\"Create for a particular compiler, with a particular name\"\"\"\n            wrapper_f = os.path.join(self.installdir, 'bin', wrapper_name)\n            write_file(wrapper_f, WRAPPER_TEMPLATE % wrapper_comp)\n            adjust_permissions(wrapper_f, stat.S_IXUSR|stat.S_IRUSR|stat.S_IXGRP|stat.S_IRGRP|stat.S_IXOTH|stat.S_IROTH)\n\n        # Prepare wrappers to handle a default host compiler other than g++\n        for comp in (self.cfg['host_compilers'] or []):\n            create_wrapper('nvcc_%s' % comp, comp)\n\n        super(EB_CUDA, self).post_install_step()\n\n    def sanity_check_step(self):\n        \"\"\"Custom sanity check for CUDA.\"\"\"\n        shlib_ext = get_shared_lib_ext()\n\n        chk_libdir = [\"lib64\"]\n\n        # Versions higher than 6 do not provide 32 bit libraries\n        if LooseVersion(self.version) < LooseVersion(\"6\"):\n            chk_libdir += [\"lib\"]\n\n        custom_paths = {\n            'files': [\"bin/%s\" % x for x in [\"fatbinary\", \"nvcc\", \"nvlink\", \"ptxas\"]] +\n                     [\"%s/lib%s.%s\" % (x, y, shlib_ext) for x in chk_libdir for y in [\"cublas\", \"cudart\", \"cufft\",\n                                                                                      \"curand\", \"cusparse\"]],\n            'dirs': [\"include\"],\n        }\n\n        if LooseVersion(self.version) < LooseVersion('7'):\n            custom_paths['files'].append('open64/bin/nvopencc')\n        if LooseVersion(self.version) >= LooseVersion('7'):\n            custom_paths['files'].append(\"extras/CUPTI/lib64/libcupti.%s\" % shlib_ext)\n            custom_paths['dirs'].append(\"extras/CUPTI/include\")\n\n\n        super(EB_CUDA, self).sanity_check_step(custom_paths=custom_paths)\n\n    def make_module_req_guess(self):\n        \"\"\"Specify CUDA custom values for PATH etc.\"\"\"\n\n        guesses = super(EB_CUDA, self).make_module_req_guess()\n\n        # The dirs should be in the order ['open64/bin', 'bin']\n        bin_path = []\n        if LooseVersion(self.version) < LooseVersion('7'):\n            bin_path.append('open64/bin')\n        bin_path.append('bin')\n\n        lib_path = ['lib64']\n        inc_path = ['include']\n        if LooseVersion(self.version) >= LooseVersion('7'):\n            lib_path.append('extras/CUPTI/lib64')\n            inc_path.append('extras/CUPTI/include')\n            bin_path.append('nvvm/bin')\n            lib_path.append('nvvm/lib64')\n            inc_path.append('nvvm/include')\n\n        guesses.update({\n            'PATH': bin_path,\n            'LD_LIBRARY_PATH': lib_path,\n            'LIBRARY_PATH': ['lib64', 'lib64/stubs'],\n            'CPATH': inc_path,\n            'CUDA_HOME': [''],\n            'CUDA_ROOT': [''],\n            'CUDA_PATH': [''],\n        })\n\n        return guesses\n", "path": "easybuild/easyblocks/c/cuda.py"}]}