[Rtk-users] compilation issues in case of outside of ITK directory build

Julia Semyakishkina prekrasnaya1985 at gmail.com
Sat Oct 27 00:04:47 EDT 2018


Hi. Yes, i am.
Could you just run this simple script in empty directory:
#!/bin/sh
wget
https://sourceforge.net/projects/itk/files/itk/4.13/InsightToolkit-4.13.1.tar.gz
tar -xvzf InsightToolkit-4.13.1.tar.gz
mkdir InsightToolkit-4.13.1/build && cd InsightToolkit-4.13.1/build
cmake -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS:BOOL=ON .. && make
-j`grep -c processor /proc/cpuinfo`
ITK_DIR=`pwd`
cd ../../
git clone https://github.com/SimonRit/RTK
mkdir RTK/build && cd RTK/build
cmake -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS:BOOL=ON -D
BUILD_TESTING:BOOL=OFF -D ITK_DIR:PATH=$ITK_DIR .. && make

Don't you have the same linker errors i wrote in the previous message ?

some info about my system
Ubuntu 17.04
Linux mnolro6001 4.10.0-42-generic #46-Ubuntu SMP Mon Dec 4 14:38:01 UTC
2017 x86_64 x86_64 x86_64 GNU/Linux
gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2)
cmake version 3.13.0-rc1




On Fri, Oct 26, 2018 at 8:05 PM Simon Rit <simon.rit at creatis.insa-lyon.fr>
wrote:

> Hi,
> Are you sure it's shared with the same compilation mode (Debug or Release)
> ?
> Simon
>
> On Fri, Oct 26, 2018 at 5:18 AM Julia Semyakishkina <
> prekrasnaya1985 at gmail.com> wrote:
>
>> Ok, it works in case ITK Static -> RTK Static. When i try to build ITK
>> Shared -> RTK Shared, i have got:
>> [ 19%] Linking CXX executable ../../bin/rtkamsterdamshroud
>> CMakeFiles/rtkamsterdamshroud.dir/rtkamsterdamshroud.cxx.o: In function
>> `rtk::ThreeDCircularProjectionGeometryXMLFileReader::New()':
>> rtkamsterdamshroud.cxx:(.text._ZN3rtk45ThreeDCircularProjectionGeometryXMLFileReader3NewEv[_ZN3rtk45ThreeDCircularProjectionGeometryXMLFileReader3NewEv]+0xe):
>> undefined reference to `typeinfo for
>> rtk::ThreeDCircularProjectionGeometryXMLFileReader'
>> rtkamsterdamshroud.cxx:(.text._ZN3rtk45ThreeDCircularProjectionGeometryXMLFileReader3NewEv[_ZN3rtk45ThreeDCircularProjectionGeometryXMLFileReader3NewEv]+0x41):
>> undefined reference to `typeinfo for
>> rtk::ThreeDCircularProjectionGeometryXMLFileReader'
>> rtkamsterdamshroud.cxx:(.text._ZN3rtk45ThreeDCircularProjectionGeometryXMLFileReader3NewEv[_ZN3rtk45ThreeDCircularProjectionGeometryXMLFileReader3NewEv]+0xc9):
>> undefined reference to
>> `rtk::ThreeDCircularProjectionGeometryXMLFileReader::ThreeDCircularProjectionGeometryXMLFileReader()'
>> CMakeFiles/rtkamsterdamshroud.dir/rtkamsterdamshroud.cxx.o: In function
>> `std::vector<std::__cxx11::basic_string<char, std::char_traits<char>,
>> std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char,
>> std::char_traits<char>, std::allocator<char> > > > const
>> rtk::GetProjectionsFileNamesFromGgo<args_info_rtkamsterdamshroud>(args_info_rtkamsterdamshroud
>> const&)':
>> rtkamsterdamshroud.cxx:(.text._ZN3rtk30GetProjectionsFileNamesFromGgoI28args_info_rtkamsterdamshroudEEKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EERKT_[_ZN3rtk30GetProjectionsFileNamesFromGgoI28args_info_rtkamsterdamshroudEEKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EERKT_]+0x3c1):
>> undefined reference to `rtk::RegisterIOFactories()'
>> CMakeFiles/rtkamsterdamshroud.dir/rtkamsterdamshroud.cxx.o: In function
>> `rtk::ProjectionsReader<itk::Image<double, 3u>
>> >::GenerateOutputInformation()':
>> rtkamsterdamshroud.cxx:(.text._ZN3rtk17ProjectionsReaderIN3itk5ImageIdLj3EEEE25GenerateOutputInformationEv[_ZN3rtk17ProjectionsReaderIN3itk5ImageIdLj3EEEE25GenerateOutputInformationEv]+0x8e1):
>> undefined reference to `rtk::RegisterIOFactories()'
>> collect2: error: ld returned 1 exit status
>> applications/rtkamsterdamshroud/CMakeFiles/rtkamsterdamshroud.dir/build.make:141:
>> recipe for target 'bin/rtkamsterdamshroud' failed
>> make[2]: *** [bin/rtkamsterdamshroud] Error 1
>> CMakeFiles/Makefile2:512: recipe for target
>> 'applications/rtkamsterdamshroud/CMakeFiles/rtkamsterdamshroud.dir/all'
>> failed
>> make[1]: ***
>> [applications/rtkamsterdamshroud/CMakeFiles/rtkamsterdamshroud.dir/all]
>> Error 2
>> Makefile:129: recipe for target 'all' failed
>> make: *** [all] Error 2
>>
>> On Fri, Oct 26, 2018 at 2:59 AM Simon Rit <simon.rit at creatis.insa-lyon.fr>
>> wrote:
>>
>>> Hi,
>>> It seems that you are trying to compile against an installed ITK_DIR.
>>> This is no longer possible, see this thread:
>>> https://github.com/SimonRit/RTK/issues/207
>>> Can you try to compile against your build directory (set ITK_DIR to the
>>> build directory)?
>>> Thanks,
>>> Simon
>>>
>>> On Thu, Oct 25, 2018 at 5:16 PM Julia Semyakishkina <
>>> prekrasnaya1985 at gmail.com> wrote:
>>>
>>>> Hello.
>>>> I can't build RTK in Linux. I've done all default steps described in
>>>> wiki, but on configure i've got:
>>>> CMake Error at utilities/lp_solve/CMakeLists.txt:9 (include):
>>>>    include could not find load file:
>>>>
>>>>      ITKModuleMacros
>>>>
>>>>
>>>> Hm.. it tries include module that exists in src ITK dir, not install...
>>>> I mean
>>>> "ls /usr/local/lib/cmake/ITK-4.13 | grep ITKModuleMacros" prints nothing
>>>> "ls /home/user/src/ITK/CMake | grep ITKModuleMacros" prints
>>>> ITKModuleMacros.cmake
>>>>
>>>> OK, i have just tried to add CMAKE_MODULE_PATH=/home/user/src/ITK/CMake
>>>> and got next error:
>>>>
>>>> CMake Error at CMakeLists.txt:250 (message):
>>>>   Modules can only be built against an ITK build tree; they cannot be
>>>> built
>>>>   against an ITK install tree.
>>>>
>>>> Let's look at the code:
>>>>
>>>> if(NOT ITK_SOURCE_DIR)
>>>>   if(NOT EXISTS ${ITK_CMAKE_DIR}/ITKModuleMacros.cmake)
>>>>     message(FATAL_ERROR "Modules can only be built against an ITK build
>>>> tree; they cannot be built against an ITK install tree.")
>>>>   endif()
>>>>   list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR})
>>>>   include(ITKModuleExternal)
>>>> else()
>>>>   itk_module_impl()
>>>> endif()
>>>>
>>>> Yea, ITK_SOURCE_DIR is not set in my case, but why there is must be
>>>> ITKModuleMacros.cmake at my ITK_CMAKE_DIR dir that points to ITK
>>>> installation dir ?
>>>>
>>>> If i set ITK_CMAKE_DIR to /home/user/src/ITK/CMake where
>>>> ITKModuleMacros is, it resets back to ITK installation directory at
>>>> # --------------------------------------------------------
>>>> # Find ITK (required)
>>>> if(NOT ITK_SOURCE_DIR)
>>>>   find_package(ITK 4.12.0 REQUIRED)
>>>> endif()
>>>>
>>>>
>>>> So, the only way i see is to build inside ITK, but i am not familiar
>>>> with this. Could anyone help me how to build RTK inside ITK.
>>>> _______________________________________________
>>>> Rtk-users mailing list
>>>> Rtk-users at public.kitware.com
>>>> https://public.kitware.com/mailman/listinfo/rtk-users
>>>>
>>> _______________________________________________
>> Rtk-users mailing list
>> Rtk-users at public.kitware.com
>> https://public.kitware.com/mailman/listinfo/rtk-users
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/rtk-users/attachments/20181027/d4306a92/attachment.html>


More information about the Rtk-users mailing list