[Insight-users] ITK 4.2 - GPUMeanImageFilter - itkGPUKernelManager

Yass Jd yasso50 at hotmail.com
Wed Jun 6 11:18:22 EDT 2012


Ok, stupid thing... I forgot to enable the ITK_USE_GPU feature when 
compiling ITK 4.2.

Thank you !
Yass Jd.

On 06/06/12 10:31, Yass Jd wrote:
> Dear Kris,
>
> Thank you for your answer !
>
> Here is my CMakeLists:
>
>     cmake_minimum_required (VERSION 2.8.5)
>     project (fMRI)
>
>     #set (CMAKE_VERBOSE_MAKEFILE ON)
>     set(CMAKE_CXX_FLAGS "-g -Wall")
>
>     if(COMMAND cmake_policy)
>       cmake_policy(SET CMP0003 NEW)
>     endif(COMMAND cmake_policy)
>
>     # Find ITK.
>     FIND_PACKAGE(ITK REQUIRED)
>     IF(ITK_FOUND)
>       INCLUDE(${ITK_USE_FILE})
>     ENDIF(ITK_FOUND)
>
>     add_executable(ReadDCMWriteNii niftihandler.cpp main.cxx )
>     target_link_libraries(ReadDCMWriteNii  ${ITK_LIBRARIES})
>
> Should be OK right ? Seems like I'm not linking well something...
>
> Best regards,
> Yass Jd.
>
>
> On 06/06/12 01:43, Kristen Zygmunt wrote:
>> It looks like the GPUCommon library is not being included.
>> You should have something like this line in your CMakeLists.txt:
>>
>> target_link_libraries(YourExecutable ${ITK_LIBRARIES})
>>
>> Can you provide your CMakeLists.txt ?
>> -Kris
>>
>>> Date: Tue, 5 Jun 2012 18:55:55 +0200
>>> From: Yass Jd <yasso50 at hotmail.com <mailto:yasso50 at hotmail.com>>
>>> Subject: [Insight-users] ITK 4.2 - GPUMeanImageFilter -
>>> itkGPUKernelManager
>>> To: insight-users at itk.org <mailto:insight-users at itk.org>
>>> Message-ID: <BLU0-SMTP296F767A77A5AD6D75BD509BD0C0 at phx.gbl 
>>> <mailto:BLU0-SMTP296F767A77A5AD6D75BD509BD0C0 at phx.gbl>>
>>> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
>>>
>>> Dear all,
>>>
>>> I am trying to run the following sample code with ITK 4.2 in order to
>>> perform a GPU-based mean filter:
>>>
>>>       typedef itk::GPUMeanImageFilter<ImageType,ImageType> filterType;
>>>       filterType::Pointer blurFilter = filterType::New();
>>>       blurFilter->SetInput(handler.getOutput());
>>>       blurFilter->SetRadius(2);
>>>       blurFilter->Update();
>>>
>>>
>>> And i get the following errors from the linker (compilation is fine):
>>>
>>>    CMakeFiles/ReadDCMWriteNii.dir/main.cxx.o: In function
>>>    `itk::GPUKernelManager::New()':
>>>    /usr/local/include/ITK-4.2/itkGPUKernelManager.h:60: undefined
>>>    reference to `itk::GPUKernelManager::GPUKernelManager()'
>>>    CMakeFiles/ReadDCMWriteNii.dir/main.cxx.o: In function
>>>    `itk::GPUMeanImageFilter<itk::Image<short, 4u>, itk::Image<short,
>>>    4u> >::GPUGenerateData()':
>>>    /usr/local/include/ITK-4.2/itkGPUMeanImageFilter.hxx:92: undefined
>>>    reference to `itk::OpenCLGetLocalBlockSize(unsigned int)'
>>>    /usr/local/include/ITK-4.2/itkGPUMeanImageFilter.hxx:105: undefined
>>>    reference to `itk::GPUKernelManager::SetKernelArgWithImage(int,
>>>    unsigned int, itk::SmartPointer<itk::GPUDataManager>)'
>>>    /usr/local/include/ITK-4.2/itkGPUMeanImageFilter.hxx:106: undefined
>>>    reference to `itk::GPUKernelManager::SetKernelArgWithImage(int,
>>>    unsigned int, itk::SmartPointer<itk::GPUDataManager>)'
>>>    /usr/local/include/ITK-4.2/itkGPUMeanImageFilter.hxx:110: undefined
>>>    reference to `itk::GPUKernelManager::SetKernelArg(int, unsigned int,
>>>    unsigned long, void const*)'
>>>    /usr/local/include/ITK-4.2/itkGPUMeanImageFilter.hxx:115: undefined
>>>    reference to `itk::GPUKernelManager::SetKernelArg(int, unsigned int,
>>>    unsigned long, void const*)'
>>>    /usr/local/include/ITK-4.2/itkGPUMeanImageFilter.hxx:119: undefined
>>>    reference to `itk::GPUKernelManager::LaunchKernel(int, int, unsigned
>>>    long*, unsigned long*)
>>>
>>> I don't see the error ? Seems like a bad declaration in the header
>>> itkGPUKernelManager.h but I didn't find it... Everythinh is well
>>> included in my code though. Anybody got an idea ?
>>>
>>> Thank you !
>>>
>>> Best regards,
>>> Yass Jd.
>>>
>>> -------------- next part --------------
>>> An HTML attachment was scrubbed...
>>> URL: 
>>> <http://www.itk.org/pipermail/insight-users/attachments/20120605/7257158d/attachment-0001.htm>
>>>
>>> ------------------------------
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users


-- 
Yass Jd.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120606/d2ca2e3b/attachment.htm>


More information about the Insight-users mailing list