-
-
Notifications
You must be signed in to change notification settings - Fork 784
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
ld cannot find related library when build cuda program #5317
Comments
try this patch. #5319 xmake update -s github:xmake-io/xmake#cuda |
@waruqi Thanks for the help! That patch does not fix, I tried to change the line 108 to elseif is_host("linux") and is_arch("x86_64", "arm64-v8a") then It fixes the problem. |
Strange, why would it be arm64-v8a? Can you run xmake l os.arch
uname -a
xmake f -cvD
xmake -rv and provide all logs? I need to check your machine arch. |
try it again, I have fixed arm64 arch name. #5319 |
@waruqi The problem now is resolved. Thanks! |
waruqi
added a commit
that referenced
this issue
Jul 10, 2024
improve to find cuda for linux arm64 #5317
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Xmake Version
xmake v2.9.3+20240703
Operating System Version and Architecture
Ubuntu 22.04, Arm64
Describe Bug
When I tried to build cuda program with xmake, the linker cannot find the related library during linking.
It turns out that in arm64 architecture, the cuda libraries are stored under
/usr/local/cuda/lib64
instead of/usr/local/cuda/lib
.but the
rpath
is pointed to the later path by default, making linker unable to find the library.Expected Behavior
The cuda program should be built successfully.
Project Configuration
Additional Information and Error Logs
xmake -v [ 87%]: linking.release bench-sycl /usr/bin/g++ -o build/linux/arm64-v8a/release/bench-sycl build/.objs/bench-sycl/linux/arm64-v8a/release/src/main.cu.o build/.objs/bench-sycl/linux/arm64-v8a/release/rules/cuda/devlink/bench-sycl_gpucode.cu.o -L/usr/local/cuda/lib -Lbuild/linux/arm64-v8a/release -Wl,-rpath=/usr/local/cuda/lib -s -lbenchmark -lcuda-kernels -lcudart_static -lrt -lpthread -ldl -lcudadevrt /usr/bin/ld: cannot find -lcudart_static: No such file or directory /usr/bin/ld: cannot find -lcudadevrt: No such file or directory collect2: error: ld returned 1 exit status error: execv(/usr/bin/g++ -o build/linux/arm64-v8a/release/bench-sycl build/.objs/bench-sycl/linux/arm64-v8a/release/src/main.cu.o build/.objs/bench-sycl/linux/arm64-v8a/release/rules/cuda/devlink/bench-sycl_gpucode.cu.o -L/usr/local/cuda/lib -Lbuild/linux/arm64-v8a/release -Wl,-rpath=/usr/local/cuda/lib -s -lbenchmark -lcuda-kernels -lcudart_static -lrt -lpthread -ldl -lcudadevrt) failed(1)
The text was updated successfully, but these errors were encountered: