Skip to content

Used os.path.join in cuda.py, and added ldconfig to post_install_step#1473

Merged
boegel merged 2 commits intoeasybuilders:developfrom
damianam:cuda_ldconfig
Aug 17, 2018
Merged

Used os.path.join in cuda.py, and added ldconfig to post_install_step#1473
boegel merged 2 commits intoeasybuilders:developfrom
damianam:cuda_ldconfig

Conversation

@damianam
Copy link
Copy Markdown
Member

This PR makes the easyblock use os.path.join instead of /, but more importantly, runs ldconfig -N in the stubs directory, to create the proper symlinks. This is necessary to deal with binaries created outside of EB, which might be linked against libcuda.so.1 instead of libcuda.so, like, for instance, MVAPICH2-GDR

Comment thread easybuild/easyblocks/c/cuda.py Outdated
'files': [os.path.join("bin", "%s") % x for x in ["fatbinary", "nvcc", "nvlink", "ptxas"]] +
[os.path.join("%s", "lib%s.%s") % (x, y, shlib_ext) for x in chk_libdir for y in ["cublas",
"cudart", "cufft", "curand",
"cusparse"]],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for visual indent

Comment thread easybuild/easyblocks/c/cuda.py Outdated
"curand", "cusparse"]],
'files': [os.path.join("bin", "%s") % x for x in ["fatbinary", "nvcc", "nvlink", "ptxas"]] +
[os.path.join("%s", "lib%s.%s") % (x, y, shlib_ext) for x in chk_libdir for y in ["cublas",
"cudart", "cufft", "curand",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for visual indent

Comment thread easybuild/easyblocks/c/cuda.py Outdated
["%s/lib%s.%s" % (x, y, shlib_ext) for x in chk_libdir for y in ["cublas", "cudart", "cufft",
"curand", "cusparse"]],
'files': [os.path.join("bin", "%s") % x for x in ["fatbinary", "nvcc", "nvlink", "ptxas"]] +
[os.path.join("%s", "lib%s.%s") % (x, y, shlib_ext) for x in chk_libdir for y in ["cublas",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line unaligned for hanging indent

@damianam
Copy link
Copy Markdown
Member Author

@akesandgren could you review this PR?

Comment thread easybuild/easyblocks/c/cuda.py Outdated
["%s/lib%s.%s" % (x, y, shlib_ext) for x in chk_libdir for y in ["cublas", "cudart", "cufft",
"curand", "cusparse"]],
'files': [os.path.join("bin", "%s") % x for x in ["fatbinary", "nvcc", "nvlink", "ptxas"]] +
[os.path.join("%s", "lib%s.%s") % (x, y, shlib_ext) for x in chk_libdir for y in ["cublas",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A variant of writing this is:
[os.path.join("bin", x) for x in [...]]
[os.path.join(x, "lib%s.%s") % (y, shlib_ext) for x in ...

At least the first one is slightly easier to read

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably easier to lift the ["cublas", ...] list into a variable:

culibs = ["cublas", "cudart", "cufft", "curand", "cusparse"]
...
   [os.path.join("%s", "lib%s.%s") % (d, l, shlib_ext) for d in chk_libdir for l in culibs] 

@boegel boegel added this to the 3.6.3 milestone Aug 16, 2018
Comment thread easybuild/easyblocks/c/cuda.py Outdated
["%s/lib%s.%s" % (x, y, shlib_ext) for x in chk_libdir for y in ["cublas", "cudart", "cufft",
"curand", "cusparse"]],
'files': [os.path.join("bin", "%s") % x for x in ["fatbinary", "nvcc", "nvlink", "ptxas"]] +
[os.path.join("%s", "lib%s.%s") % (x, y, shlib_ext) for x in chk_libdir for y in ["cublas",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably easier to lift the ["cublas", ...] list into a variable:

culibs = ["cublas", "cudart", "cufft", "curand", "cusparse"]
...
   [os.path.join("%s", "lib%s.%s") % (d, l, shlib_ext) for d in chk_libdir for l in culibs] 

@boegel
Copy link
Copy Markdown
Member

boegel commented Aug 16, 2018

other than the minor style issues that @houndci-bot is tripping over: lgtm

@damianam
Copy link
Copy Markdown
Member Author

@boegel @akesandgren any other comments?

@boegel
Copy link
Copy Markdown
Member

boegel commented Aug 17, 2018

lgtm, tested with a bunch of existing CUDA easyconfigs, (still) works like charm...

Going in, thanks @damianam!

@boegel boegel merged commit 342c87f into easybuilders:develop Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants