[Insight-users] need help installing ITK under linux

Sylvain Jaume sylvainjaume at gmail.com
Tue Sep 12 22:15:30 EDT 2006


Hi Bis,

Create a directory in your home dir:
mkdir ~/ITKBuild
cd ~/ITKBuild
ccmake ~/InsightToolkit-2.8.1
Set Examples ON
Type c, then g.
Type make.

Best,
Sylvain

Biswajit Bose wrote:
> Hi,
>
> I'm having trouble installing ITK on Debian GNU/Linux. I'm unable to 
> compile the Hello World example using ccmake.
>
> I downloaded the package from the ITK website, and am following the 
> instructions in the ITK Software Guide-2.4.0.
>
> a) I unzipped/untarred the InsightToolkit tar-gz file to get the 
> directory '~/InsightToolkit-2.8.1'.
> b) I went into the directory and created a new directory called 
> 'binaries'.
> c) I went into 'binaries' and typed 'ccmake ../Code'
> d) I hit 'c' and then 'g' in ccmake. The 'binaries' directory filled 
> up with a number of files, and is currently taking up a total of 855K 
> on disk. No error messages were printed, and ccmake exited to the prompt.
> e) I went into '~/InsightToolkit-2.8.1/Examples/Installation' and 
> typed 'ccmake .'
> f) I set ITK_DIR to '~/InsightToolkit-2.8.1/binaries'. Then I hit 'c'.
>
> I got an error saying:
>
> <begin error>
> CMake Error: Error in cmake code at
> /usr/share/CMake/Modules/FindITK.cmake:80:
> INCLUDE Could not find include file:
> ~/InsightToolkit-2.8.1/binaries/ITKConfig.cmake
>
> CMake Error: Error in cmake code at
>  ~/InsightToolkit-2.8.1/Examples/Installation/CMakeLists.txt:7:
>  INCLUDE called with wrong number of arguments.  Include only takes 
> one file.
> <end error>
>
> I checked the '~/InsightToolkit-2.8.1/binaries' directory and 
> confirmed that there is no file called ITKConfig.cmake there.
>
> The CMakeLists.txt file in 
> '~/InsightToolkit-2.8.1/Examples/Installation/' is as follows:
>
> <begin cmakelists.txt>
>
> # This project is designed to be built outside the Insight source tree.
> PROJECT(HelloWorld)
>
> # Find ITK.
> FIND_PACKAGE(ITK)
> IF(ITK_FOUND)
>   INCLUDE(${ITK_USE_FILE})
> ELSE(ITK_FOUND)
>   MESSAGE(FATAL_ERROR
>           "Cannot build without ITK.  Please set ITK_DIR.")
> ENDIF(ITK_FOUND)
>
> ADD_EXECUTABLE(HelloWorld HelloWorld.cxx )
>
> TARGET_LINK_LIBRARIES(HelloWorld ITKCommon)
>
> <end cmakelists.txt>
>
> The CMakeCache.txt file from 
> '~/InsightToolkit-2.8.1/Examples/Installation/' can be found at the 
> bottom of this email. Note that in my email above, '~' refers to 
> '/afs/csail.mit.edu/u/c/cielbleu/soft/itk' below.
>
> Please help.
>
> Thanks,
> Bis
>
>
> # This is the CMakeCache file.
> # For build in directory: 
> /afs/csail.mit.edu/u/c/cielbleu/soft/itk/InsightToolkit-2.8.1/Examples/Installation 
>
> # You can edit this file to change values found and used by cmake.
> # If you do not want to change any of the values, simply exit the editor.
> # If you do want to change a value, simply edit, save, and exit the 
> editor.
> # The syntax for the file is as follows:
> # KEY:TYPE=VALUE
> # KEY is the name of a variable in the cache.
> # TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
> # VALUE is the current value for the KEY.
>
> ########################
> # EXTERNAL cache entries
> ########################
>
> //Path to a program.
> CMAKE_AR:FILEPATH=/usr/bin/ar
>
> //For backwards compatibility, what version of CMake commands and
> // syntax should this version of CMake allow.
> CMAKE_BACKWARDS_COMPATIBILITY:STRING=2.0
>
> //Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
> // CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
> //
> CMAKE_BUILD_TYPE:STRING=
>
> //C++ compiler
> CMAKE_CXX_COMPILER:STRING=c++
>
> //Flags used by the compiler during all build types.
> CMAKE_CXX_FLAGS:STRING=
>
> //Flags used by the compiler during debug builds.
> CMAKE_CXX_FLAGS_DEBUG:STRING=-g
>
> //Flags used by the compiler during release minsize builds.
> CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os
>
> //Flags used by the compiler during release builds (/MD /Ob1 /Oi
> // /Ot /Oy /Gs will produce slightly less optimized but smaller
> // files).
> CMAKE_CXX_FLAGS_RELEASE:STRING=-O3
>
> //Flags used by the compiler during Release with Debug Info builds.
> //
> CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g
>
> //C compiler
> CMAKE_C_COMPILER:STRING=gcc
>
> //Flags for C compiler.
> CMAKE_C_FLAGS:STRING=
>
> //Flags used by the compiler during debug builds.
> CMAKE_C_FLAGS_DEBUG:STRING=-g
>
> //Flags used by the compiler during release minsize builds.
> CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os
>
> //Flags used by the compiler during release builds (/MD /Ob1 /Oi
> // /Ot /Oy /Gs will produce slightly less optimized but smaller
> // files).
> CMAKE_C_FLAGS_RELEASE:STRING=-O3
>
> //Flags used by the compiler during Release with Debug Info builds.
> //
> CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g
>
> //Flags used by the linker.
> CMAKE_EXE_LINKER_FLAGS:STRING=
>
> //Flags used by the linker during debug builds.
> CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
>
> //Flags used by the linker during release minsize builds.
> CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
>
> //Flags used by the linker during release builds.
> CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
>
> //Flags used by the linker during Release with Debug Info builds.
> //
> CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
>
> //Install path prefix, prepended onto install directories.
> CMAKE_INSTALL_PREFIX:PATH=/usr/local
>
> //Path to a program.
> CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make
>
> //Flags used by the linker during the creation of modules.
> CMAKE_MODULE_LINKER_FLAGS:STRING=
>
> //Flags used by the linker during debug builds.
> CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
>
> //Flags used by the linker during release minsize builds.
> CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
>
> //Flags used by the linker during release builds.
> CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
>
> //Flags used by the linker during Release with Debug Info builds.
> //
> CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
>
> //Path to a program.
> CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
>
> //Flags used by the linker during the creation of dll's.
> CMAKE_SHARED_LINKER_FLAGS:STRING=
>
> //Flags used by the linker during debug builds.
> CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
>
> //Flags used by the linker during release minsize builds.
> CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
>
> //Flags used by the linker during release builds.
> CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
>
> //Flags used by the linker during Release with Debug Info builds.
> //
> CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
>
> //If set, runtime paths are not added when using shared libraries.
> //
> CMAKE_SKIP_RPATH:BOOL=OFF
>
> //If true, cmake will use relative paths in makefiles and projects.
> //
> CMAKE_USE_RELATIVE_PATHS:BOOL=OFF
>
> //If this value is on, makefiles will be generated without the
> // .SILENT directive, and all commands will be echoed to the console
> // during the make.  This is useful for debugging only. With Visual
> // Studio IDE projects all commands are done without /nologo.
> CMAKE_VERBOSE_MAKEFILE:BOOL=OFF
>
> //Single output directory for building all executables.
> EXECUTABLE_OUTPUT_PATH:PATH=
>
> //Value Computed by CMake
> HelloWorld_BINARY_DIR:STATIC=/afs/csail.mit.edu/u/c/cielbleu/soft/itk/InsightToolkit-2.8.1/Examples/Installation 
>
>
> //Value Computed by CMake
> HelloWorld_SOURCE_DIR:STATIC=/afs/csail.mit.edu/u/c/cielbleu/soft/itk/InsightToolkit-2.8.1/Examples/Installation 
>
>
> //The directory containing ITKConfig.cmake.  This is either the
> // root of the build tree, or PREFIX/lib/InsightToolkit for an
> // installation.
> ITK_DIR:PATH=/afs/csail/u/c/cielbleu/soft/itk/InsightToolkit-2.8.1/binaries 
>
>
> //Single output directory for building all libraries.
> LIBRARY_OUTPUT_PATH:PATH=
>
>
> ########################
> # INTERNAL cache entries
> ########################
>
> //Advanced flag for variable: CMAKE_AR
> CMAKE_AR-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_BUILD_TOOL
> CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1
> //What is the target build tool cmake is generating for.
> CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/make
> //This is the directory where this CMakeCahe.txt was created
> CMAKE_CACHEFILE_DIR:INTERNAL=/afs/csail.mit.edu/u/c/cielbleu/soft/itk/InsightToolkit-2.8.1/Examples/Installation 
>
> //Major version of cmake used to create the current loaded cache
> //
> CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2
> //Minor version of cmake used to create the current loaded cache
> //
> CMAKE_CACHE_MINOR_VERSION:INTERNAL=0
> //Major version of cmake used to create the current loaded cache
> //
> CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 5
> //Path to CMake executable.
> CMAKE_COMMAND:INTERNAL=/usr/bin/cmake
> //Path to ctest program executable.
> CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest
> //Advanced flag for variable: CMAKE_CXX_COMPILER
> CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
> //full path to the compiler cmake found
> CMAKE_CXX_COMPILER_FULLPATH:INTERNAL=/usr/bin/c++
> //Result of TRY_COMPILE
> CMAKE_CXX_COMPILER_WORKS:INTERNAL=TRUE
> //Advanced flag for variable: CMAKE_CXX_FLAGS
> CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_CXX_FLAGS_DEBUG
> CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_CXX_FLAGS_MINSIZEREL
> CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_CXX_FLAGS_RELEASE
> CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
> CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_COMPILER
> CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
> //full path to the compiler cmake found
> CMAKE_C_COMPILER_FULLPATH:INTERNAL=/usr/bin/gcc
> //Result of TRY_COMPILE
> CMAKE_C_COMPILER_WORKS:INTERNAL=TRUE
> //Advanced flag for variable: CMAKE_C_FLAGS
> CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_FLAGS_DEBUG
> CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_FLAGS_MINSIZEREL
> CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_FLAGS_RELEASE
> CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
> CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
> //Path to cache edit program executable.
> CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/ccmake
> //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS
> CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
> CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
> //
> CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
> CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
> //
> CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
> //Name of generator.
> CMAKE_GENERATOR:INTERNAL=Unix Makefiles
> //Start directory with the top level CMakeLists.txt file for this
> // project
> CMAKE_HOME_DIRECTORY:INTERNAL=/afs/csail.mit.edu/u/c/cielbleu/soft/itk/InsightToolkit-2.8.1/Examples/Installation 
>
> //Advanced flag for variable: CMAKE_MAKE_PROGRAM
> CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS
> CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
> CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
> //
> CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
> //
> CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
> //
> CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_RANLIB
> CMAKE_RANLIB-ADVANCED:INTERNAL=1
> //Path to CMake installation.
> CMAKE_ROOT:INTERNAL=/usr/share/CMake
> //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS
> CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
> CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
> //
> CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
> //
> CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
> //
> CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_SKIP_RPATH
> CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
> //uname command
> CMAKE_UNAME:INTERNAL=/bin/uname
> //Advanced flag for variable: CMAKE_USE_RELATIVE_PATHS
> CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_VERBOSE_MAKEFILE
> CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
> //Path to an executable
> HelloWorld_CMAKE_PATH:INTERNAL=/afs/csail.mit.edu/u/c/cielbleu/soft/itk/InsightToolkit-2.8.1/Examples/Installation 
>
>
>
>


More information about the Insight-users mailing list