Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example: Build and run also with static linking #498

Merged
merged 3 commits into from
Nov 5, 2023

Conversation

mmuetzel
Copy link
Contributor

@mmuetzel mmuetzel commented Nov 4, 2023

Statically linking requires that transitional dependencies are correctly described by the CMake targets.

Link executables in the example that are statically linked to the SuiteSparse libraries, and run them in the CI to check that.

That's not an extensive test. (Theoretically, we'd need to check if linking any combination of libraries works correctly.) But it's better than nothing.

This also revealed an issue when trying to link to a static library that was built with nvcc:

  [ 87%] Linking CXX executable my_demo_static
  /usr/bin/ld: /home/runner/work/SuiteSparse/SuiteSparse/lib/libgpuqrengine.a(GPUQREngine_UberKernel.cu.o): in function `__sti____cudaRegisterAll()':
  tmpxft_0000835f_00000000-6_GPUQREngine_UberKernel.compute_80.cudafe1.cpp:(.text.startup+0x21): undefined reference to `__cudaRegisterLinkedBinary_1763c3b7_25_GPUQREngine_UberKernel_cu_4549ffb9'
  collect2: error: ld returned 1 exit status

I think the relevant change was setting CUDA_RESOLVE_DEVICE_SYMBOLS to ON.

@DrTimothyAldenDavis DrTimothyAldenDavis merged commit 4929485 into DrTimothyAldenDavis:dev2 Nov 5, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants