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

3d slicer 5.6.1 vtk complie error #7637

Open
xjjgjmeng opened this issue Mar 18, 2024 · 16 comments
Open

3d slicer 5.6.1 vtk complie error #7637

xjjgjmeng opened this issue Mar 18, 2024 · 16 comments
Labels
Domain: build-system Status: Question Further information is requested

Comments

@xjjgjmeng
Copy link

xjjgjmeng commented Mar 18, 2024

I compiled 3D slicer (5.6.1), but vtk failed to compile successfully (vs2019, Qt5.15.2). It seems to be python related, and one of them reported an error:

16> Generating Python wrapper sources for vtkAbstractGridConnectivity
16> vtkWrapPython-9.2d.exe: In D:/gitrepos/Slicer/build/VTK/Filters/Geometry/vtkAbstractGridConnectivity.h:1: syntax error.
16>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: “D:\gitrepos\Slicer\build \VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkAbstractGridConnectivityPython.cxx.rule;D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkAttributeSmoothingFilterPython.cxx .rule;D:\gitrepos\Slicer\build\VTK-build \CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkCompositeDataGeometryFilterPython.cxx.rule;D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkDataSetRegionSurfaceFilterPython.cxx .rule;D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a \vtkDataSetSurfaceFilterPython.cxx.rule;D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkExplicitStructuredGridSurfaceFilterPython.cxx.rule;D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af1 1fe569d29134735de9f076a\vtkGeometryFilterPython.cxx .rule; D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkHierarchicalDataSetGeometryFilterPython.cxx.rule; f076a\vtkImageDataGeometryFilterPython.cxx.rule;D :\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkImageDataToUniformGridPython.cxx.rule;D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\vt kLinearToQuadraticCellsFilterPython.cxx.rule;D:\gitrepos\ Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkMarkBoundaryFilterPython.cxx.rule;D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkProjectSphereFilterPython .cxx.rule;D:\gitrepos\Slicer\build\ VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkRecoverGeometryWireframePython.cxx.rule;D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkRectilinearGridGeometryFilter Python.cxx.rule;D:\gitrepos\Slicer\build\VTK-build\ CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkRectilinearGridPartitionerPython.cxx.rule; ;D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\ vtkStructuredAMRNeighborPython.cxx.rule;D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkStructuredGridConnectivityPython.cxx.rule;D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569 d29134735de9f076a\vtkStructuredGeometryFilterPython.cxx. rule;D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkStructuredGridPartitionerPython.cxx.rule;D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a \vtkStructuredNeighborPython.cxx.rule;D: \gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkStructuredPointsGeometryFilterPython.cxx.rule;D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\v tkUnstructuredGridGeometryFilterPython.cxx.rule;D:\gitrepos\Slicer \build\VTK-build\CMakeFiles\403ee1af11fe569d29134735de9f076a\vtkFiltersGeometryModulePython.cxx.rule;D:\gitrepos\Slicer\build\VTK-build\CMakeFiles\91e9c2b522b46bd386e977bc61299a90\vtkFiltersG eometryPythonInit.cxx.rule" exited with code 1 . [D:\gitrepos\Slicer\build\VTK-build\vtkFiltersGeometryPython.vcxproj]
@xjjgjmeng
Copy link
Author

@lassoan Do you know how to solve this? thank you.

@xjjgjmeng
Copy link
Author

The error reported when compiling vtkCommonColorPython is as follows:
image

@jcfr
Copy link
Member

jcfr commented Mar 18, 2024

Few questions:

  • Do you have an issue building the Slicer main branch ?
  • Did you modify the VTK sources in any way ?

@jcfr
Copy link
Member

jcfr commented Mar 18, 2024

Unless the problem has been problem clearly identified1, I suggest you post the question at https://discourse.slicer.org/

Once you have done so, considering commenting here with a link to the post so that we can close this issue 🙏

Footnotes

  1. https://slicer.readthedocs.io/en/latest/user_guide/get_help.html

@jcfr jcfr added the Status: Question Further information is requested label Mar 18, 2024
@xjjgjmeng
Copy link
Author

Few questions:

  • Do you have an issue building the Slicer main branch ?
  • Did you modify the VTK sources in any way ?

I followed the steps below to compile:
1.git clone https://github.com/Slicer/Slicer.git
2.git checkout v5.6.1
3.cmake (no errors)
4. open project
5.do ALL_BUILD

I didn't modify any files, but after compiling I found that a py file was modified:
image

@xjjgjmeng
Copy link
Author

I tried vs2022 again today, and the following error also occurred:

19:36:17:355	46>  Generating Python wrapper sources for vtkSlicerVolumesLogic
19:36:18:118	46>  vtkWrapPython-9.2d.exe: In D:/Slicer/Modules/Loadable/Volumes/Logic/vtkSlicerVolumesLogic.h:1: syntax error.
19:36:18:924	46>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(249,5): error MSB8066: “D:\Slicer\b\Slicer-build\CMakeFiles\c302bb999142b2ae1412943bd7cd9c5f\vtkSlicerVolumesModuleLogicPythonInit.cxx.rule;

@xjjgjmeng
Copy link
Author

The following are the projects that failed to compile (they are all related to vtk python wrapper), and the others passed the compilation:
CTK
Experimental
ITK
SimpleITK
Slicer
SlicerExcutionModel
teem
VTK

@pieper
Copy link
Member

pieper commented Mar 19, 2024

“D:\Slicer\b\Slicer-build\CMakeFiles\c302bb999142b2ae1412943bd7cd9c5f\vtkSlicerVolumesModuleLogicPythonInit.cxx.rule;

Try a very short build path, like D:\sb

@xjjgjmeng
Copy link
Author

“D:\Slicer\b\Slicer-build\CMakeFiles\c302bb999142b2ae1412943bd7cd9c5f\vtkSlicerVolumesModuleLogicPythonInit.cxx.rule;

Try a very short build path, like D:\sb

Now build path is D:\Slicer\b,too long?

@jcfr
Copy link
Member

jcfr commented Mar 19, 2024

Thanks for your patience with this.

As hinted by @pieper, consider trying a very short path.

Using D:\Slicer\b may indeed be too long.

@xjjgjmeng
Copy link
Author

I modified the build pathD:/b, but the problem still occurs:
image
The compilation result takes vtkCommonColor as an example:
image
vtkCommonColor-hierachy:
image
vtkCommonColorPython:
image

@xjjgjmeng
Copy link
Author

@jcfr
Copy link
Member

jcfr commented Mar 25, 2024

Throughout your experiments, after opening the solution file of a specific project (e.g D:/b/VTK-build/VTK.sln), make also sure you select the build type matching the one used for the outer build (e.g Release vs Debug)

Assuming that after opening VTK.sln, it looks like you selected the matching build type and were able to narrow down the issue to failure in generating the wrappers (e.g Generating Python wrapper sources for vtkColorSeries failed).

image
image

The expected output should be similar to the following:

Rebuild started...
1>------ Rebuild All started: Project: vtkCommonColorPython, Configuration: Release x64 ------
1>Generating Python wrapper sources for vtkColorSeries
1>Generating Python wrapper sources for vtkNamedColors
1>Generating Python wrapper sources for vtkCommonColorModule
1>Generating the Python module initialization sources for vtkCommonColorPython
1>Building Custom Rule C:/D/T/jcfr/vpaw-rel/VTK/CMakeLists.txt
1>vtkColorSeriesPython.cxx
1>vtkNamedColorsPython.cxx
1>vtkCommonColorModulePython.cxx
1>vtkCommonColorPythonInit.cxx
1>vtkCommonColorPythonInitImpl.cxx
1>Generating Code...
...

@jcfr
Copy link
Member

jcfr commented Mar 25, 2024

Let's now check if the issue has been addressed in the latest version of VTK.

Since the version of VTK built as part of Slicer is not the latest, this will help us understand if the root problem has already been fixed.

To move forward consider building VTK by cloning it from git, see https://docs.vtk.org/en/latest/build_instructions/build.html

@xjjgjmeng
Copy link
Author

Throughout your experiments, after opening the solution file of a specific project (e.g D:/b/VTK-build/VTK.sln), make also sure you select the build type matching the one used for the outer build (e.g Release vs Debug)

Assuming that after opening VTK.sln, it looks like you selected the matching build type and were able to narrow down the issue to failure in generating the wrappers (e.g Generating Python wrapper sources for vtkColorSeries failed).

image image

The expected output should be similar to the following:

Rebuild started...
1>------ Rebuild All started: Project: vtkCommonColorPython, Configuration: Release x64 ------
1>Generating Python wrapper sources for vtkColorSeries
1>Generating Python wrapper sources for vtkNamedColors
1>Generating Python wrapper sources for vtkCommonColorModule
1>Generating the Python module initialization sources for vtkCommonColorPython
1>Building Custom Rule C:/D/T/jcfr/vpaw-rel/VTK/CMakeLists.txt
1>vtkColorSeriesPython.cxx
1>vtkNamedColorsPython.cxx
1>vtkCommonColorModulePython.cxx
1>vtkCommonColorPythonInit.cxx
1>vtkCommonColorPythonInitImpl.cxx
1>Generating Code...
...

I compiled it according to your suggestion and the result is as shown below:
image

@xjjgjmeng
Copy link
Author

Another piece of information: I can compile and run and debug on another computer, but the same steps don't work on this computer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: build-system Status: Question Further information is requested
Development

No branches or pull requests

3 participants