I am trying to use CUDA in MITK platform. The MITK platform that I am using
is 2014 version which is not supporting CUDA; however, i found a reply which
shows a solution but its not working for me either. According to the Cmake
structure of MITK, if I set "*.cpp" files to CPP_FILES flag in files.cmake
script, gcc compiles the source code, but for cuda there is no variable.
Therefore, according to above link, I modified
"mitkFunctionCreateModule.cmake"

#################
if (IS_CUDA)
    find_package(CUDA REQUIRED)
    set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}; -std=c++11 )
    #list(APPEND CUDA_NVCC_FLAGS "-arch=sm_20;-std=c++11;-O2;-DVERBOSE")
    #SET(CUDA_PROPAGATE_HOST_FLAGS OFF)
    message ("is_cuda == true")
    cuda_add_library(${MODULE_TARGET} STATIC ${CUDA_FILES}) 
endif()
#################

In files.cmake, I have added these lines:

################
find_package(CUDA)
set(CUDA_FILES
  src/robot/cudafolder/testcuda.cu
  src/robot/cudafolder/testcuda.h
)
set(IS_CUDA true)
MITK_CREATE_MODULE(my_module
    DEPENDS MitkCore
    PACKAGE_DEPENDS Qt5|Core

)
#################

The libmy_module.a is created in bin folder but I cannot link it to the main
executable file !

PS: the biggest problem that I am face to is that I cannot use
target_link_libraries ! For any reason that I dont know, its not possible to
link this library to the main MITK exe file. Anyone in mitk expert who works
in plugin module can help me in this matter?

Thanks



--
Sent from: http://mitk-users.1123740.n5.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to