Skip to content
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

Simplify buildsystem #284

Merged
merged 7 commits into from
Jun 22, 2016
Merged

Simplify buildsystem #284

merged 7 commits into from
Jun 22, 2016

Conversation

jcfr
Copy link
Contributor

@jcfr jcfr commented Jun 22, 2016

This PR simplifies the buildsystem and should also address the issue reported by @lassoan:

In c:\D\S4R\Slicer-build\CMakeCache.txt there are just two configs:

CMAKE_CONFIGURATION_TYPES:STRING=Release;Debug

In the high-level Slicer build and in all external projects the list of configurations are complete (4 configs; except Python – but that’s a different matter, it’s fine; and Slicer-build).

I’ve only found one place in the Slicer build tree where somebody manipulates configuration types: in c:\D\S4R\BRAINSTools\CMakeLists.txt:

if(DEFINED CMAKE_CONFIGURATION_TYPES)
  set(CMAKE_CONFIGURATION_TYPES "Release;Debug" CACHE STRING "" FORCE) # setting only two configuration types
endif()

I haven’t tested if this code changes the configurations available in Slicer but it’s quite likely. The configuration list override has been introduced by this commit:
https://github.com/BRAINSia/BRAINSTools/commit/831eab6bc8a77b7fb224c7dc23d89bb38a16d56c

Which later Jc tuned:
https://github.com/BRAINSia/BRAINSTools/commit/1a8e84b5b850a9f08338b23d80c18e459e0b01a1

jcfr added 7 commits June 17, 2016 19:31
Calling the macro "ExternalProject_Include_Dependencies" last ensures
all prior calls to 'mark_as_superbuild' are considered when updating
the variable '${proj}_EP_ARGS' passed to the main project.
…ect.

Simply calling "mark_as_superbuild" after declaring the option is
now sufficient to ensure the value will be passed to inner BRAINSTools
project.
…WF_SUPPORT

This variable was not used in the code base, searching through the git
history of either BRAINSTools or NAMICExternalProjects didn't reveal
anything.

If the intended behavior of the variable was to conditionally enable/disable
support for FFTWF, the ITK optiion ITK_USE_FFTWF could be set accordingly.
When including in other project, it is not desired to force this variable
to any specific value.
… quote

New version based on commontk/Artichoke@d453e32

This commit will avoid warning like:

  loading initial cache file /path/to/BRAINSTools-updated-build/teem-prefix/tmp/teem-cache-Release.cmake
  CMake Warning (dev) in /path/to/BRAINSTools-updated-build/teem-prefix/tmp/teem-cache-Release.cmake:
  Syntax Warning in cmake code at

    /path/to/BRAINSTools-updated-build/teem-prefix/tmp/teem-cache-Release.cmake:3:93

  Argument not separated from preceding token by whitespace.
  This warning is for project developers.  Use -Wno-dev to suppress it.


$ git shortlog commontk/Artichoke@82fa9f4..commontk/Artichoke@d453e32 --no-merges
Jean-Christophe Fillion-Robin (5):
      _sb_list_to_string: Update function to not set CMP0007 to OLD
      _sb_list_to_string: Ensure function works with CMake 2.8.9
      Add support for specifying a different CMAKE_GENERATOR for each project
      Add support for specifying different toolset/platform for each project
      Teach mark_as_superbuild how to handle variables with double-quotes
@hjmjohnson
Copy link
Member

@jcfr THANK YOU! I'll run one test, and then commit.

@hjmjohnson
Copy link
Member

@jcfr All preliminary build testing came back successful. THANK YOU.

@hjmjohnson hjmjohnson merged commit 3d70d8f into BRAINSia:master Jun 22, 2016
@jcfr jcfr deleted the simplify-buildsystem branch June 22, 2016 02:02
@jcfr
Copy link
Contributor Author

jcfr commented Jun 22, 2016

Great. Thanks for the quick feedback.

@jcfr
Copy link
Contributor Author

jcfr commented Jun 22, 2016

Consider Slicer builds against ITK v4.10.0rc2 from 2016-05-18, is it reasonable for Slicer to use BRAINSTools master ?

Changes that would be included are the following:

$ git shortlog 16526a5..eab1460 --no-merges 
Alexander Leinoff (3):
      COMP: Dont build the BRAINSABC Module by default
      BUG: Fixes CMake Dependencies in DWIConvert
      ENH: Throw IO Exception when reading/writing invalid landmarks file

Ali Ghayoor (34):
      BUG: Fixed BRAINSFitTest_ROIBSpline by replacing the baseline
      ENH: Updated candidateRegionsThreshold value in BABC
      ENH: Make RC computation more stable
      BUG: Several modifications to identify bug in BCD
      BUG: Reliable computation of reflective correlation in BCD
      ENH: Add matlab companion to make a surface plot of metric
      ENH: print out CHM only in verbose mode
      ENH: Make BCD fail when we know results will be bad
      BUG: Move the physical origin to the center of the image
      BUG: Eyes ranges should be compared to aligned AC point
      BUG: Improved the input T1 test image by denoising
      BUG: Get MetaData dictionary from the reader output in BCD
      BUG: change the valid range for eye positions
      BUG: tuned valid range for eyes locations
      BUG: Generate ITK exception macro in the case of failure
      BUG: modify the threshold value for bad reflective correlation
      BUG: throw exception where needed
      BUG: Choose a reasonable search radius for mid-brain lmks
      BUG: new baselines for BCD search radius tests
      BUG: new baselines for BCD rescale intensity tests
      BUG: Fixed BCDTest_inputLandmarksEMSP
      BUG: Fixed twelve BCD test failures
      BUG: Fixed BCD forced lmks tests
      BUG: Fixed BCD lmks compare tests
      ENH: throw exception when error happens
      BUG: Fixed BRAINSTrimForeground test
      BUG: center of head mass must be passed to reflectionFunctor
      BUG: Fixed BRAINSAlignMSPTest
      ENH: RC computation is robust now, no need for repeated computation
      ENH: Consider a different threshold for RC metric
      ENH: Add correctionType to dtiestim in DWI pipeline
      ENH: Print a more informative error message in DWIConvert
      COMP: Added GTRACT as an option in cmake
      COMP: List the applications that need VTK in cmake build

Hans J. Johnson (70):
      PERF: Optimize cluster density usage
      BUG: Test for CenterOfROI had many bugs
      ENH: Make error checking robust for T1 image
      PERF: Allow running BCD with multiple cores
      ENH: Modernizing vcl_ to std::
      ENH: Update base code for fixing BAW features.
      COMP: Update for VTK 7.1 compilation
      ENH: Cleanup python code for snapshot writing.
      COMP: Remove compiler warning about unused variable.
      ENH: Update ANTs and ITK trying to resolve denoise issue
      ENH: Add ConvertBetweenFileFormats as a default build.
      ENH: RemoveVTKDependance.
      ENH: Allow building of BRAINSTools without VTK.
      COMP: Prefer _REQUIRES_VTK to BRAINSTools_REQUIRES_VTK
      COMP: Fix setting Mac OSX vars for build.
      ENH: Remove Compiler Warnings For clang c++11
      ENH: Const correctness and prefer initialization
      COMP: Compilation bug for mismatch signature.
      ENH: Update ITK to latest version.
      ENH: Hack hardcode to one file for speed.
      ENH: Added timing to computations.
      ENH: Instrument of heirarchial testing.
      ENH: Fine tune heuristic
      PERF: Use heirarcial heuristic for exhausitve search
      BUG: Replace std::__1::cout with std::cout
      ENH: Reorganize variables for readability.
      ENH: Update to new version of itkTestDriver*.inc files
      STYLE:  Put all old unused code at end of file.
      ENH: ITK, DCMTK, ANTs updated in hopes of addressing denoise empty images.
      ENH: Update version number of BRAINSTools.
      BUG: Update ANTS to fix Denoise.
      ENH: Update ITK and SlicerExecutionModel looking for linker warning resolution
      STYLE: Consolidate common typedef in one location
      COMP: Improve compilation by avoiding rebuilds of GenerateCLP
      COMP: KWSYS removed support for pre-C++98 in 2015
      COMP: Update to latest to remove compiler warnings
      COMP: CMP0063 Honor visibility properties for all target types
      ENH: Update ANTs to latest version.
      ENH: Update ITK version.
      PERF: Remove redundant assignment
      ENH: Remove shadowed typedefs
      ENH: Prefer const functions
      COMP: Address CPPCHECK warnings
      ENH: Allow specifying crash dump dir in config file.
      COMP: Incorrectly removed necessary function.
      COMP: Remove warnings about shadowed typedefs.
      ENH: Force T1 only processing for ANTS JointFusion.
      BUG: Only the first element was passing
      ENH: Update ITKv4.
      ENH: Change build for SlicerExecutionModel for visibility
      COMP: Conditionally turn off tests that require VTK
      COMP: Fix issues with SEM Hidden Symbols.
      DOC: Improve documentation for DWIConvert
      ENH: Fix regresion with respect to ITK 4.10
      ENH: Start of a test program for LinearRegression.
      BUG: Numerics for optimal averaging of images fixed
      ENH: Improve the unwrapping function
      ENH: Remove unnecessary outputs to reduce disk usage.
      ENH: Enable NIPYPE Provenance
      COMP: Remove incomplete test
      ENH: Partial additon of resampling code for all images
      ENH: Fine tune autoworkup for unwrapping and BABC candiate region thresholds.
      STYLE: Keep naming consistent with Slicer conventions.
      COMP: Silence compiler warnings
      ENH: Improve CSF and VB joint fusion results by cleanup
      BUG: Missing outputs when maxBiasOrder=0
      ENH: Improve true/false processing logic
      ENH: Use registration masks from template when available
      STYLE: Make the node name match the actual behavior
      ENH: Do not do BFC for BABC

Isaiah Norton (1):
      ENH: throw (overridable) error when attempting lossy NIFTI conversion.

Jean-Christophe Fillion-Robin (7):
      STYLE: Common.cmake: Group CMake include together and remove dead code.
      BUG: SuperBuild.cmake: Ensure calls to mark_as_superbuild are processed
      ENH: Superbuild.cmake: Simplify passing of build option to inner project.
      STYLE: CMakeLists.txt / Common.cmake: Remove commented code
      STYLE: Common.cmake: Remove unused variable ${PROJECT_NAME}_BUILD_FFTWF_SUPPORT
      BUG: Common.cmake: Do not force variable CTEST_CONFIGURATION_TYPE
      COMP: Update ExternalProjectDependency to support cache args with dbl quote

Juan Carlos Prieto (3):
      BUG: Linking error due to missing ITK libraries
      STYLE: Remove ITK version from find package
      Revert "STYLE: Remove ITK version from find package"

Regina Kim (10):
      ENH: ScreenShot script
      ENH: BCD user selected landmark option
      BUG: EMSP file error fix in BAW
      ENH: compute label volume
      ENH: Remove unused variables
      ENH: T2 is only excluded to Joint Fusion
      ENH: Stage5 Resgistration
      BUG: simpleITK BinaryThreshold
      BUG: save_state was not being used
      BUG: template and longitudinal pipeline fix

@hjmjohnson
Copy link
Member

Yes,  Just be sure that BRAINSABC is not turned on (it has not been in the past).

Everything else in C++ should be backwards compatible for a few years ago for ITK.

Hans

From: Jean-Christophe Fillion-Robin [email protected]
Reply-To: BRAINSia/BRAINSTools [email protected]
Date: Tuesday, June 21, 2016 at 9:06 PM
To: BRAINSia/BRAINSTools [email protected]
Cc: Hans Johnson [email protected], State change [email protected]
Subject: Re: [BRAINSia/BRAINSTools] Simplify buildsystem (#284)

Consider Slicer builds against ITK v4.10.0rc2 from 2016-05-18, is it reasonable for Slicer to use BRAINSTools master ?

Changes that would be included are the following:
$ git shortlog 16526a5..eab1460 --no-merges
Alexander Leinoff (3):
      COMP: Dont build the BRAINSABC Module by default
      BUG: Fixes CMake Dependencies in DWIConvert
      ENH: Throw IO Exception when reading/writing invalid landmarks file

Ali Ghayoor (34):
      BUG: Fixed BRAINSFitTest_ROIBSpline by replacing the baseline
      ENH: Updated candidateRegionsThreshold value in BABC
      ENH: Make RC computation more stable
      BUG: Several modifications to identify bug in BCD
      BUG: Reliable computation of reflective correlation in BCD
      ENH: Add matlab companion to make a surface plot of metric
      ENH: print out CHM only in verbose mode
      ENH: Make BCD fail when we know results will be bad
      BUG: Move the physical origin to the center of the image
      BUG: Eyes ranges should be compared to aligned AC point
      BUG: Improved the input T1 test image by denoising
      BUG: Get MetaData dictionary from the reader output in BCD
      BUG: change the valid range for eye positions
      BUG: tuned valid range for eyes locations
      BUG: Generate ITK exception macro in the case of failure
      BUG: modify the threshold value for bad reflective correlation
      BUG: throw exception where needed
      BUG: Choose a reasonable search radius for mid-brain lmks
      BUG: new baselines for BCD search radius tests
      BUG: new baselines for BCD rescale intensity tests
      BUG: Fixed BCDTest_inputLandmarksEMSP
      BUG: Fixed twelve BCD test failures
      BUG: Fixed BCD forced lmks tests
      BUG: Fixed BCD lmks compare tests
      ENH: throw exception when error happens
      BUG: Fixed BRAINSTrimForeground test
      BUG: center of head mass must be passed to reflectionFunctor
      BUG: Fixed BRAINSAlignMSPTest
      ENH: RC computation is robust now, no need for repeated computation
      ENH: Consider a different threshold for RC metric
      ENH: Add correctionType to dtiestim in DWI pipeline
      ENH: Print a more informative error message in DWIConvert
      COMP: Added GTRACT as an option in cmake
      COMP: List the applications that need VTK in cmake build

Hans J. Johnson (70):
      PERF: Optimize cluster density usage
      BUG: Test for CenterOfROI had many bugs
      ENH: Make error checking robust for T1 image
      PERF: Allow running BCD with multiple cores
      ENH: Modernizing vcl_ to std::
      ENH: Update base code for fixing BAW features.
      COMP: Update for VTK 7.1 compilation
      ENH: Cleanup python code for snapshot writing.
      COMP: Remove compiler warning about unused variable.
      ENH: Update ANTs and ITK trying to resolve denoise issue
      ENH: Add ConvertBetweenFileFormats as a default build.
      ENH: RemoveVTKDependance.
      ENH: Allow building of BRAINSTools without VTK.
      COMP: Prefer _REQUIRES_VTK to BRAINSTools_REQUIRES_VTK
      COMP: Fix setting Mac OSX vars for build.
      ENH: Remove Compiler Warnings For clang c++11
      ENH: Const correctness and prefer initialization
      COMP: Compilation bug for mismatch signature.
      ENH: Update ITK to latest version.
      ENH: Hack hardcode to one file for speed.
      ENH: Added timing to computations.
      ENH: Instrument of heirarchial testing.
      ENH: Fine tune heuristic
      PERF: Use heirarcial heuristic for exhausitve search
      BUG: Replace std::__1::cout with std::cout
      ENH: Reorganize variables for readability.
      ENH: Update to new version of itkTestDriver*.inc files
      STYLE:  Put all old unused code at end of file.
      ENH: ITK, DCMTK, ANTs updated in hopes of addressing denoise empty images.
      ENH: Update version number of BRAINSTools.
      BUG: Update ANTS to fix Denoise.
      ENH: Update ITK and SlicerExecutionModel looking for linker warning resolution
      STYLE: Consolidate common typedef in one location
      COMP: Improve compilation by avoiding rebuilds of GenerateCLP
      COMP: KWSYS removed support for pre-C++98 in 2015
      COMP: Update to latest to remove compiler warnings
      COMP: CMP0063 Honor visibility properties for all target types
      ENH: Update ANTs to latest version.
      ENH: Update ITK version.
      PERF: Remove redundant assignment
      ENH: Remove shadowed typedefs
      ENH: Prefer const functions
      COMP: Address CPPCHECK warnings
      ENH: Allow specifying crash dump dir in config file.
      COMP: Incorrectly removed necessary function.
      COMP: Remove warnings about shadowed typedefs.
      ENH: Force T1 only processing for ANTS JointFusion.
      BUG: Only the first element was passing
      ENH: Update ITKv4.
      ENH: Change build for SlicerExecutionModel for visibility
      COMP: Conditionally turn off tests that require VTK
      COMP: Fix issues with SEM Hidden Symbols.
      DOC: Improve documentation for DWIConvert
      ENH: Fix regresion with respect to ITK 4.10
      ENH: Start of a test program for LinearRegression.
      BUG: Numerics for optimal averaging of images fixed
      ENH: Improve the unwrapping function
      ENH: Remove unnecessary outputs to reduce disk usage.
      ENH: Enable NIPYPE Provenance
      COMP: Remove incomplete test
      ENH: Partial additon of resampling code for all images
      ENH: Fine tune autoworkup for unwrapping and BABC candiate region thresholds.
      STYLE: Keep naming consistent with Slicer conventions.
      COMP: Silence compiler warnings
      ENH: Improve CSF and VB joint fusion results by cleanup
      BUG: Missing outputs when maxBiasOrder=0
      ENH: Improve true/false processing logic
      ENH: Use registration masks from template when available
      STYLE: Make the node name match the actual behavior
      ENH: Do not do BFC for BABC

Isaiah Norton (1):
      ENH: throw (overridable) error when attempting lossy NIFTI conversion.

Jean-Christophe Fillion-Robin (7):
      STYLE: Common.cmake: Group CMake include together and remove dead code.
      BUG: SuperBuild.cmake: Ensure calls to mark_as_superbuild are processed
      ENH: Superbuild.cmake: Simplify passing of build option to inner project.
      STYLE: CMakeLists.txt / Common.cmake: Remove commented code
      STYLE: Common.cmake: Remove unused variable ${PROJECT_NAME}_BUILD_FFTWF_SUPPORT
      BUG: Common.cmake: Do not force variable CTEST_CONFIGURATION_TYPE
      COMP: Update ExternalProjectDependency to support cache args with dbl quote

Juan Carlos Prieto (3):
      BUG: Linking error due to missing ITK libraries
      STYLE: Remove ITK version from find package
      Revert "STYLE: Remove ITK version from find package"

Regina Kim (10):
      ENH: ScreenShot script
      ENH: BCD user selected landmark option
      BUG: EMSP file error fix in BAW
      ENH: compute label volume
      ENH: Remove unused variables
      ENH: T2 is only excluded to Joint Fusion
      ENH: Stage5 Resgistration
      BUG: simpleITK BinaryThreshold
      BUG: save_state was not being used
      BUG: template and longitudinal pipeline fix

You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.

@jcfr
Copy link
Contributor Author

jcfr commented Jun 22, 2016

Roger that 👍

Have a good evening (if you are in EST timezone ..)

@ajjl
Copy link
Contributor

ajjl commented Jun 22, 2016

@jcfr @hjmjohnson

Hi. Thanks for your commits!

I've lost the ability to turn modules on and off through the superbuild. I think that this is related to your changes, I suspect this one, specifically the changes to SuperBuild.cmake: 5d27bb8
Here is an example of how to encounter the problem:

  1. Create a new build folder. (ie. build from scratch)
  2. Using ccmake, turn off a module that is normally on, for example BRAINSCostellationDetector
  3. Build the project.
  4. In the BRAINSTools project subfolder (${build_dir}/BRAINSTools-build), BRAINSConstellationDetector is still built. Looking at the cmake cache values from the subfolder ( Running "ccmake ." from BRAINSTools-build subfolder) shows that the module is turned on, even though I turned it off in the superbuild project.

Could you please re-review your changes and see if it looks like any of them could have caused this?

Thanks!

@hjmjohnson
Copy link
Member

@ajjl I need to assign this task to you. Currently I don't have time to investigate, and I know that JC is very very busy. Please dig in and see if you can fix it.

Hans

@jcfr
Copy link
Contributor Author

jcfr commented Jun 22, 2016

@ajjl Thanks for the detailed report.

Will investigate later today. We need to get this sorted out.

@ajjl
Copy link
Contributor

ajjl commented Jun 22, 2016

I'll look into it.

@jcfr
Copy link
Contributor Author

jcfr commented Jun 22, 2016

I found the problem ... this is caused by:

  • the fact the superbuild project and the inner project both have different names SuperBuild_BRAINSTools and BRAINSTools

and

There are few options to move forward:

  • It is possible to explicitly specify the SUPERBUILD_VAR variable for each ExternalProject_Include_Dependencies call ... since ideally i would like to be able to share the External_* files between projects .. I would like to avoid this.
  • simplify BRAINSTools/CMakeLists.txt so that top-level and inner-project are named the same
  • Update ExternalProject_Include_Dependencies internals to check if a global variable named EP_SUPERBUILD_VAR is set. If set it would use it.

Ideally I would prefer (2), but implementing (3) is also an option.

Let me know what you think

@hjmjohnson
Copy link
Member

I definitely prefer the simplify approach

Sent from my iPhone

On Jun 22, 2016, at 3:42 PM, Jean-Christophe Fillion-Robin [email protected] wrote:

I found the problem ... this is caused by:

the fact the superbuild project and the inner project both have different names SuperBuild_BRAINSTools and BRAINSTools
and

the ExternalProjectDependency module internally default to checking for the variable SuperBuild_BRAINSTools_SUPERBUILD (instead of BRAINSTools_SUPERBUILD). See here
There are few options to move forward:

It is possible to explicitly specify the SUPERBUILD_VAR variable for each ExternalProject_Include_Dependencies call ... since ideally i would like to be able to share the External_* files between projects .. I would like to avoid this.

simplify BRAINSTools/CMakeLists.txt so that top-level and inner-project are named the same

Update ExternalProject_Include_Dependencies internals to check if a global variable named EP_SUPERBUILD_VAR is set. If set it would use it.

Ideally I would prefer (2), but implementing (3) is also an option.

Let me know what you think


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@jcfr
Copy link
Contributor Author

jcfr commented Jun 23, 2016

prefer the simplify approach

Great. Will keep that in mind for future refactoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants