[Insight-developers] add include directory for header test?

Kris Zygmunt krismz at sci.utah.edu
Thu Oct 27 17:50:49 EDT 2011


On Oct 26, 2011, at 12:20 AM, Matt McCormick wrote:

> Hi Kris,
>
> On Tue, Oct 25, 2011 at 6:20 PM, Kris Zygmunt <krismz at sci.utah.edu>  
> wrote:
>> I am trying to get the new GPU framework to build well on different
>> platforms and I am failing to get the ITKGPUCommonHeaderTest1.cxx  
>> to compile
>> on Linux (for some reason that I don't understand it compiles just  
>> fine on
>> Snow Leopard, probably something to do with Frameworks).  The error  
>> is
>
> The header test compiled fine for me without errors, but with a ton of
> warnings (gcc-4.6-Linux-Nvidia).

Yes, there are a lot of warnings, I will be working to resolve these  
before this repo is posted to gerrit.

>
>>
>> Modules/GPU/Common/include/itkcOclUtil.h:40:23: fatal error CL/ 
>> opencl.h: No
>> such file or directory
>>
>> In the GPU/Common/test/CMakeLists.txt file, there is
>> INCLUDE_DIRECTORIES(${OPENCL_INCLUDE_DIRS} $ 
>> {CMAKE_CURRENT_BINARY_DIR}/../)
>> which is how the main test programs successfully compile.
>>
>> Is there a way to have the automatically generated header test also  
>> include
>> the OPENCL_INCLUDE_DIRS?  It seems rather tedious and undesirable  
>> to have to
>> put every single GPU header file into the exclusion list in
>> BuildHeaderTest.py (I also wonder if this is the reason all of the  
>> FFT
>> headers are in BuildHeaderTest.py, is it just because they aren't  
>> including
>> the external fft include directories?).
>
> I pushed a fix with some other fixes here:
>
> https://github.com/thewtex/ITK/tree/GPU-Beta-R1
>

Thanks for these commits, I have rolled them into my repo and added a  
few more modifications.  The GPUCommon header test is now compiling  
for me.

> This disables the HeaderTest generation if ITK_USE_GPU is OFF.
> CL/opencl.h is in my standard system include path (/usr/include), so I
> did not have a problem with that.
>
> I think you may be able to fix the OPENCL_INCLUDE_DIRS problem by  
> adding an
>
>  include_directories( ${OPENCL_INCLUDE_DIRS} )
>
> in CMake/ITKModuleHeaderTest.cmake.
>

Instead, after some poking around in the CMake directory for ideas, I  
tried using

set(ITKGPUCommon_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS})

which seems to have worked since on my current test machine, CL/ 
opencl.h is not in my standard
system include path.  I also have added OPENCL_ROOT_DIR to  
FindOpenCL.cmake to help with
nonstandard OpenCL paths.

> BTW, recent ITK convention uses the lower case version of CMake  
> commands.
>

Thanks for the heads-up, I have updated the CMakeLists.txt file  
accordingly (for emacs users, M-l will convert a word to lower)

Thanks!
Kris





More information about the Insight-developers mailing list