Problem compiling project: error ld with -lproxTV

Hi.

I am compiling a project with ITK 5.1.2 over KDE Neon (based on Ubuntu 20.04 LTS) and I obtain the error: /usr/bin/ld: cannot find -lproxTV. However, if I go to ./itk/lib there is libitkproxTV-5.1.a. And ITK compiled without problem (some warning).

I tried to compile ITK with gcc (9.3.0) and clang (10.0.1) but it shows the same error. I have defined in my .profile:

export VTK_DIR=/opt/vtk/lib/cmake/vtk-9.0
export ITK_DIR=/opt/itk/lib/cmake/ITK-5.1

Can someone help me?

Many thanks.

Are you enabling Module_TotalVariation:BOOL=ON when you compile ITK?
proxTV is fetched when using the TotalVariation module: https://github.com/InsightSoftwareConsortium/ITKTotalVariation

Yes.

And I have USE_SYSTEM_PROXTV to off.

I cannot reproduce using itk master, and a external example requiring ITK TotalVaration module.
The library associated with the target proxTV::proxTV is indeed libitkproxTV (no -lproxTV).

  • Was this working before and now failing with that release, or is it a new project?
  • In your project, do you have any logic specific to the library proxTV?
  • Have you tried a clean build of your project?

Running out of ideas, but I suspect that if it is asking for -lproxTV is because an option in the CACHE is set to use the system proxTV (instead of the internal libitkproxTV).

Double checking, the option is named: ITK_USE_SYSTEM_proxTV, not USE_SYSTEM_PROXTV as you reported. Try setting ITK_USE_SYSTEM_proxTV to OFF.

Hi.

I think there is a bug in ITK 5.1. I installed in a virtual machine Manjaro (it is stable and popular) in order to test if could be because “some” configuration in KDE Neon, moreover, it is based in Arch, not Ubuntu.

I used the KDE version and I compiled from source ITK 5.1.2 without problem using gcc 10.2.0 and cmake 3.19.3. I obtained some warnings but no errors.

I compiled the Hello_Word project from ITK Software Guide and I obtained the same error:

[50%] Linking CXX executable HelloWorld
/usr/bin/ld: cannot find -lproxTV
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/HelloWorld.dir/build.make:349: HelloWorld] Error 1
make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/HelloWorld.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

The CMakeLists.txt is:

project(HelloWorld)

cmake_minimum_required(VERSION 3.19)

if(COMMAND cmake_policy)
      cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)

find_package(ITK REQUIRED)

include(${ITK_USE_FILE})

add_executable(HelloWorld HelloWorld.cxx)

target_link_libraries(HelloWorld ${ITK_LIBRARIES})

I am sorry I cannot reproduce in Archlinux, gcc-10.2, cmake-3.19.2

Tested with ITK release branch.

cd /path//itk-src; git checkout release
cd /path/itk-build
cmake -G Ninja /path/itk-src -DModule_TotalVariation:BOOL=ON

ITK compiles successfully with some warnings.

Then I compile whatever hello world example, and it links ok.

I am wondering if you are using an old SHA for the module.

Open your /path/itk-build/CMakeCache.txt
And delete the option Module_TotalVariation_GIT_TAG:

//Override default GIT_TAG value for remote module TotalVariation
Module_TotalVariation_GIT_TAG:STRING=e47fb5b1e2eef32cddb131d8ba47b78dbde9fbbd

Then, re-configure and re-build ITK, and do the same with your HelloWorld project that links to that freshly built ITK with -DITK_DIR=/path/itk-build.

EDIT: To check the current SHA for the module see Update remote module in ITK

2 Likes