View Issue Details

IDProjectCategoryView StatusLast Update
0003247Slicer4Core: Building (CMake, Superbuild)public2014-03-06 09:06
Reporterluis Assigned Tojcfr  
PriorityhighSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionSlicer 4.2.0 
Target VersionSlicer 4.3.0Fixed in VersionSlicer 4.3.0 
Summary0003247: Configuring a loadable module out-of-source always requires an empty build directory
Description

I have a loadable module that I'm configuring and building outside the Slicer source tree using the following instructions:

http://slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Module

This works just fine until I need to alter the configuration, i.e. I change some of the CMakeLists.txt files in the module. If I change a CMakeLists.txt file, then try to just run

cmake .

Then I get a huge amount of warnings and errors, where most of the warnings are just copies of:

CMake Warning (dev) at /usr/local/share/cmake-2.8/Modules/FindQt4.cmake:409 (add_library):
ADD_LIBRARY called with MODULE option but the target platform does not
support dynamic linking. Building a STATIC library instead. This may lead
to problems.

among others. The only way to get the module to configure properly is to then wipe out the entire contents of the build directory and start over, which can take lots of time. Is there a way to make module reconfiguration a bit easier?

Note: I'm using the Nightly version of Slicer, revision c0fce9cf8069b5a996a77adfbbace71bb9187139.

TagsNo tags attached.

Activities

jcfr

jcfr

2013-07-25 10:07

administrator   ~0009196

Does the same happen using the loadable module template [1] ?

[1] https://github.com/Slicer/Slicer/tree/master/Extensions/Testing/LoadableExtensionTemplate

luis

luis

2013-07-25 10:17

developer   ~0009197

I've just verified that this bug also occurs with the simple loadable module template (with the changes required to CMakeLists.txt to build it outside of the Slicer source).

jcfr

jcfr

2013-07-29 12:13

administrator   ~0009255

From Steve:

To help debug this, can you the following steps and then describe how what you are doing differs?

If I cut-and-paste this code [1] that creates a dummy extension it builds and loads correctly. If I cd to the build directory and run "cmake ." and make I don't get any errors or warnings. What do you get?

Best,
Steve

[1] http://slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/ModuleWizard#Creating_and_Testing_a_Loadable_Module

jcfr

jcfr

2013-07-29 12:30

administrator   ~0009257

From Luis:

Hi Steve,

I should have been clearer: I have an extension with a few modules, and I'm trying to individually build one specific module from that extension. Here are the steps I took to reproduce the bug:

NEWMODULE=NewModule
SLICERSUPERBUILD=pwd

../Slicer/Utilities/Scripts/ModuleWizard.py --template ../Slicer/Extensions/Testing/LoadableExtensionTemplate --target /tmp/${NEWMODULE} ${NEWMODULE}
mkdir /tmp/${NEWMODULE}-build

then I added the changes from [1] to /tmp/${NEWMODULE}/LoadableModuleTemplate/CMakeLists.txt. Note: I had to add a project() line to make it work, unlike what is specified in the documentation (J-C and I spoke about this). Next:

cd /tmp/${NEWMODULE}-build
cmake /tmp/${NEWMODULE}/LoadableModuleTemplate -DSlicer_DIR:PATH=${SLICERSUPERBUILD}/Slicer-build

Please note that I call cmake on the module within the extension, not the extension itself. This is so I can work with one module at a time. At this point, the build configures just fine.

Next, I make any arbitrary change at all to the source configuration. For instance, I added a message() call to /tmp/${NEWMODULE}/LoadableModuleTemplate/CMakeLists.txt. When I return to /tmp/${NEWMODULE}-build and run "cmake .", the bug occurs.

Thanks for your help!

-Luis

[1] http://slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Tutorials/BundleModulesIntoExtension#Possible_tweak_of_Module_level_CMakeLists.txt

2013-07-30 05:29

 

CMakeLists.txt (2,115 bytes)
CMakeLists.txt (2,115 bytes)
luis

luis

2013-07-30 05:29

developer   ~0009265

Last edited: 2013-07-30 05:30

From mailing list:

Hi Steve,

I've attached the edited file for NewModule/LoadableModuleTemplate/CMakeLists.txt that I use to reproduce the error. The lines marked "new" are the ones not present in the template. Once the module is configured, you can simply uncomment the message() call near the top and run "cmake ." again to see the error. I've also attached some of the errors output (I couldn't go far enough in my command line history to get the entire error).

To repeat the steps:

1) Create the template extension+module structures as done above.
2) Replace NewModule/LoadableModuleTemplate/CMakeLists.txt with the file I've attached.
3) mkdir /tmp/NewModule-build; cd /tmp/NewModule-build
4) cmake -DSlicer_DIR:PATH=/path/to/Slicer-build /tmp/NewModule/LoadableModuleTemplate
5) Uncomment the message() line in /NewModuleLoadableModuleTemplate/CMakeLists.txt
6) cd /tmp/NewModule-build; cmake .

Let me know if you have any more questions!

Note: CMakeLists.txt has been attached to bug report

luis

luis

2013-07-30 09:19

developer   ~0009271

From mailing list:

To update:

JC and I localized the problem to be with the following line:

find_package(Slicer COMPONENTS ConfigurePrerequisites)

When that line is commented out, re-configuration works perfectly.

jcfr

jcfr

2013-08-19 05:59

administrator   ~0009503

Hi Luis,

I had an other look at the issue and fail to reproduce it. Is this still a problem ?

jcfr

jcfr

2013-08-28 11:26

administrator   ~0009665

Last edited: 2013-08-28 11:59

This has already been fixed in r22115
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=22115

See also r22349 - http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=22349

jcfr

jcfr

2014-03-06 05:00

administrator   ~0010845

Closing resolved issues that have not been updated in more than 3 months

luis

luis

2014-03-06 05:05

developer   ~0010897

Just confirming that this has indeed been fixed.

jcfr

jcfr

2014-03-06 09:06

administrator   ~0011238

Thanks for checking :)

Issue History

Date Modified Username Field Change
2013-07-25 10:01 luis New Issue
2013-07-25 10:01 luis Status new => assigned
2013-07-25 10:01 luis Assigned To => jcfr
2013-07-25 10:07 jcfr Note Added: 0009196
2013-07-25 10:17 luis Note Added: 0009197
2013-07-25 10:21 jcfr Priority normal => high
2013-07-25 10:21 jcfr Target Version => Slicer 4.3.0
2013-07-29 12:13 jcfr Note Added: 0009255
2013-07-29 12:30 jcfr Note Added: 0009257
2013-07-30 05:29 luis File Added: CMakeLists.txt
2013-07-30 05:29 luis Note Added: 0009265
2013-07-30 05:30 luis Note Edited: 0009265
2013-07-30 09:19 luis Note Added: 0009271
2013-08-19 05:59 jcfr Note Added: 0009503
2013-08-19 05:59 jcfr Status assigned => feedback
2013-08-28 11:26 jcfr Note Added: 0009665
2013-08-28 11:26 jcfr Status feedback => resolved
2013-08-28 11:26 jcfr Fixed in Version => Slicer 4.3.0
2013-08-28 11:26 jcfr Resolution open => fixed
2013-08-28 11:59 jcfr Note Edited: 0009665
2014-03-06 05:00 jcfr Note Added: 0010845
2014-03-06 05:02 jcfr Status resolved => closed
2014-03-06 05:05 luis Note Added: 0010897
2014-03-06 09:06 jcfr Note Added: 0011238