View Issue Details

IDProjectCategoryView StatusLast Update
0002468Slicer4Core: Building (CMake, Superbuild)public2014-03-06 04:51
Reporterjcfr Assigned Tojcfr  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.2.0Fixed in VersionSlicer 4.2.0 
Summary0002468: Not all error are reported on CDash
Description

Some element copied from the email thread:

// ------------------------
David Cole: Why must you use CTEST_USE_LAUNCHERS? Are the results incorrect when
you do not use it?
Jc: In both CTK and Slicer we observed interlaced messages that lead to false positives (when doing // builds).

// ------------------------
David Cole:I don't think it does make sense generally. Not everybody wants to see
the results of all their dependencies show up on their dashboard. In
fact, many do not want this.
Jc: Since we are building VTK, CTK, etc ... it seems legitimate to report them on CDash.

I don't mind changing the way our dashboard driver script is running. Which approach do you suggest ?

I could also associate a label to each dependency (VTK, ITKv3, etc ...), build them in the topological order. The last project to be built would be Slicer itself.

Or

I could have:

  • one label named "SlicerDependencies" that would correspond to make from top-level except building Slicer inner project.
  • one label named "Slicer" that would correspond to the build of the configured inner project.

// ------------------------
Brad King:

This is what Bill meant about CTEST_USE_LAUNCHERS and superbuild not working
well together. The build command you're using is this:

Build command: /usr/bin/make -i -j5

The launchers are only used at the superbuild level, not on every compile
line inside each external project. Each external project build step is
entirely encompassed inside one launcher invocation:

ctest --launch ... -- $(MAKE)

The $(MAKE) expands to the above build command again, including "-i".
Therefore that launched $(MAKE) will see the errors but the -i option
tells it to ignore them. The $(MAKE) will return 0 always in that case.
The launcher sees the 0 return code and assumes that the build works.
It did however see output on stderr so it reports that as a warning.

If you take out the "-i" it will show errors as errors.

// ------------------------
Jc:

Seems the CTEST_USE_LAUNCHER expects BUILD_TESTING to be enabled and since I want the external projects to build with Testing disabled .. passing the option CTEST_USE_LAUNCHER alone won't work.

What I need to do so is to pass an updated CMAKE_MODULE_PATH with a directory containing my custom CTest module that would ensure CTESTLAUNCH{COMPILE, LINK, CUSTOM} to be defined and the associated property set also when BUILD_TESTING isn't set.

For non-CMake based project like Python, Tcl .. I could enforce to have "-j1".

TagsNo tags attached.

Activities

jcfr

jcfr

2012-09-04 06:23

administrator   ~0005938

Last edited: 2012-09-04 11:47

Feb 2012:

Hi Folks,

The experiment I conducted wasn't successful. No errors or warnings were reported. See here.

What I did:
1) Made sure CTEST_USE_LAUNCHER is disabled at superbuild level before including CTest. But enabled in the subprojects.
2) Decoupled Launcher code from CTest/build_testing option. See https://gist.github.com/1840169

That said, I will create a small test case allowing us to easily work on the issue.

Thanks

jcfr

jcfr

2012-09-27 14:35

administrator   ~0006258

I created a small toy project to investigate if the strategy proposed by CMake folks would work.

// ------
Project: https://github.com/jcfr/2468-TestCTestErrorReportingWithSuperbuild

The project is composed of:

  • Two "external project" A and B that will create to static libraries
  • A inner "external project" named Foo that will be built against A and B

Two build errors have been voluntarily introduced:

  • Missing ";" at the end of line 17 in Foo.cxx
  • Missing ";" at the end of line 9 in A.cxx

// ------
Results: http://slicer.cdash.org/index.php?project=Slicer4&date=2012-09-27#Experimental

// ------
The following experiments have been conducted:

1) WithoutCTestUseLauncher
=> Errors are reported with a chance of being interlaced

2) WithCTestUseLauncherAtTopLevel-UnpatchedCTest
=> No errors are reported

3) WithCTestUseLauncherInSubProject (PatchedCTest)

a) PatchedCTest
  => Errors are reported

b) PatchedCTest-TopLevelWarning
  => Errors are reported, top level warning happening at configure time is reported

c) PatchedCTest-TopLevelWarning-TopLevelBuildError
  => Toplevel error is NOT reported  !!!!!!!!!!!!!!!!!
  => SubProject errors are reported
  => Configure warning is reported

  => Running 'make' in the associated build tree gives:
         [ 25%] Built target A
         [ 50%] Built target B
         [ 75%] Built target C
         [100%] Built target Foo

     whereas build error are NOT reported !!!!!!!!!!

4) WithCTestUseLauncherAllLevel-PatchedCTest-TopLevelWarning-TopLevelBuildError

 => SubProject errors are reported
 => Top level configure warnings reported
 => Top level build error reported

// ------
Conclusion:

Code specific to Launcher existing in CTest.cmake should probably be moved into a file named "CTestLauncher.cmake". This should probably be included by default in every project independently of CTest

ExternalProject.cmake should be patched to automatically pass CTEST_USE_LAUNCHERS

jcfr

jcfr

2012-09-27 14:42

administrator   ~0006259

Email sent to CMake folks:

Hi Folks,

I finally took the time to put together a small project and did some experiments. The details are reported here:

              http://www.na-mic.org/Bug/view.php?id=2468#c6258

// -------------
Results: http://slicer.cdash.org/index.php?project=Slicer4&date=2012-09-27#Experimental

Code: https://github.com/jcfr/2468-TestCTestErrorReportingWithSuperbuild/commits/master

// -------------
Based on the results, in order to have CTEST_USE_LAUNCHERS playing nicely with Superbuild so that all errors and warnings are reported, I suggest the following:

1) Code specific to Launcher existing in CTest.cmake should probably be moved into a file named "CTestLauncher.cmake". This file should probably be included by default in every project independently of CTest

2) ExternalProject.cmake should be patched to automatically pass CTEST_USE_LAUNCHERS

Knowing where would "CTestLauncher.cmake" could be included so that it's always considered, I could work on a patch.

Let me know what you all think.

Thanks
Jc

jcfr

jcfr

2012-10-01 06:46

administrator   ~0006290

Hi Dave,

Here is a topic with the proposed change: https://github.com/jcfr/CMake/tree/fix-ctest-use-launchers-for-superbuild

I still think that enabling CTEST_USE_LAUNCHERS within a ctest script should allow the project and sub projects to report errors properly.

If instead of patching ExternalProject to pass the variable, there is an other mechanism allowing to achieve the same goal. I would be happy to help implementing it.

Currently, if the proposed topic, I still have to make sure every sub project is:

1) Including CTest:

Project like DCMTK are not including CTest at all, this project simply call "enable_testing()"

2) Properly passing CTEST_USE_LAUNCHERS in case of a superbuild setup used in the sub project itself.

example: Slicer is a superbuild depending on CTK which is also a superbuild.

Having a smarter mechanism to enable the launcher would be very very helpful for us.

Thanks for your help,

jcfr

jcfr

2012-10-01 06:46

administrator   ~0006291

Hi Dave,

You'll have to change them anyway to include CTestUseLaunchers.... Why not change them to include(CTest)....?

Having a built-in mechanism allowing to enable the launcher would avoid to manually edit each project. The idea would be to automatically have "CTestUseLaunchers" included. Each time the project command is invoked for example.

Would such an approach be something possible ?

The only option that would make "no extra work required" here is to get the default value of it from an ENV var, and then set the ENV var in your outer script. That should be do-able.

Combined with the approach described earlier, enabling the launcher through ENV var would be great.

How should we proceed ?

Thanks

jcfr

jcfr

2012-10-04 13:45

administrator   ~0006391

Topic pushed for CMake and CTK:
https://github.com/jcfr/CMake/tree/fix-ctest-use-launchers-for-superbuild
https://github.com/jcfr/CTK/compare/242-fix-superbuild-error-reporting

Currently testing locally

jcfr

jcfr

2012-10-05 06:57

administrator   ~0006395

Last edited: 2012-10-05 06:57

Fixed in r21112
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21112

//--------------------
COMP: Fix CDash errors/warnings reporting for unix parallel build

Setting the variable CTEST_USE_LAUNCHERS_DEFAULT in the environment
to enable CTest launcher reliably will be supported by default in either
CMake 2.8.10 or 2.8.11.

In the mean time, your local installation of CMake can be modified based on
the following topic: https://github.com/jcfr/CMake/tree/fix-ctest-use-launchers-for-superbuild

jcfr

jcfr

2012-10-05 07:34

administrator   ~0006399

Installation of CMake 2.8.8 have been updated on:

  • macosx factory
  • ubuntu factory
  • dash21
jcfr

jcfr

2012-10-10 12:35

administrator   ~0006491

See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21151

jcfr

jcfr

2012-10-11 15:03

administrator   ~0006503

Hi Dave,

The patch has been updated and tested on the factory. See

https://github.com/jcfr/CMake/tree/fix-ctest-use-launchers-for-superbuild

http://slicer.cdash.org/viewBuildError.php?buildid=42565
http://slicer.cdash.org/viewBuildError.php?type=1&buildid=42565

To enable the launcher the following line have been added to the dashboard scripts: https://github.com/Slicer/Slicer/blob/master/CMake/SlicerDashboardDriverScript.cmake#L108-113

Let me know how you would like to proceed to get the patch integrated in the coming version of CMake.

Thanks for all your help,

jcfr

jcfr

2014-03-06 04:50

administrator   ~0010732

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

Issue History

Date Modified Username Field Change
2012-09-04 06:21 jcfr New Issue
2012-09-04 06:21 jcfr Status new => assigned
2012-09-04 06:21 jcfr Assigned To => jcfr
2012-09-04 06:22 jcfr Target Version => Slicer 4.2.0 - Feature freeze Sept 1st 2012
2012-09-04 06:23 jcfr Note Added: 0005938
2012-09-04 11:47 jcfr Note Edited: 0005938
2012-09-04 11:47 jcfr Assigned To jcfr => sankhesh
2012-09-04 11:49 jcfr Assigned To sankhesh => crmullin
2012-09-04 11:49 jcfr Assigned To crmullin => jcfr
2012-09-27 14:35 jcfr Note Added: 0006258
2012-09-27 14:42 jcfr Note Added: 0006259
2012-09-27 14:42 jcfr Status assigned => feedback
2012-10-01 06:46 jcfr Note Added: 0006290
2012-10-01 06:46 jcfr Note Added: 0006291
2012-10-04 13:45 jcfr Note Added: 0006391
2012-10-05 06:57 jcfr Note Added: 0006395
2012-10-05 06:57 jcfr Status feedback => resolved
2012-10-05 06:57 jcfr Fixed in Version => Slicer 4.2.0 - coming release
2012-10-05 06:57 jcfr Resolution open => fixed
2012-10-05 06:57 jcfr Note Edited: 0006395
2012-10-05 07:34 jcfr Note Added: 0006399
2012-10-10 12:35 jcfr Note Added: 0006491
2012-10-11 15:03 jcfr Note Added: 0006503
2014-03-06 04:50 jcfr Note Added: 0010732
2014-03-06 04:51 jcfr Status resolved => closed