Skip to content

cuda: remove bogus libxml2 dep for 12+#4563

Merged
alecbcs merged 1 commit into
spack:developfrom
celeritas-project:cuda-no-xmllib
May 7, 2026
Merged

cuda: remove bogus libxml2 dep for 12+#4563
alecbcs merged 1 commit into
spack:developfrom
celeritas-project:cuda-no-xmllib

Conversation

@sethrj
Copy link
Copy Markdown
Contributor

@sethrj sethrj commented Apr 29, 2026

At some point cuda apparently needed libxml2, but now it does not. Verified installation of this updated recipe with cuda@13.1.1 on linux-ubuntu24.04-x86_64_v3 . I also used strings/grep with the binary installer for 12.9 to check for any references to XML and libtree/ldd on the installed libraries and binaries. I can't find any use of it nor reference to the requirement in the CUDA installation guide.

Copy link
Copy Markdown
Member

@alecbcs alecbcs left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for digging into this @sethrj

Will give it a couple days for @ax3l @pauleonix @Rombur to have a chance to review

@alecbcs alecbcs self-assigned this Apr 29, 2026
@alecbcs alecbcs added the waiting-on-maintainer Waiting on a review from the package maintainer label Apr 29, 2026
@alecbcs
Copy link
Copy Markdown
Member

alecbcs commented May 7, 2026

Merging without hearing back from @ax3l @pauleonix @Rombur after > 1 week.

@alecbcs alecbcs merged commit 4c99b23 into spack:develop May 7, 2026
17 checks passed
@alecbcs alecbcs removed the waiting-on-maintainer Waiting on a review from the package maintainer label May 7, 2026
kshea21 pushed a commit that referenced this pull request May 14, 2026
msimberg pushed a commit that referenced this pull request May 28, 2026
…cy (#4911)

- Glibc in version 2.41 added some C23 functions that conflict with headers in cuda prior to version 13.1. This results in errors like
  ```
  /usr/include/bits/mathcalls.h(83): error: exception specification is incompatible with that of previous function "cospi" (declared at line 5554 of <redacted>/spack/var/spack/environments/cuda_rqrt_testing/.spack-env/view/bin/../targets/x86_64-linux/include/crt/math_functions.h)
     extern double cospi (double __x) noexcept (true); extern double __cospi (double __x) noexcept (true);
                                      ^
  
  /usr/include/bits/mathcalls.h(85): error: exception specification is incompatible with that of previous function "sinpi" (declared at line 5442 of <redacted>/spack/var/spack/environments/cuda_rqrt_testing/.spack-env/view/bin/../targets/x86_64-linux/include/crt/math_functions.h)
     extern double sinpi (double __x) noexcept (true); extern double __sinpi (double __x) noexcept (true);
                                      ^
  
  /usr/include/bits/mathcalls.h(206): error: exception specification is incompatible with that of previous function "rsqrt" (declared at line 777 of <redacted>/spack/var/spack/environments/cuda_rqrt_testing/.spack-env/view/bin/../targets/x86_64-linux/include/crt/math_functions.h)
     extern double rsqrt (double __x) noexcept (true); extern double __rsqrt (double __x) noexcept (true);
                                      ^
  
  /usr/include/bits/mathcalls.h(83): error: exception specification is incompatible with that of previous function "cospif" (declared at line 5606 of <redacted>/spack/var/spack/environments/cuda_rqrt_testing/.spack-env/view/bin/../targets/x86_64-linux/include/crt/math_functions.h)
     extern float cospif (float __x) noexcept (true); extern float __cospif (float __x) noexcept (true);
                                     ^
  
  /usr/include/bits/mathcalls.h(85): error: exception specification is incompatible with that of previous function "sinpif" (declared at line 5502 of <redacted>/spack/var/spack/environments/cuda_rqrt_testing/.spack-env/view/bin/../targets/x86_64-linux/include/crt/math_functions.h)
     extern float sinpif (float __x) noexcept (true); extern float __sinpif (float __x) noexcept (true);
                                     ^
  
  /usr/include/bits/mathcalls.h(206): error: exception specification is incompatible with that of previous function "rsqrtf" (declared at line 847 of <redacted>/spack/var/spack/environments/cuda_rqrt_testing/.spack-env/view/bin/../targets/x86_64-linux/include/crt/math_functions.h)
     extern float rsqrtf (float __x) noexcept (true); extern float __rsqrtf (float __x) noexcept (true);
  ```
  To avoid this a conflict maker was added. Initially I had a patch of the cuda headers, but while I only needed `rsqrtf` to get cuda 13.0 to work a small test with 12.4 failed with more functions. Since the patch would need to work for many glibc & cuda versions, I went for the simpler, but less user friendly route.
- The cuda installer needs libxml2.so which was erroneously removed as a dependency in #4563. On many systems libxml2 is just installed so one easily misses this dependency. Contrary to what is stated in the PR one needs to check for the libxml dependency on the extracted installer, not the run script. Running `./cuda_12.0.0_525.60.13_linux.run --noexec --target /tmp/cuda_files` and then `cat /tmp/cuda_files/cuda-installer | grep libxml` shows that this is still a build time dependency (also confirmed on systems without libxml2 instaled).
thomas-bouvier pushed a commit to thomas-bouvier/spack-packages that referenced this pull request May 30, 2026
…cy (spack#4911)

- Glibc in version 2.41 added some C23 functions that conflict with headers in cuda prior to version 13.1. This results in errors like
  ```
  /usr/include/bits/mathcalls.h(83): error: exception specification is incompatible with that of previous function "cospi" (declared at line 5554 of <redacted>/spack/var/spack/environments/cuda_rqrt_testing/.spack-env/view/bin/../targets/x86_64-linux/include/crt/math_functions.h)
     extern double cospi (double __x) noexcept (true); extern double __cospi (double __x) noexcept (true);
                                      ^
  
  /usr/include/bits/mathcalls.h(85): error: exception specification is incompatible with that of previous function "sinpi" (declared at line 5442 of <redacted>/spack/var/spack/environments/cuda_rqrt_testing/.spack-env/view/bin/../targets/x86_64-linux/include/crt/math_functions.h)
     extern double sinpi (double __x) noexcept (true); extern double __sinpi (double __x) noexcept (true);
                                      ^
  
  /usr/include/bits/mathcalls.h(206): error: exception specification is incompatible with that of previous function "rsqrt" (declared at line 777 of <redacted>/spack/var/spack/environments/cuda_rqrt_testing/.spack-env/view/bin/../targets/x86_64-linux/include/crt/math_functions.h)
     extern double rsqrt (double __x) noexcept (true); extern double __rsqrt (double __x) noexcept (true);
                                      ^
  
  /usr/include/bits/mathcalls.h(83): error: exception specification is incompatible with that of previous function "cospif" (declared at line 5606 of <redacted>/spack/var/spack/environments/cuda_rqrt_testing/.spack-env/view/bin/../targets/x86_64-linux/include/crt/math_functions.h)
     extern float cospif (float __x) noexcept (true); extern float __cospif (float __x) noexcept (true);
                                     ^
  
  /usr/include/bits/mathcalls.h(85): error: exception specification is incompatible with that of previous function "sinpif" (declared at line 5502 of <redacted>/spack/var/spack/environments/cuda_rqrt_testing/.spack-env/view/bin/../targets/x86_64-linux/include/crt/math_functions.h)
     extern float sinpif (float __x) noexcept (true); extern float __sinpif (float __x) noexcept (true);
                                     ^
  
  /usr/include/bits/mathcalls.h(206): error: exception specification is incompatible with that of previous function "rsqrtf" (declared at line 847 of <redacted>/spack/var/spack/environments/cuda_rqrt_testing/.spack-env/view/bin/../targets/x86_64-linux/include/crt/math_functions.h)
     extern float rsqrtf (float __x) noexcept (true); extern float __rsqrtf (float __x) noexcept (true);
  ```
  To avoid this a conflict maker was added. Initially I had a patch of the cuda headers, but while I only needed `rsqrtf` to get cuda 13.0 to work a small test with 12.4 failed with more functions. Since the patch would need to work for many glibc & cuda versions, I went for the simpler, but less user friendly route.
- The cuda installer needs libxml2.so which was erroneously removed as a dependency in spack#4563. On many systems libxml2 is just installed so one easily misses this dependency. Contrary to what is stated in the PR one needs to check for the libxml dependency on the extracted installer, not the run script. Running `./cuda_12.0.0_525.60.13_linux.run --noexec --target /tmp/cuda_files` and then `cat /tmp/cuda_files/cuda-installer | grep libxml` shows that this is still a build time dependency (also confirmed on systems without libxml2 instaled).
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.

2 participants