Page MenuHomePhabricator

Error compiling Mitk 2016-11 : Error on SimpleITK installation phase (patch provided)
Closed, InvalidPublic

Description

We are compiling the new release just as we did for the former one. Here are Python-relevant options we use with CMake :

-DMITK_USE_Python=ON 
-DMITK_USE_SYSTEM_PYTHON=ON 
-DPYTHONPATH=%PYTHONPATH% 
-DPYTHON_EXECUTABLE=%PYTHON_BASE%/python.exe 
-DPYTHON_INCLUDE_DIR=%PYTHON_BASE%/include 
-DPYTHON_LIBRARY=%PYTHON_BASE%/libs/python27.lib 
-DPYTHON_PACKAGES_PATH=%PYTHON_BASE%/site-packages 
-DITK_WRAP_PYTHON:BOOL=true

where system values are :

set PYTHON_BASE=c:/dev/tools/anaconda250_amd64
set PATH=%PYTHON_BASE%/;%Path%
rem -- set PYTHONPATH=%CD%/ep/Lib/site-packages/
set PYTHONPATH=%PYTHON_BASE%
set PYTHON_EXECUTABLE=%PYTHON_BASE%/python.exe

SimpleITK compiles fine, but cannot be installed :

     Build succeeded.
         0 Warning(s)
         0 Error(s)
     
     Time Elapsed 00:00:31.24
     Performing sitk_python_install_step step for 'SimpleITK'
     'PYTHONUSERBASE' is not recognized as an internal or external command,
     operable program or batch file.
51>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code

I may just be a missing "-D" or "set" but i was unable to find it.

Revisions and Commits

Event Timeline

We fixed that in the previous version patching CMakeExternals/SimpleITK.cmake :

-          COMMAND PYTHONUSERBASE=${_install_dir} ${PYTHON_EXECUTABLE} setup.py install --prefix=${_install_dir}
+          COMMAND ${PYTHON_EXECUTABLE} setup.py install --prefix=${_install_dir}

It's not possible to have a variable declaration before a command in Windows.

Here is a simple patch wich fixes the command format. The PYTHONPATH has to be set before CMake is called.
basically, it has to be set to [compilation folder]ep/Lib/site-packages/

With that patch the installation process no longer fails under Windows.

aurelien renamed this task from Error compiling Mitk 2016-11 : Error on SimpleITK installation phase to Error compiling Mitk 2016-11 : Error on SimpleITK installation phase (patch provided).Mar 6 2017, 5:45 PM
kislinsk triaged this task as Normal priority.Mar 7 2017, 10:32 AM
kislinsk added a revision: Restricted Differential Revision.
kislinsk added a project: Pull Request.

Can someone just explain how to use this patch. I am fairly new to MITK and would be very thankful for an explanation!

@jernejf is suggest you to use WinMerge to apply the patch on your Mitk source tree.

kislinsk added a project: Restricted Project.
kislinsk added a subscriber: floca.
kislinsk added a subscriber: kislinsk.

Is this still an open topic?

No, I think in 2018.04 we even do not have SimpleITK anymore. So, closing as Invalid eventhough it was valid back then.