Hi,
At my work we are using cmake for crosscompiling cuda-stuff for arm64 and the 
current FindCUDA-module has problems finding the cuda-libraries.

I have attached a patch that fixes the issue. It is based on master and 
formatted with git format-patch so should be possible to apply.
Please let me know what you think, it would be great if this could be included 
so we can stop manually patching it every time we update.

Best regards,
// Alexander
From 191c3c9a065d8b201b79816ddd94a361e8eed06b Mon Sep 17 00:00:00 2001
From: Alexander Szakaly <alexander.szak...@volvocars.com>
Date: Mon, 23 Nov 2015 15:17:52 +0100
Subject: [PATCH] Add paths for crosscompiling with cuda for arm64

---
 Modules/FindCUDA.cmake | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 6a21078..ada5b8a 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -653,6 +653,9 @@ set(CUDA_VERSION_STRING "${CUDA_VERSION}")
 # Support for arm cross compilation with CUDA 5.5
 if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
   set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf" CACHE PATH "Toolkit target location.")
+# Support for aarch64 cross compilation with CUDA 7.0
+elseif(CUDA_VERSION VERSION_GREATER "6.5" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/aarch64-linux")
+  set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}/targets/aarch64-linux" CACHE PATH "Toolkit target location.")
 else()
   set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}" CACHE PATH "Toolkit target location.")
 endif()
-- 
1.9.1

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to