-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrating KWSys & VNL+VCL into CTK as external libraries #949
Comments
To better understand, could you indicate what you are trying to achieve ? Without more details, I suggest to use Qt built-in features instead of adding a dependencies to kwsys. If you have ITK or VTK based classes, |
I tried to use ITK which has kwsys but it doesn't download at all it gets stucked.
|
Actually I am trying to make a custom version of CTK without ITK & VTK but I still need KWSys. I want to learn how to be able to integrate external projects which I am depending on inside of CTK so that it gets recognized with library linking. It is connected with my goal of porting the Blueberry Framework from MITK towards CTK... I almost achieved it but the lack of KWSys is blocking the compilation. Parts of Blueberry are deeply rooted with KWSys & ITK. I extracted the necessary components required and isolated them into the Libs folder. Now I just need KWSys to work out without depending on the massive ITK & VTK. Is this clear enough? |
It turns out that ITK external project in CTK is obsolete (see https:/commontk/CTK/blob/master/CMakeExternals/ITK.cmake). In practice, we build CTK passing |
I want to remove from CTK all ITK & VTK and unnecessary components without getting rid of KWSys and VNL. I want to be able to build my Workspace with Blueberry Framework without any Medial Visualisation dependencies. |
Since most of the functionalities of kwsys are available through Qt, I don't think it makes sense to integrate it. Few options:
|
This is the file I added like you mentioned:
How do I use this in my code ? |
Then, you need to introduce the dependency to KWSys in your library like it is done here: https:/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/target_libraries.cmake This will ensure the external project is build when you build Blueberry library. That said, by default the namespace for KWsys will be See https://gitlab.kitware.com/utils/kwsys/-/blob/master/README.rst |
Here is a pull request updating the version of ITK along with few other tweaks, see #951 In the pull request I linked, looking at what was done to removed older project like ZMQ should help you understand what need to be done to add KWSys ... |
I was able to add KWSys & VXL(vnl,vcl) but I get to a point where the linking doesn't work with your method: You can check what I did for the last 3 commits. https:/al-sabr/CTK/commits/ctk-blueberry-port-from-mitk
|
The current version used in CTK is old, consider re-basing on top of #951 |
How can I achieve your advice? By the way both KWSYS(itksys) & VXL compile successfully but are somehow not linked by CTK. The only library which is not compiling is https:/al-sabr/CTK/tree/ctk-blueberry-port-from-mitk/Libs/itk I think that I added everything as dependencies : https:/al-sabr/CTK/blob/f7c8c98630a86db70b349ef49c53e3a675748b49/Libs/itk/target_libraries.cmake#L7 Am I linking the wrong target names or what? The generated folder is itksys as supposed: Due to |
I noticed that the following library have been added to your topic, I would suggest to remove these:
This one should probably be contributed in its own CTK pull request or we could re-assess if it is really needed. Reading this post was informative: https://stackoverflow.com/questions/17937618/how-to-use-qtsingleapplication#17937747 Last, since there is a maintained project for Qt5 and Qt6, I would prefer we use this instead of maintaining our own .... https:/itay-grudev/SingleApplication |
Sadly, I do not have the bandwidth to review in details. That said, there are few red flags to address:
The plugins living in the It may be worth to step back and try to understand the following:
|
Hi,
this being somewhat my legacy, I feel the urge to comment here.
BlueBerry plugins *are* CTK plugins. They have some additional CMake
helpers if I remember correctly, and additional dependencies to other
BlueBerry plugins.
I believe it would be fair to mark the CTK Plugin Framework as "not
maintained" and depending on the external usage (if there is any data
about that at all), the plugin framework could be deprecated and
eventually removed from CTK. People could be pointed to CppMicroServices
for an alternative (it lacks some plugins present in CTK though).
Years ago, I was playing with the idea to make the CTK PluginFramework
use CppMicroServices under the hood. The CTK part would then act as a
compatibility layer to ease the transition to CppMicroServices.
Obviously, this never happened.
Best,
Sascha
…On 2/9/21 11:13 PM, Jean-Christophe Fillion-Robin wrote:
Am I linking the wrong target names or what?
Sadly, I do not have the bandwidth to review in details.
That said, there are few red flags to address:
* A Library called |itk| inside CTK should probably not be added.
May be useful classes could be contributed to upstream ITK or to
an independent ITK module (see
https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.html#x50-1430009
<https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.html#x50-1430009>)
* The namespace associated with KWSys should not be |itksys| as it
is "reserved" for ITK project. We should really avoid KWSys as a
dependency.
* Adding VNL as a direct dependency is likely out of the scope of CTK
The plugins living in the |Plugins| directory of CTK are expected to
be CTK plugins, your branch integrates a different flavor of plugins
following the "blueberry" paradigm.
It may be worth to step back and try to understand the following:
* What is the current usage of the CTK plugins infrastructure ? my
understanding is that it was intended to be used in MITK ***@***.***
<https:/nolden> may be able to comment further)
* Is there a way to work on a roadmap where we would deprecate (or
update) CTK plugins ? I really would like to avoid having to
maintain multiple plugin mechanism.
cc: @pieper <https:/pieper> @lassoan
<https:/lassoan> @nolden <https:/nolden>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#949 (comment)>,
or unsubscribe
<https:/notifications/unsubscribe-auth/AABVPJK6MVRPZ3ASP6PUPVLS6GXSPANCNFSM4XLH355A>.
|
@jcfr My goal right now is to modularize the CTKitk to get rid of ITK in its whole, What you are suggesting I will consider for the next stages but I only want to be able to have my CTK, PluginFramework, Blueberry & my Workspace so that I can start to build my app. I don't want at the moment to remove those :
This is my last compilation error and I am not compiling anything which is depending on ITK neither VTK. I didn't activated the ImageProcessing library or Vizualisation library. As I said I want to remove any Libs or Apps or Plugins which are DMTK ITK VTK or any other TK dependant ending libraries. Is there any bug with the handling of external dependencies by CTK for the following?
|
Thanks for your input, this is really helpful and informative. I will write an email on the CTK list and create an issue accordingly so that we can move forward.
Do you recall the details ? |
The following file should be updated as well: https:/al-sabr/CTK/blob/f7c8c98630a86db70b349ef49c53e3a675748b49/CMake/ctkBlockCheckDependencies.cmake#L64-L113 |
I am now having errors from CMake:
I found this file and tried to add it in the CMake folder but not success! https:/lbaehren/CMakeModules/blob/master/FindKWSys.cmake
I could not test this one neither : https:/OpenMBIR/OpenMBIR-TEM/blob/master/Support/cmp/Modules/FindVXL.cmake I found this tutorial which says that FindXXX.cmake files are not good : https://cliutils.gitlab.io/modern-cmake/chapters/install.html |
I really don't know what to do yet! I am out of options ... |
Since the But again, all files in the itk library of blueberry are already maintained in ITK itself, if you compile ITK statically ... it would have a very low footprint and likely achieve the same thing. |
As you can see here I initialized the namespace: For the sake of understanding and getting better in CMake I am trying to remove all external dependencies and have a clean slate. I don't get it why KWSYS & VXL are compiling super smooth but are not linked. I want to understand why this beast of CMake is behaving weird. You can also see that I applied your recommendations : https:/al-sabr/CTK/blob/a523ed3a183793c6bdc8d789df12455d27ca3783/CMake/ctkBlockCheckDependencies.cmake#L64 I am pretty sure it is something really small detail which is hindering me. |
@jcfr I tried your suggestion with ITK at the end and still it doesn't work: |
Thanks for moving in that direction, removing the copy of ITK files and using the official built statically is the most sustainable path forward. Now, to address the issue regarding the static build of ITK. Could you post the options you used to configure it on the ITK forum. See https://discourse.itk.org/. You post should include step for reproducing the problem using instructions like these where you will use correct values instead of placeholders:
|
It also looks like the |
This is the full log : https://pastebin.com/RRxxNci2 I am using CMake GUI and CTKmitk has this:
Ticket ITK : https://discourse.itk.org/t/compiling-ctk-with-itk-activated-fails/3855 |
The first error is this:
I don't remember seeing this error before. Is this coming from GDCM, HDF5, or somehow their interaction? |
Look at the screenshots it is detailed. New log with more details : https://pastebin.com/HNx6QBam
|
What do you think the problem is ! How can I deactivate the build for ITKGDCM? Can this be the solution for the compiling error : https://gist.github.com/ugovaretto/5875385 Guys why is this so complicated I just want to use my port of Blueberry! |
Is there any one who still reading this ticket ? |
When compiling ITK, you can turn off a CMake setting |
What are the basic low footprint required modules for ITK to compile with KWSys & VXL |
Only |
Is there any kind of setting for basic compile ? |
Disable all modules except ITKCommon, and use default settings for the rest? |
There is no other options even when I created a variable in CMake with ITK_BUILD_DEFAULT_MODULES = OFF Created a ticket : https://discourse.itk.org/t/only-necessary-to-compile-itkcommon-with-kwsys-vxl/3863 |
I found this blog post concerning ITK and settings : https://blog.kitware.com/advance-itk-with-modules/ But what is weird is that in CTK no ITK_BUILD_DEFAULT_MODULES is appearing to be deactivated in the CMake GUI. There is only a few options which are available after the first configure. I added the Module_XXXX by myself ! When I use the command line I get this message:
|
Trying to move basic KWSys & VXL in independant module : InsightSoftwareConsortium/ITK#2298 |
@al-sabr since this is a SuperBuild, i.e. a CMake build that coordinates the build of other projects, options are only available for the SuperBuild in the CMake GUI, not the component projects, e.g. ITK. |
The integration was successfully completed with a custom ITK version that I need to work a little bit more on so that it doesn't break Core/Common. |
A bit longer explanation is given here: InsightSoftwareConsortium/ITK#2325 (comment). This issue can be closed (I don't have permission to do it myself). |
Greetings
I would like to be able to use KWSys inside of CTK as a submodule can someone guide toward achieving my goal?
Best Regards
The text was updated successfully, but these errors were encountered: