Slicer Build takes too much time to compile using make command

Hi there,
I am trying to build slicer from source code on ubuntu 20.04, I have executes command cmake and then make in debuge directory. It is taking too much time to build near about 10 hours. Please help me for understanding exact issue in build

It should take between 1 and 3 hours.

To help identify the problem, here are few questions:

  • What are the specs of your workstation ? number of cores, type of hard drive
  • Are you running Ubuntu from within a virtual machine ?
  • Are you building in parallel by specifying make -jN where N corresponds to the number of cores ?
  • Do you have an antivirus running ?
  • Are you building on a mounted network drive ?

On Windows, on a desktop computer a complete build takes 3-4 hours with default settings and 2 hours with parallel build enabled (CMake config:
ADDITIONAL_CXX_FLAGS=/MP, ADDITIONAL_C_FLAGS=/MP; build with cmake.exe --build . -j 8). On an an ultrabook laptop, build typically takes 8-10 hours.

In practice, build time does not make a big difference, because it is too long anyway to wait for it to end while doing nothing else, so we just start it and it runs in the background while we are working on other things. Building after making changes is fast, takes 10-20 seconds if you build the entire inner Slicer-build folder and a few seconds if you build a subproject or on an extension.

@lassoan Can you provide any detail on how the incremental build system on Windows works? I’m trying to patch an issue preventing us from sending DICOM-SEG files back to our PACS system, and I haven’t been able to launch an incremental build.

If I invoke the build script from from the documentation in the root folder, I get a full end to end build (takes about four hours on my machine). I’ve been doing this by launching a the build command referenced in the documentation from the root of the build folder:

cmake.exe --build . --config Debug

Running the same command from the Slicer-build skips compilation of dependencies but still requires a significant amount of time to complete. (I started a compile of the folder, but stopped it after about 20 minutes.)

The last approach I’ve been taking is to compile in Visual Studio, but this also launches a full build rather than an incremental build and seems to require scores of minutes as well. Any suggestions would be appreciated.

PS, I’m pretty new to Slicer. Thank you for creating such a wonderful application. I’m coming from the Mimics world and it’s incredibly inspiring to see such a powerful piece of software available as open source.

I usually open the c:\D\S4D\Slicer-build\Slicer.sln in Visual Studio (by going to c:\S4D\Slicer-build folder and launching .\Slicer.exe --VisualStudioProject) and run the SlicerApp project. I think some people also load .sln files in subfolders, which might further decrease build time

After a complete, successful build of SlicerApp, repeated build will only rebuild about 70 projects, typically in about a few minutes. About 10 of these are various quick tasks (copying Python files, etc), and the rest are updates of hierarchy files for the Python wrapper.

Based on your problem report, I did some investigation and found that update of hierarchy files is time consuming because vtkWrapHierarchy.exe searches for hundreds of header files in hundreds of include directories. Time to complete these hierarchy files updates depends on how quickly your computer can check for existence of a file. This is a very costly operation and may depend on the file system, antivirus software settings, storage hardware, operating system version, etc. As an experiment, I’ve implemented proof-of-concept pre-fetching and caching of all file paths in include directories in vtkWrapHierarchy, which made update of hierarchy files about 4-5x faster in debug mode. On my computer, a repeated build of SlicerApp project now takes about 50 seconds. I’ll discuss with VTK core developers if this improvement could be integrated into VTK.

Wow Andras this would be great if it could be accepted in VTK. Thanks a lot for working on this!

Thank you for digging into this. Your description of the problem makes a lot of sense and tracks with the (endless) cmake output I was seeing.

For the problem I was trying to fix, I was able to determine that it only affected Python code, so I edited the files in the build folder and then ported the new code to the source folder after I was sure it worked. A little annoying, but good enough that I was able to complete and test my patch.

Slicer is an enormous and complex application, and it’s taken me a couple of days to get familiar enough with everything to where I can make contributions. Finding a workflow for Python files that didn’t incur a 20 or 30 minute build time was the last piece of the puzzle I couldn’t quite figure out. (Your documentation, BTW, is wonderful and has been very helpful.) An efficient cache would be absolutely fantastic and would greatly facilitate a streamlined development process.

1 Like

Finding your way around in a way days is outstanding.

It is interesting to note that Slicer is big in the sense that it integrates large libraries and frameworks (Qt, VTK, ITK, Python, …), but compared to these external libraries, Slicer core is relatively small.

I’ve started a discussion about this on the VTK forum:

I’ve also found a very important other bug in the dependency check mechanism of hierarchy files generation! Hierarchy files are kept regenerated if VTK is updated after the hierarchy files are generated. The workaround is to delete all *Hierarchy.txt files in C:\S4R\Slicer-build. See details here:

The fix to avoid unnecessary *Hierarchy.txt files generation has been integrated in to Slicer.

Following my proof-of-concept prototype, David Gobbi has updated the Python wrapper to make *Hierarchy.txt file generation many times faster. It is expected to be integrated into VTK in the coming weeks and we’ll backport that fix into Slicer’s VTK.

I found in each rebuild of Slicer, it will take around 1 hour on VTK building, and the logs looks like the following:

[build]     Python Wrapping - generating vtkSQLiteQueryPython.cxx
[build]     Python Wrapping - generating vtkSQLiteToTableReaderPython.cxx
[build]     Python Wrapping - generating vtkTableToSQLiteWriterPython.cxx
[build]     Python Wrapping - generating vtkThreadedImageWriterPython.cxx
[build]     Python Wrapping - generating vtkEnSight6BinaryReaderPython.cxx
[build]     Python Wrapping - generating vtkEnSight6ReaderPython.cxx
[build]     Python Wrapping - generating vtkEnSightGoldBinaryReaderPython.cxx
[build]     Python Wrapping - generating vtkEnSightGoldReaderPython.cxx
[build]     Python Wrapping - generating vtkEnSightMasterServerReaderPython.cxx
[build]     Python Wrapping - generating vtkEnSightReaderPython.cxx
[build]     Python Wrapping - generating vtkGenericEnSightReaderPython.cxx
[build]     Python Wrapping - generating vtkCPExodusIIElementBlockPython.cxx
[build]     Python Wrapping - generating vtkCPExodusIIInSituReaderPython.cxx
[build]     Python Wrapping - generating vtkCPExodusIINodalCoordinatesTemplatePython.cxx
[build]     Python Wrapping - generating vtkCPExodusIIResultsArrayTemplatePython.cxx
[build]     Python Wrapping - generating vtkExodusIICachePython.cxx
[build]     Python Wrapping - generating vtkExodusIIReaderPython.cxx
[build]     Python Wrapping - generating vtkExodusIIReaderParserPython.cxx
[build]     Python Wrapping - generating vtkExodusIIWriterPython.cxx
[build]     Python Wrapping - generating vtkModelMetadataPython.cxx
[build]     Python Wrapping - generating vtkAVSucdReaderPython.cxx
[build]     Python Wrapping - generating vtkBYUReaderPython.cxx
[build]     Python Wrapping - generating vtkBYUWriterPython.cxx
[build]     Python Wrapping - generating vtkChacoReaderPython.cxx
[build]     Python Wrapping - generating vtkFacetWriterPython.cxx
[build]     Python Wrapping - generating vtkFLUENTReaderPython.cxx
[build]     Python Wrapping - generating vtkGAMBITReaderPython.cxx
[build]     Python Wrapping - generating vtkGaussianCubeReaderPython.cxx
[build]     Python Wrapping - generating vtkHoudiniPolyDataWriterPython.cxx
[build]     Python Wrapping - generating vtkIVWriterPython.cxx
[build]     Python Wrapping - generating vtkMCubesReaderPython.cxx
[build]     Python Wrapping - generating vtkMCubesWriterPython.cxx
[build]     Python Wrapping - generating vtkMFIXReaderPython.cxx
[build]     Python Wrapping - generating vtkMoleculeReaderBasePython.cxx
[build]     Python Wrapping - generating vtkOBJReaderPython.cxx
[build]     Python Wrapping - generating vtkOBJWriterPython.cxx
[build]     Python Wrapping - generating vtkOpenFOAMReaderPython.cxx
[build]     Python Wrapping - generating vtkParticleReaderPython.cxx
[build]     Python Wrapping - generating vtkPDBReaderPython.cxx
[build]     Python Wrapping - generating vtkProStarReaderPython.cxx
[build]     Python Wrapping - generating vtkPTSReaderPython.cxx
[build]     Python Wrapping - generating vtkSTLReaderPython.cxx
[build]     Python Wrapping - generating vtkSTLWriterPython.cxx
[build]     Python Wrapping - generating vtkTecplotReaderPython.cxx
[build]     Python Wrapping - generating vtkWindBladeReaderPython.cxx
[build]     Python Wrapping - generating vtkXYZMolReaderPython.cxx
[build]     Python Wrapping - generating vtkLSDynaPartPython.cxx
[build]     Python Wrapping - generating vtkLSDynaPartCollectionPython.cxx
[build]     Python Wrapping - generating vtkLSDynaReaderPython.cxx
[build]     Python Wrapping - generating vtkLSDynaSummaryParserPython.cxx
[build]     Python Wrapping - generating LSDynaMetaDataPython.cxx
[build]     Python Wrapping - generating LSDynaFamilyPython.cxx
[build]     Python Wrapping - generating vtkGenericMovieWriterPython.cxx
[build]     Python Wrapping - generating vtkOggTheoraWriterPython.cxx
[build]     Python Wrapping - generating vtkAVIWriterPython.cxx
[build]     Python Wrapping - generating vtkMPASReaderPython.cxx
[build]     Python Wrapping - generating vtkNetCDFCAMReaderPython.cxx
[build]     Python Wrapping - generating vtkNetCDFCFReaderPython.cxx
[build]     Python Wrapping - generating vtkNetCDFPOPReaderPython.cxx
[build]     Python Wrapping - generating vtkNetCDFReaderPython.cxx
[build]     Python Wrapping - generating vtkSLACParticleReaderPython.cxx
[build]     Python Wrapping - generating vtkSLACReaderPython.cxx
[build]     Python Wrapping - generating vtkPLYPython.cxx
[build]     Python Wrapping - generating vtkPLYReaderPython.cxx
[build]     Python Wrapping - generating vtkPLYWriterPython.cxx
[build]     Python Wrapping - generating vtkSegYReaderPython.cxx
[build]     Python Wrapping - generating vtkSegYIOUtilsPython.cxx
[build]     Python Wrapping - generating vtkSegYReaderInternalPython.cxx
[build]     Python Wrapping - generating vtkSegYTraceReaderPython.cxx
[build]     Python Wrapping - generating vtkVeraOutReaderPython.cxx
[build]     Python Wrapping - generating vtkVideoSourcePython.cxx
[build]     Python Wrapping - generating vtkWin32VideoSourcePython.cxx
[build]     Python Wrapping - generating vtkIOKitPythonInit.cxx
[build]     LSDynaFamilyPython.cxx
[build]     LSDynaMetaDataPython.cxx
[build]     vtkASCIITextCodecPython.cxx
[build]     vtkAVIWriterPython.cxx
[build]     vtkAVSucdReaderPython.cxx
[build]     vtkAbstractParticleWriterPython.cxx
[build]     vtkAbstractPolyDataReaderPython.cxx
[build]     vtkArrayDataReaderPython.cxx
[build]     vtkArrayDataWriterPython.cxx
[build]     vtkArrayReaderPython.cxx
[build]     vtkArrayWriterPython.cxx
[build]     vtkBMPReaderPython.cxx
[build]     vtkBMPWriterPython.cxx
[build]     vtkBYUReaderPython.cxx
[build]     vtkBYUWriterPython.cxx
[build]     vtkBase64InputStreamPython.cxx
[build]     vtkBase64OutputStreamPython.cxx
[build]     vtkBase64UtilitiesPython.cxx
[build]     vtkCPExodusIIElementBlockPython.cxx
[build]     vtkCPExodusIIInSituReaderPython.cxx
[build]     Generating Code...
[build]     Compiling...
[build]     vtkCPExodusIINodalCoordinatesTemplatePython.cxx
[build]     vtkCPExodusIIResultsArrayTemplatePython.cxx
[build]     vtkChacoReaderPython.cxx
[build]     vtkCompositeDataReaderPython.cxx
[build]     vtkCompositeDataWriterPython.cxx
[build]     vtkDEMReaderPython.cxx
[build]     vtkDICOMImageReaderPython.cxx
[build]     vtkDataCompressorPython.cxx
[build]     vtkDataObjectReaderPython.cxx
[build]     vtkDataObjectWriterPython.cxx
[build]     vtkDataReaderPython.cxx
[build]     vtkDataSetReaderPython.cxx
[build]     vtkDataSetWriterPython.cxx
[build]     vtkDataWriterPython.cxx
[build]     vtkDatabaseToTableReaderPython.cxx
[build]     vtkDelimitedTextWriterPython.cxx
[build]     vtkEnSight6BinaryReaderPython.cxx
[build]     vtkEnSight6ReaderPython.cxx
[build]     vtkEnSightGoldBinaryReaderPython.cxx
[build]     vtkEnSightGoldReaderPython.cxx
[build]     Generating Code...
[build]     Compiling...
[build]     vtkEnSightMasterServerReaderPython.cxx
[build]     vtkEnSightReaderPython.cxx
[build]     vtkExodusIICachePython.cxx
[build]     vtkExodusIIReaderParserPython.cxx
[build]     vtkExodusIIReaderPython.cxx
[build]     vtkExodusIIWriterPython.cxx
[build]     vtkFLUENTReaderPython.cxx
[build]     vtkFacetWriterPython.cxx
[build]     vtkGAMBITReaderPython.cxx
[build]     vtkGESignaReaderPython.cxx
[build]     vtkGaussianCubeReaderPython.cxx
[build]     vtkGenericDataObjectReaderPython.cxx
[build]     vtkGenericDataObjectWriterPython.cxx
[build]     vtkGenericEnSightReaderPython.cxx
[build]     vtkGenericMovieWriterPython.cxx
[build]     vtkGlobFileNamesPython.cxx
[build]     vtkGraphReaderPython.cxx
[build]     vtkGraphWriterPython.cxx
[build]     vtkHoudiniPolyDataWriterPython.cxx
[build]     vtkIOKitPythonInitImpl.cxx
[build]     Generating Code...
[build]     Compiling...
[build]     vtkIVWriterPython.cxx
[build]     vtkImageExportPython.cxx
[build]     vtkImageImportExecutivePython.cxx
[build]     vtkImageImportPython.cxx
[build]     vtkImageReader2CollectionPython.cxx
[build]     vtkImageReader2FactoryPython.cxx
[build]     vtkImageReader2Python.cxx
[build]     vtkImageReaderPython.cxx
[build]     vtkImageWriterPython.cxx
[build]     vtkInputStreamPython.cxx
[build]     vtkJPEGReaderPython.cxx
[build]     vtkJPEGWriterPython.cxx
[build]     vtkJSONImageWriterPython.cxx
[build]     vtkJavaScriptDataWriterPython.cxx
[build]     vtkLSDynaPartCollectionPython.cxx
[build]     vtkLSDynaPartPython.cxx
[build]     vtkLSDynaReaderPython.cxx
[build]     vtkLSDynaSummaryParserPython.cxx
[build]     vtkLZ4DataCompressorPython.cxx
[build]     vtkLZMADataCompressorPython.cxx
[build]     Generating Code...
[build]     Compiling...
[build]     vtkMCubesReaderPython.cxx
[build]     vtkMCubesWriterPython.cxx
[build]     vtkMFIXReaderPython.cxx
[build]     vtkMPASReaderPython.cxx
[build]     vtkMRCReaderPython.cxx
[build]     vtkMedicalImagePropertiesPython.cxx
[build]     vtkMedicalImageReader2Python.cxx
[build]     vtkMetaImageReaderPython.cxx
[build]     vtkMetaImageWriterPython.cxx
[build]     vtkModelMetadataPython.cxx
[build]     vtkMoleculeReaderBasePython.cxx
[build]     vtkNIFTIImageHeaderPython.cxx
[build]     vtkNIFTIImageReaderPython.cxx
[build]     vtkNIFTIImageWriterPython.cxx
[build]     vtkNetCDFCAMReaderPython.cxx
[build]     vtkNetCDFCFReaderPython.cxx
[build]     vtkNetCDFPOPReaderPython.cxx
[build]     vtkNetCDFReaderPython.cxx
[build]     vtkNrrdReaderPython.cxx
[build]     vtkNumberToStringPython.cxx
[build]     Generating Code...
[build]     Compiling...
[build]     vtkOBJReaderPython.cxx
[build]     vtkOBJWriterPython.cxx
[build]     vtkOggTheoraWriterPython.cxx
[build]     vtkOpenFOAMReaderPython.cxx
[build]     vtkOutputStreamPython.cxx
[build]     vtkPDBReaderPython.cxx
[build]     vtkPLYPython.cxx
[build]     vtkPLYReaderPython.cxx
[build]     vtkPLYWriterPython.cxx
[build]     vtkPNGReaderPython.cxx
[build]     vtkPNGWriterPython.cxx
[build]     vtkPNMReaderPython.cxx
[build]     vtkPNMWriterPython.cxx
[build]     vtkPTSReaderPython.cxx
[build]     vtkParticleReaderPython.cxx
[build]     vtkPixelExtentIOPython.cxx
[build]     vtkPolyDataReaderPython.cxx
[build]     vtkPolyDataWriterPython.cxx
[build]     vtkPostScriptWriterPython.cxx
[build]     vtkProStarReaderPython.cxx
[build]     Generating Code...
[build]     Compiling...
[build]     vtkRTXMLPolyDataReaderPython.cxx
[build]     vtkRectilinearGridReaderPython.cxx
[build]     vtkRectilinearGridWriterPython.cxx
[build]     vtkRowQueryPython.cxx
[build]     vtkRowQueryToTablePython.cxx
[build]     vtkSLACParticleReaderPython.cxx
[build]     vtkSLACReaderPython.cxx
[build]     vtkSLCReaderPython.cxx
[build]     vtkSQLDatabasePython.cxx
[build]     vtkSQLDatabaseSchemaPython.cxx
[build]     vtkSQLDatabaseTableSourcePython.cxx
[build]     vtkSQLQueryPython.cxx
[build]     vtkSQLiteDatabasePython.cxx
[build]     vtkSQLiteQueryPython.cxx
[build]     vtkSQLiteToTableReaderPython.cxx
[build]     vtkSTLReaderPython.cxx
[build]     vtkSTLWriterPython.cxx
[build]     vtkSegYIOUtilsPython.cxx
[build]     vtkSegYReaderInternalPython.cxx
[build]     vtkSegYReaderPython.cxx
[build]     Generating Code...
[build]     Compiling...
[build]     vtkSegYTraceReaderPython.cxx
[build]     vtkSimplePointsReaderPython.cxx
[build]     vtkSimplePointsWriterPython.cxx
[build]     vtkSortFileNamesPython.cxx
[build]     vtkStructuredGridReaderPython.cxx
[build]     vtkStructuredGridWriterPython.cxx
[build]     vtkStructuredPointsReaderPython.cxx
[build]     vtkStructuredPointsWriterPython.cxx
[build]     vtkTIFFReaderPython.cxx
[build]     vtkTIFFWriterPython.cxx
[build]     vtkTableReaderPython.cxx
[build]     vtkTableToDatabaseWriterPython.cxx
[build]     vtkTableToSQLiteWriterPython.cxx
[build]     vtkTableWriterPython.cxx
[build]     vtkTecplotReaderPython.cxx
[build]     vtkTextCodecFactoryPython.cxx
[build]     vtkTextCodecPython.cxx
[build]     vtkThreadedImageWriterPython.cxx
[build]     vtkTreeReaderPython.cxx
[build]     vtkTreeWriterPython.cxx
[build]     Generating Code...
[build]     Compiling...
[build]     vtkUTF16TextCodecPython.cxx
[build]     vtkUTF8TextCodecPython.cxx
[build]     vtkUnstructuredGridReaderPython.cxx
[build]     vtkUnstructuredGridWriterPython.cxx
[build]     vtkVeraOutReaderPython.cxx
[build]     vtkVideoSourcePython.cxx
[build]     vtkVolume16ReaderPython.cxx
[build]     vtkVolumeReaderPython.cxx
[build]     vtkWin32VideoSourcePython.cxx
[build]     vtkWindBladeReaderPython.cxx
[build]     vtkWriterPython.cxx
[build]     vtkXMLCompositeDataReaderPython.cxx
[build]     vtkXMLCompositeDataWriterPython.cxx
[build]     vtkXMLDataObjectWriterPython.cxx
[build]     vtkXMLDataParserPython.cxx
[build]     vtkXMLDataReaderPython.cxx
[build]     vtkXMLDataSetWriterPython.cxx
[build]     vtkXMLFileReadTesterPython.cxx
[build]     vtkXMLGenericDataObjectReaderPython.cxx
[build]     vtkXMLHierarchicalBoxDataFileConverterPython.cxx
[build]     Generating Code...
[build]     Compiling...
[build]     vtkXMLHierarchicalBoxDataReaderPython.cxx
[build]     vtkXMLHierarchicalBoxDataWriterPython.cxx
[build]     vtkXMLHierarchicalDataReaderPython.cxx
[build]     vtkXMLHyperTreeGridReaderPython.cxx
[build]     vtkXMLHyperTreeGridWriterPython.cxx
[build]     vtkXMLImageDataReaderPython.cxx
[build]     vtkXMLImageDataWriterPython.cxx
[build]     vtkXMLMultiBlockDataReaderPython.cxx
[build]     vtkXMLMultiBlockDataWriterPython.cxx
[build]     vtkXMLMultiGroupDataReaderPython.cxx
[build]     vtkXMLPDataObjectReaderPython.cxx
[build]     vtkXMLPDataReaderPython.cxx
[build]     vtkXMLPImageDataReaderPython.cxx
[build]     vtkXMLPPolyDataReaderPython.cxx
[build]     vtkXMLPRectilinearGridReaderPython.cxx
[build]     vtkXMLPStructuredDataReaderPython.cxx
[build]     vtkXMLPStructuredGridReaderPython.cxx
[build]     vtkXMLPTableReaderPython.cxx
[build]     vtkXMLPUnstructuredDataReaderPython.cxx
[build]     vtkXMLPUnstructuredGridReaderPython.cxx
[build]     Generating Code...
[build]     Compiling...
[build]     vtkXMLParserPython.cxx
[build]     vtkXMLPartitionedDataSetCollectionReaderPython.cxx
[build]     vtkXMLPartitionedDataSetCollectionWriterPython.cxx
[build]     vtkXMLPartitionedDataSetReaderPython.cxx
[build]     vtkXMLPartitionedDataSetWriterPython.cxx
[build]     vtkXMLPolyDataReaderPython.cxx
[build]     vtkXMLPolyDataWriterPython.cxx
[build]     vtkXMLReaderPython.cxx
[build]     vtkXMLRectilinearGridReaderPython.cxx
[build]     vtkXMLRectilinearGridWriterPython.cxx
[build]     vtkXMLStructuredDataReaderPython.cxx
[build]     vtkXMLStructuredDataWriterPython.cxx
[build]     vtkXMLStructuredGridReaderPython.cxx
[build]     vtkXMLStructuredGridWriterPython.cxx
[build]     vtkXMLTableReaderPython.cxx
[build]     vtkXMLTableWriterPython.cxx
[build]     vtkXMLUniformGridAMRReaderPython.cxx
[build]     vtkXMLUniformGridAMRWriterPython.cxx
[build]     vtkXMLUnstructuredDataReaderPython.cxx
[build]     vtkXMLUnstructuredDataWriterPython.cxx
[build]     Generating Code...
[build]     Compiling...
[build]     vtkXMLUnstructuredGridReaderPython.cxx
[build]     vtkXMLUnstructuredGridWriterPython.cxx
[build]     vtkXMLUtilitiesPython.cxx
[build]     vtkXMLWriterCPython.cxx
[build]     vtkXMLWriterPython.cxx
[build]     vtkXYZMolReaderPython.cxx
[build]     vtkZLibDataCompressorPython.cxx
[build]     Generating Code...
[build]        Creating library C:/D/S4/out/build/RelWithDebInfo/VTK-build/lib/Debug/vtkIOKitPython36D-8.2.lib and object C:/D/S4/out/build/RelWithDebInfo/VTK-build/lib/Debug/vtkIOKitPython36D-8.2.exp
[build]     vtkIOKitPythonD.vcxproj -> C:\D\S4\out\build\RelWithDebInfo\VTK-build\bin\Debug\vtkIOKitPython36D-8.2.dll
[build]     Python Wrapping - generating vtkAddMembershipArrayPython.cxx
[build]     Python Wrapping - generating vtkAdjacencyMatrixToEdgeTablePython.cxx
[build]     Python Wrapping - generating vtkArrayNormPython.cxx
[build]     Python Wrapping - generating vtkArrayToTablePython.cxx
[build]     Python Wrapping - generating vtkCollapseGraphPython.cxx
[build]     Python Wrapping - generating vtkCollapseVerticesByArrayPython.cxx
[build]     Python Wrapping - generating vtkContinuousScatterplotPython.cxx
[build]     Python Wrapping - generating vtkDataObjectToTablePython.cxx
[build]     Python Wrapping - generating vtkDotProductSimilarityPython.cxx
[build]     Python Wrapping - generating vtkExtractSelectedTreePython.cxx
[build]     Python Wrapping - generating vtkEdgeCentersPython.cxx
[build]     Python Wrapping - generating vtkExpandSelectedGraphPython.cxx
[build]     Python Wrapping - generating vtkExtractSelectedGraphPython.cxx
[build]     Python Wrapping - generating vtkGenerateIndexArrayPython.cxx
[build]     Python Wrapping - generating vtkGraphHierarchicalBundleEdgesPython.cxx
[build]     Python Wrapping - generating vtkGroupLeafVerticesPython.cxx
[build]     Python Wrapping - generating vtkMergeColumnsPython.cxx
[build]     Python Wrapping - generating vtkMergeGraphsPython.cxx
[build]     Python Wrapping - generating vtkMergeTablesPython.cxx
[build]     Python Wrapping - generating vtkMutableGraphHelperPython.cxx
[build]     Python Wrapping - generating vtkNetworkHierarchyPython.cxx
[build]     Python Wrapping - generating vtkPipelineGraphSourcePython.cxx
[build]     Python Wrapping - generating vtkPruneTreeFilterPython.cxx
[build]     Python Wrapping - generating vtkRandomGraphSourcePython.cxx
[build]     Python Wrapping - generating vtkReduceTablePython.cxx
[build]     Python Wrapping - generating vtkRemoveIsolatedVerticesPython.cxx
[build]     Python Wrapping - generating vtkSparseArrayToTablePython.cxx
[build]     Python Wrapping - generating vtkStreamGraphPython.cxx
[build]     Python Wrapping - generating vtkStringToCategoryPython.cxx
[build]     Python Wrapping - generating vtkStringToNumericPython.cxx
[build]     Python Wrapping - generating vtkTableToArrayPython.cxx
[build]     Python Wrapping - generating vtkTableToGraphPython.cxx
[build]     Python Wrapping - generating vtkTableToSparseArrayPython.cxx
[build]     Python Wrapping - generating vtkTableToTreeFilterPython.cxx
[build]     Python Wrapping - generating vtkThresholdGraphPython.cxx
[build]     Python Wrapping - generating vtkThresholdTablePython.cxx
[build]     Python Wrapping - generating vtkTransferAttributesPython.cxx
[build]     Python Wrapping - generating vtkTransposeMatrixPython.cxx
[build]     Python Wrapping - generating vtkTreeFieldAggregatorPython.cxx
[build]     Python Wrapping - generating vtkTreeDifferenceFilterPython.cxx
[build]     Python Wrapping - generating vtkTreeLevelsFilterPython.cxx
[build]     Python Wrapping - generating vtkVertexDegreePython.cxx
[build]     Python Wrapping - generating vtkRemoveHiddenDataPython.cxx
[build]     Python Wrapping - generating vtkKCoreDecompositionPython.cxx
[build]     Python Wrapping - generating vtkInfovisCorePythonInit.cxx
[build]     vtkAddMembershipArrayPython.cxx
[build]     vtkAdjacencyMatrixToEdgeTablePython.cxx
[build]     vtkArrayNormPython.cxx
[build]     vtkArrayToTablePython.cxx
[build]     vtkCollapseGraphPython.cxx
[build]     vtkCollapseVerticesByArrayPython.cxx
[build]     vtkContinuousScatterplotPython.cxx
[build]     vtkDataObjectToTablePython.cxx
[build]     vtkDotProductSimilarityPython.cxx
[build]     vtkEdgeCentersPython.cxx
[build]     vtkExpandSelectedGraphPython.cxx
[build]     vtkExtractSelectedGraphPython.cxx
[build]     vtkExtractSelectedTreePython.cxx
[build]     vtkGenerateIndexArrayPython.cxx
[build]     vtkGraphHierarchicalBundleEdgesPython.cxx
[build]     vtkGroupLeafVerticesPython.cxx
[build]     vtkInfovisCorePythonInitImpl.cxx
[build]     vtkKCoreDecompositionPython.cxx
[build]     vtkMergeColumnsPython.cxx
[build]     vtkMergeGraphsPython.cxx
[build]     Generating Code...
[build]     Compiling...
[build]     vtkMergeTablesPython.cxx
[build]     vtkMutableGraphHelperPython.cxx
[build]     vtkNetworkHierarchyPython.cxx
[build]     vtkPipelineGraphSourcePython.cxx
[build]     vtkPruneTreeFilterPython.cxx
[build]     vtkRandomGraphSourcePython.cxx
[build]     vtkReduceTablePython.cxx
[build]     vtkRemoveHiddenDataPython.cxx
[build]     vtkRemoveIsolatedVerticesPython.cxx
[build]     vtkSparseArrayToTablePython.cxx
[build]     vtkStreamGraphPython.cxx
[build]     vtkStringToCategoryPython.cxx
[build]     vtkStringToNumericPython.cxx
[build]     vtkTableToArrayPython.cxx
[build]     vtkTableToGraphPython.cxx
[build]     vtkTableToSparseArrayPython.cxx
[build]     vtkTableToTreeFilterPython.cxx
[build]     vtkThresholdGraphPython.cxx
[build]     vtkThresholdTablePython.cxx
[build]     vtkTransferAttributesPython.cxx
[build]     Generating Code...
[build]     Compiling...
[build]     vtkTransposeMatrixPython.cxx
[build]     vtkTreeDifferenceFilterPython.cxx
[build]     vtkTreeFieldAggregatorPython.cxx
[build]     vtkTreeLevelsFilterPython.cxx
[build]     vtkVertexDegreePython.cxx
[build]     Generating Code...
[build]        Creating library C:/D/S4/out/build/RelWithDebInfo/VTK-build/lib/Debug/vtkInfovisCorePython36D-8.2.lib and object C:/D/S4/out/build/RelWithDebInfo/VTK-build/lib/Debug/vtkInfovisCorePython36D-8.2.exp
[build]     vtkInfovisCorePythonD.vcxproj -> C:\D\S4\out\build\RelWithDebInfo\VTK-build\bin\Debug\vtkInfovisCorePython36D-8.2.dll
[build]     Python Wrapping - generating vtkAbstractMapper3DPython.cxx
[build]     Python Wrapping - generating vtkAbstractMapperPython.cxx
[build]     Python Wrapping - generating vtkAbstractPickerPython.cxx
[build]     Python Wrapping - generating vtkAbstractVolumeMapperPython.cxx
[build]     Python Wrapping - generating vtkActor2DCollectionPython.cxx
[build]     Python Wrapping - generating vtkActor2DPython.cxx
[build]     Python Wrapping - generating vtkActorCollectionPython.cxx
[build]     Python Wrapping - generating vtkActorPython.cxx
[build]     Python Wrapping - generating vtkAssemblyPython.cxx
[build]     Python Wrapping - generating vtkBackgroundColorMonitorPython.cxx
[build]     Python Wrapping - generating vtkBillboardTextActor3DPython.cxx
[build]     Python Wrapping - generating vtkCameraActorPython.cxx
[build]     Python Wrapping - generating vtkCameraPython.cxx
[build]     Python Wrapping - generating vtkCameraInterpolatorPython.cxx
[build]     Python Wrapping - generating vtkCellCenterDepthSortPython.cxx
[build]     Python Wrapping - generating vtkCIEDE2000Python.cxx
[build]     Python Wrapping - generating vtkColorTransferFunctionPython.cxx
[build]     Python Wrapping - generating vtkCompositeDataDisplayAttributesPython.cxx
[build]     Python Wrapping - generating vtkCompositeDataDisplayAttributesLegacyPython.cxx
[build]     Python Wrapping - generating vtkCompositePolyDataMapperPython.cxx
[build]     Python Wrapping - generating vtkCoordinatePython.cxx

This is the most time-consuming step during rebuild of Slicer, is there anyway can I reduce the rebuild time?

The build command I used is:

"C:\Program Files\CMake\bin\cmake.EXE" --build c:/D/S4/out/build/RelWithDebInfo --parallel 12

This happens because a VTK bug that always rebuilds hierarchy files if the build was not clean and very slow check in the VTK Python wrapper if a file exists. With help from David Gobbi, we fixed both issues in VTK about a month ago, but we have not yet backported these improvements into Slicer.

You can fix the first problem quite easily:

  1. Rebuild Slicer (including all dependencies) completely from scratch, from a clean build folder.
  2. If you just change Slicer and its modules, don’t build the top-level folder (c:\D\S4R\Slicer.sln), which builds all the dependencies, only the inner-build (c:\D\S4R\Slicer-build\Slicer.sln)

We’ll soon rebase Slicer’s VTK on the latest VTK master, which will speed up hierarchy file generation several times faster.


Thanks for pointing it out. Nice to see you are going to rebase the new VTK version! I will try the two methods to see how they change the build time.