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:
Can someone help me?
Are you enabling
Module_TotalVariation:BOOL=ON when you compile ITK?
proxTV is fetched when using the TotalVariation module: https://github.com/InsightSoftwareConsortium/ITKTotalVariation
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
- 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
- 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
Double checking, the option is named:
USE_SYSTEM_PROXTV as you reported. Try setting
ITK_USE_SYSTEM_proxTV to OFF.
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: *** [CMakeFiles/HelloWorld.dir/build.make:349: HelloWorld] Error 1
make: *** [CMakeFiles/Makefile2:95: CMakeFiles/HelloWorld.dir/all] Error 2
make: *** [Makefile:103: all] Error 2
The CMakeLists.txt is:
cmake_policy(SET CMP0003 NEW)
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
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.
And delete the option
//Override default GIT_TAG value for remote module TotalVariation
Then, re-configure and re-build ITK, and do the same with your HelloWorld project that links to that freshly built ITK with
EDIT: To check the current SHA for the module see Update remote module in ITK