Build failure windows

Hi, I get VTK build failure on VS 2017.

Error	LNK1181	cannot open input file 'C:\S\tbb-install\lib\intel64\tbb.lib' [C:\S\VTK-build\vtkCommon.vcxproj]	VTK	C:\S\LINK	1	
Error	LNK1181	cannot open input file 'C:\S\VTK-build\lib\Release\vtkOpenGL-8.2.lib' [C:\S\SlicerExecutionModel-build\ModuleDescriptionParser\ModuleDescriptionParser.vcxproj]	SlicerExecutionModel	C:\S\LINK	1	
Error	LNK1181	cannot open input file 'C:\S\VTK-build\lib\Release\vtkChartsCore-8.2.lib' [C:\S\CTK-build\CTK-build\Libs\Visualization\VTK\Core\CTKVisualizationVTKCore.vcxproj] [C:\S\CTK-build\CTK.vcxproj]	CTK	C:\S\LINK	1	

Indeed, the tbb is located in a subfolder:

$ dir
12/06/2017  08:54 AM    <DIR>          vc12
12/06/2017  08:54 AM    <DIR>          vc12_ui
12/06/2017  08:54 AM    <DIR>          vc14
12/06/2017  08:54 AM    <DIR>          vc14_uwp

Any idea what is going on?

The compiler is looking for the file in incorrect location. It is at c:\S\tbb-install\lib\intel64\vc14. If you use VS2017 then make sure to use VS2015 toolset.

Reading more about Tbb, it seems that we could link the against the same version when using VS2017.
See https://github.com/intel/tbb/issues/65#issuecomment-403066264 and https://github.com/intel/tbb/blob/2019_U8/doc/Release_Notes.txt

VS2015 toolset is probably needed anyway: last time I tried a couple of weeks ago ITK or some other libraries failed to build with VS2017 and maybe it is needed for compatibility with Python binaries, too.

By copying the files from the vc14 subfolder into C:\S\tbb-install\lib\intel64, the VTK compile could succeed. But yes, python could be a problem. I will update status on Friday.

Current Qt installer does not provide 5.10.X (it is not shown in either LTS or archive). Presumably 5.9.8 would therefore be recommended?

You need to click “Refresh” after enabling “Archive”.

That is interesting. I don’t get the extra one at the bottom.
Capture

Andras may get it because it’s already installed. I added the 5.10.0 download link to the Build instructions page. This is the download link itself.

I also noticed recently that they removed this archived version of Qt from the maintenance tool as well. Evidently it is intentional https://bugreports.qt.io/browse/QTBUG-76323

1 Like

Back to the original topic, the VS2017 build (with VS2017 toolset) seems to work fine. I only had to copy the tbb.lib (for build) and tbb.dll (for launching).

Everything, including python, seems to work fine.

Thank you, it’s good to know. Have you tried to install and use Python packages that contain binaries?

You mean like pip install? Or can you give an example?

can you give an example?

pip install pandas
pip install scipy

Then you could run the corresponding tests.

I only had to copy the tbb.lib (for build) and tbb.dll (for launching).

Makes sense. I will update the build system so that building with VS2017 works as expected.

Python packages that contain binaries […] VS2017 + toolset v141

Since v140 and v141 are suppose to be binary compatible, I guess we could update the build instructions.

See abi - Binary compatibility between VS2017 and VS2015 - Stack Overflow and Issue 31340: Use VS 2017 compiler for build - Python tracker

If we can build Slicer with VS2017 without losing Python binary compatibility then we should switch to VS2017 because then we could upgrade to latest Qt (which contains a couple of useful improvements and fixes).

This PR should allow to build using VS2017. See https://github.com/Slicer/Slicer/pull/1163

Could someone test this is effectively the case ?

After confirming it builds, we may also have to revisit which runtime libraries are packages. Indeed, the package will then have dependency on both VS2015 and VS2017 runtime libraries.

See https://github.com/Slicer/Slicer/blob/7f08682494af41c7941b62cbcd37a91feffe148b/CMake/SlicerCPack.cmake#L158-L159 and InstallRequiredSystemLibraries

Could Slicer build with VS2019 as well?

The v142 toolset is binary compatible with v141 and v140. https://devblogs.microsoft.com/cppblog/cpp-binary-compatibility-and-pain-free-upgrades-to-visual-studio-2019/

Well, my first test was a bust. I am not a regular python user, so that is surely why.

I tried “pip install pandas” from the command line:

>>> pip install pandas
  File "<console>", line 1
    pip install pandas
              ^
SyntaxError: invalid syntax

After some web search, I understood the following is the way to install using pip:

c:\S\python-install\bin>PythonSlicer -m pip install pandas
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting pandas
  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/pandas/
  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/pandas/
  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/pandas/
  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/pandas/
  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/pandas/
  Could not fetch URL https://pypi.org/simple/pandas/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pandas/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping
  Could not find a version that satisfies the requirement pandas (from versions: )
No matching distribution found for pandas
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping

Clearly I misunderstood the procedure, and I will keep looking. If it’s obvious to y’all, any hints are welcome!

Do you think it is because I set Slicer_USE_PYTHONQT_WITH_OPENSSL as unchecked?

Yes, configuring python without OpenSSL is why the https url did not work.

From the console you can do slicer.util.pip_install("pandas").