[Insight-users] watershed example does not compile

Luis Ibanez luis.ibanez@kitware.com
Tue, 09 Apr 2002 19:50:39 -0400


Paul,

According to your error message, the compilation
line is providing the following include paths:

-I/Code/Common
-I/Code/IO
-I/Code/BasicFilters
-I/Code/Algorithms

they should look something like:

-I/compsci/robb/ugrad/berube/Insight/Code/Common
-I/compsci/robb/ugrad/berube/Insight/Code/Algorithms
-I/compsci/robb/ugrad/berube/Insight/Code/IO
-I/compsci/robb/ugrad/berube/Insight/Code/BasicFilters

It looks like the ITK Source directory
is being lost on the way.  This is stored
in the CMake variable : ITK_SOURCE_DIR,
(which in your case should contain something
like "/compsci/robb/ugrad/berube/Insight"   )

However if you succed to compile the rest
of ITK this variable should be ok....

A quick question:
Are you compiling this example by moving
it outside the ITK building tree ?
That can be done, but you need to add a couple
of lines to the CMakeLists.txt file in order to
indicate to CMake where the rest of ITK is in
your disk.

Another question:
When you ran CMake did you enabled the option:

    BUILD_EXAMPLES="ON"

CMake has a progressive approach for setting
the configuration.  The BUILD_EXAMPLE option
has to be enabled before you get to
BUILD_WATERSHED_SEGMENTATION.

Enabling BUILD_EXAMPLES should create the
Examples directory in the outsource build.
Then enabling BUILD_WATERSHED_SEGMENATION
should create the Watershed example dir
in the outsource dir too.

Normally you don't need to run cmake inside
subdirs because the CMakeLists.txt files
are organized in a tree like structure
following the directory structure. When
you run cmake in the sub-dir of a project
it can't know that there is something above
the current directory.  The CMakeLists.txt
files on the parent directories prepare useful
variables like  "ITK_SOURCE_DIR".

Try running ccmake only at the top level of
your Insight tree and make sure that you enable
first BUILD_EXAMPLES and
then BUILD_WATERSHED_SEGMENTATION


Please let us know if that helps.


Luis


====================

Paul Berube wrote:

>ok, here it is...
>
>this is after running ccmake in the source directory (the Waterhshed...)
>directory does not exist in the out-of-source examples directory where itk
>was built.  make was also run in this dir.
>
>[berube@horse-rv WatershedSegmentation]$ make
>/compsci/robb/ugrad/berube/bin/cmake
>-S/compsci/robb/ugrad/berube/Insight/Examples/WatershedSegmentation
>-O/compsci/robb/ugrad/berube/Insight/Examples/WatershedSegmentation
>-H/compsci/robb/ugrad/berube/Insight/Examples/WatershedSegmentation
>-B/compsci/robb/ugrad/berube/Insight/Examples/WatershedSegmentation
>cmake.depends is up-to-date
>c++ -g -O2
>-I/compsci/robb/ugrad/berube/Insight/Examples/WatershedSegmentation
>-I/Code/Common -I/Code/IO -I/Code/BasicFilters -I/Code/Algorithms
>-I/Examples/WatershedSegmentationExample   -c
>/compsci/robb/ugrad/berube/Insight/Examples/WatershedSegmentation/itkWatershedSegmentationExample.cxx
>-o itkWatershedSegmentationExample.o
>/compsci/robb/ugrad/berube/Insight/Examples/WatershedSegmentation/itkWatershedSegmentationExample.cxx:17:37:
>itkWatershedImageFilter.h: No such file or directory
>/compsci/robb/ugrad/berube/Insight/Examples/WatershedSegmentation/itkWatershedSegmentationExample.cxx:18:57:
>itkCurvatureAnisotropicDiffusionImageFilter.h: No such file or directory
>/compsci/robb/ugrad/berube/Insight/Examples/WatershedSegmentation/itkWatershedSegmentationExample.cxx:19:45:
>itkGradientMagnitudeImageFilter.h: No such file or directory
>/compsci/robb/ugrad/berube/Insight/Examples/WatershedSegmentation/itkWatershedSegmentationExample.cxx:20:36:
>itkImageRegionIterator.h: No such file or directory
>/compsci/robb/ugrad/berube/Insight/Examples/WatershedSegmentation/itkWatershedSegmentationExample.cxx:21:31:
>itkRawImageWriter.h: No such file or directory
>/compsci/robb/ugrad/berube/Insight/Examples/WatershedSegmentation/itkWatershedSegmentationExample.cxx:24:24:
>itkCommand.h: No such file or directory
>make[1]: *** [itkWatershedSegmentationExample.o] Error 1
>make: *** [default_target] Error 2
>
>
>Thanks!
>
>
>