Failed in building 3D Slicer on win10 with vs2015x64

Dear everybody:

I am building 3D Slicer 4.11.0 on windows10 for a whole week. But still I met lots of problems and failed. My building process is as follows:

  1. System: win10x64
  2. CMake: 3.16.5, self-build with openssl ( both self-built and downloaded from official website have been tried.)
  3. git. version 2.25.1. windows.1
  4. svn. 1.13.0 (r1867053)
  5. qt: version 5.10.1 from official website
  6. vs2015x64.
  7. My source directotry is D:\S\S4 and my binary directory is D:\S\SD

When 3D Slicer is built, Qt5_DIR is correctly selected. The Option Slicer_USE_PYTHONQT_WITH_OPENSSL is selected to ON and OFF both. Neither of them works for me.

The build error is as follows:

  1. Slicer_USE_PYTHONQT_WITH_OPENSSL is set to ON
    error

  2. Slicer_USE_PYTHONQT_WITH_OPENSSL is set to OFF
    error_nossl

It seems the errors are related to OpenSSL and no matter whether I switch the option Slicer_USE_PYTHONQT_WITH_OPENSSL ON or OFF, the building errors are still there. I can’t solve it. Could anyone help ?

The addition error information is as follows:

  1. If I built the python-setuptools project separately, the building error is as follows:
1>------ 已启动生成: 项目: python-setuptools, 配置: Debug x64 ------
1>  Creating directories for 'python-setuptools'
1>  Building Custom Rule D:/S/S4/CMakeLists.txt
1>  No download step for 'python-setuptools'
1>  No update step for 'python-setuptools'
1>  No patch step for 'python-setuptools'
1>  Generate version-python-setuptools.txt and license-python-setuptools.txt
1>  fatal: not a git repository (or any of the parent directories): .git
1>  CMake Warning (dev) at D:/S/SD/CMakeFiles/python-setuptools-generate-project-description.cmake:68 (message):
1>    python-setuptools: Could not find a license file
1>  This warning is for project developers.  Use -Wno-dev to suppress it.
1>
1>  No configure step for 'python-setuptools'
1>  No build step for 'python-setuptools'
1>  Performing install step for 'python-setuptools'
1>  CMake Error at D:/S/SD/python-setuptools-prefix/src/python-setuptools-stamp/python-setuptools-install-Debug.cmake:49 (message):
1>    Command failed: 1
1>
1>     'D:/S/SD/python-install/bin/SlicerPython.exe' '-m' 'pip' 'install' '--require-hashes' '-r' 'D:/S/SD/python-setuptools-requirements.txt'
1>
1>    See also
1>
1>      D:/S/SD/python-setuptools-prefix/src/python-setuptools-stamp/python-setuptools-install-*.log
1>
1>
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: “cmd.exe”已退出,代码为 1。

If I looked into the error log, the file shows:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/setuptools/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/setuptools/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/setuptools/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/setuptools/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/setuptools/
  Could not find a version that satisfies the requirement setuptools==41.6.0 (from -r D:/S/SD/python-setuptools-requirements.txt (line 1)) (from versions: )
No matching distribution found for setuptools==41.6.0 (from -r D:/S/SD/python-setuptools-requirements.txt (line 1))
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

I serously doubt it is related to OpenSSL option. However, even if I turn the option OFF, still the error jumps out.

And I have some additional doubts here.

  1. Why 3D Slicer need to build VTK, ITK, CTK from scratch all the time? The most inconvenient thing is that I have to redownload about 1GB source files from web each time I failed in building and retry. It costs a lot of time. I noticed that the building process of VTK, ITK, CTK and some other project is OK and cost lots of time.

  2. Another trial I have done is to reserve the downloaded github files in the binary directory for the new building, however it still failed during the procedures.
    Are there are methods to solve this problems?

Most important, how to successfuly build the Slicer on Windows. I have succeeded on Ubuntu system. It is a great software.

Thank you very much.

tangtang

I’ve built Slicer successfully on Windows in Debug mode a few days ago using these commands:

set PATH=%PATH%;C:\Program Files\Git\cmd
set GIT_EXE="c:\Program Files\Git\bin\git.exe"
mkdir C:\D\S4D
cd /d C:\D\S4D
"C:\Program Files\CMake\bin\cmake.exe" -G "Visual Studio 16 2019" -DSlicer_USE_PYTHONQT_WITH_OPENSSL:BOOL=ON -DQt5_DIR:PATH=C:\Qt\5.12.7\msvc2017_64\lib\cmake\Qt5 -DSlicer_USE_SimpleITK:BOOL=ON -T "v141" ../S4
"C:\Program Files\CMake\bin\cmake.exe" --build . --config Debug -- /m

A few weeks ago, I’ve set up debug and release mode builds from scratch based on Slicer build instructions.

You need to build dependencies only once. This is a small price to pay for the time it saves that you don’t need to worry about building all the dependencies manually.

Thank you very much for your building information. Could I know which Slicer branch do you build from the github? The latest 4.11.0?

I noticed that the reason that I didn’t succeed probably came from my network. A stable network which could support downloading more than 1GB data from web is important.

Althought I have built Slicer.ext on windows, I still have problems with the building solution. Some projects which related to python didn’t work. The error message from the VS2015 is as follows:
error_python

I check the error information and the requirement. I noticed that the python which is downloaded by the Slicer solution offers the python-setuptools 39.0.1 and the requirement for python-setuptools from python-setuptools-requirements.txt is 41.6.0. Would this be the reasons that I can’t build the above python-based projects in my solutions? and how could I solve it?

I noticed that if I choose branch 4.10.2, then the python would choose 2.17.x, and there is no requirements for python-setuptools. However since I choose branch 4.11.0, the python version is 3.6.7, and there exist the python requirement which triggled the error.

I am not sure about the problems, and I would like to know the solution to this problem.

Thank you.

tangtang

Latest master branch.

If anything fails due to slow network then you just need to restart the build (without deleting anything that has been already downloaded or built).

The master branch. GitHub - Slicer/Slicer: Multi-platform, free open source software for visualization and image computing.. Fetch the latest as recent Slicer versions use a version of setuptools that’s newer than 41.6.0.

Just doing a google search on the original errors you had, might you have any version of Anaconda installed on your Windows machine? This might be causing problems.

Others have seemingly done the following with success (source):

Removing both libssl-1_1-x64.dll and libcrypto-1_1-x64.dll in C:/Windows/System32/ fixed the problem for me.

Thank you very much.

If I reconfigure the project using CMake with different options, it seems that I have to download the files again. That is what troubles me.

You are quiet right. I have installed both python3.7 and anaconda on my win10 operation system.

And I have tried your solution which delete two files from windows fold and add three anaconda path to the system PATH. Both of them failed to solve the problem.

I would actually suggest to remove the anaconda install and rebuild. Want to make sure SlicerPython and the pip for that is being used and not being interrupted by some other system pip.

There’s going to be inevitably some redownloading of files necessary to get it to build correctly.

Thank you very much for you advice. I have tried to build slicer on a computer without Anaconda and it does succeed. It costs me three days to complete the download.

And I have tried to remove the anaconda path from the system PATH, it seems useless.

Hi, I also have the same issue. After I closed the proxy the python related projects are compiled correctly. And at the same time the annaconda is uninstalled completly from my desktop.