Slicer debug-mode buid error in 2017-07-23 version on Windows due to bzip2

This error now prevents all debug-mode builds on Windows, so it would be important to get a fix soon.

The build error is in Python, due to libbz2.lib not found in Release subdirectory. Building of this library is very similar to zlib, which works well. Probably the difference is that for zlib an install directory is created and python picks it up from there.

Build log (error is at the end):

1>------ Build started: Project: CTKResEdit, Configuration: Debug x64 ------
2>------ Build started: Project: bzip2, Configuration: Debug x64 ------
3>------ Build started: Project: tcl, Configuration: Debug x64 ------
4>------ Build started: Project: OpenSSL, Configuration: Debug x64 ------
2>  Performing update step for 'bzip2'
5>------ Build started: Project: CTKAPPLAUNCHER, Configuration: Debug x64 ------
6>------ Build started: Project: python-source, Configuration: Debug x64 ------
7>------ Build started: Project: zlib, Configuration: Debug x64 ------
7>  Performing update step for 'zlib'
8>------ Build started: Project: JsonCpp, Configuration: Debug x64 ------
8>  Performing update step for 'JsonCpp'
9>------ Build started: Project: CTKAppLauncherLib, Configuration: Debug x64 ------
10>------ Build started: Project: python, Configuration: Debug x64 ------
11>------ Build started: Project: DCMTK, Configuration: Debug x64 ------
9>  Performing update step for 'CTKAppLauncherLib'
11>  Performing update step for 'DCMTK'
12>------ Build started: Project: DataStore, Configuration: Debug x64 ------
12>  Performing update step for 'DataStore'
13>------ Build started: Project: EMSegment, Configuration: Debug x64 ------
14>------ Build started: Project: LandmarkRegistration, Configuration: Debug x64 ------
13>  Performing update step (SVN update) for 'EMSegment'
14>  Performing update step for 'LandmarkRegistration'
13>  Updating '.':
15>------ Build started: Project: LibArchive, Configuration: Debug x64 ------
10>  Performing update step for 'python'
15>  Performing update step for 'LibArchive'
16>------ Build started: Project: MultiVolumeExplorer, Configuration: Debug x64 ------
10>  Performing configure step for 'python'
13>  At revision 17130.
10>  loading initial cache file C:/D/S4D/python-prefix/tmp/python-cache-Debug.cmake
16>  Performing update step for 'MultiVolumeExplorer'
10>CUSTOMBUILD : -- warning : Did not find file Compiler/MSVC-ASM
17>------ Build started: Project: MultiVolumeImporter, Configuration: Debug x64 ------
10>  -- SRC_DIR: C:/D/S4D/Python-2.7.13
10>  -- PY_VERSION: 2.7.13
17>  Performing update step for 'MultiVolumeImporter'
10>  -- The system name is Windows
10>  -- The system processor is AMD64
10>  -- The system version is 10.0.15063
18>------ Build started: Project: OpenIGTLink, Configuration: Debug x64 ------
19>------ Build started: Project: RapidJSON, Configuration: Debug x64 ------
20>------ Build started: Project: curl, Configuration: Debug x64 ------
21>------ Build started: Project: BRAINSTools, Configuration: Debug x64 ------
22>------ Build started: Project: jqPlot, Configuration: Debug x64 ------
20>  Performing update step for 'curl'
21>  Performing update step for 'BRAINSTools'
23>------ Build started: Project: CompareVolumes, Configuration: Debug x64 ------
24>------ Build started: Project: OtsuThresholdImageFilter, Configuration: Debug x64 ------
25>------ Build started: Project: qRestAPI, Configuration: Debug x64 ------
23>  Performing update step for 'CompareVolumes'
24>  Performing update step for 'OtsuThresholdImageFilter'
25>  Performing update step for 'qRestAPI'
26>------ Build started: Project: OpenIGTLinkIF, Configuration: Debug x64 ------
27>------ Skipped Build: Project: Experimental, Configuration: Debug x64 ------
27>Project not selected to build for this solution configuration 
28>------ Skipped Build: Project: RUN_TESTS, Configuration: Debug x64 ------
28>Project not selected to build for this solution configuration 
26>  Performing update step for 'OpenIGTLinkIF'
10>  -- bdist_wininst: Generated 'Windows Installer' name is 'wininst-12.0-amd64'
10>  -- bdist_wininst: Looking for executable named 'wininst-12.0-amd64.exe' in source tree
10>  -- bdist_wininst: Looking for executable named 'wininst-12.0-amd64.exe' in source tree - not found
10>  -- bdist_wininst: Configuring 'Windows Installer' named 'wininst-12.0-amd64'
10>  -- 
10>  -- The following extensions will NOT be built:
10>  -- 
10>  --     crypt (not set: HAVE_LIBCRYPT)
10>  --     atexit (not set: IS_PY3)
10>  --     _codecs (not set: IS_PY3)
10>  --     faulthandler (not set: IS_PY3)
10>  --     _opcode (not set: IS_PY3)
10>  --     _operator (not set: IS_PY3)
10>  --     _pickle (not set: IS_PY3)
10>  --     _sre (not set: IS_PY3)
10>  --     _stat (not set: IS_PY3)
10>  --     _symtable (not set: IS_PY3)
10>  --     _testbuffer (not set: IS_PY3)
10>  --     _testimportmultiple (not set: IS_PY3)
10>  --     _testmultiphase (not set: IS_PY3)
10>  --     _tracemalloc (not set: IS_PY3)
10>  --     _weakref (not set: IS_PY3)
10>  --     xxlimited (not set: IS_PY3)
10>  --     xxsubtype (not set: IS_PY3)
10>  --     zipimport (not set: IS_PY3)
10>  --     fcntl (not set: UNIX)
10>  --     grp (not set: UNIX)
10>  --     nis (not set: UNIX HAVE_LIBNSL)
10>  --     posix (not set: UNIX)
10>  --     pwd (not set: UNIX)
10>  --     resource (not set: UNIX)
10>  --     spwd (not set: UNIX HAVE_GETSPNAM HAVE_GETSPENT)
10>  --     syslog (not set: UNIX)
10>  --     termios (not set: UNIX)
10>  --     errno (not set: IS_PY3 UNIX)
10>  --     _posixsubprocess (not set: IS_PY3 UNIX)
10>  --     _scproxy (not set: APPLE HAVE_LIBSYSTEMCONFIGURATION)
10>  --     linuxaudiodev (not set: LINUX)
10>  --     ossaudiodev (not set: LINUX)
10>  --     overlapped (not set: IS_PY3)
10>  --     _winapi (not set: IS_PY3)
10>  --     _bsddb (not set: DB_INCLUDE_PATH DB_LIBRARIES)
10>  --     _curses_panel (not set: CURSES_LIBRARIES PANEL_LIBRARIES HAVE_PANEL_H OR HAVE_NCURSES_PANEL_H)
10>  --     _curses (not set: CURSES_LIBRARIES)
10>  --     dbm (not set: NDBM_TAG GDBM_LIBRARY GDBM_COMPAT_LIBRARY)
10>  --     gdbm (not set: GDBM_INCLUDE_PATH GDBM_LIBRARY GDBM_COMPAT_LIBRARY)
10>  --     readline (not set: READLINE_INCLUDE_PATH READLINE_LIBRARY CURSES_LIBRARIES HAVE_READLINE_READLINE_H)
10>  --     _sqlite3 (not set: SQLITE3_INCLUDE_PATH SQLITE3_LIBRARY)
10>  -- 
10>  -- Configuring done
10>  -- Generating done
10>  -- Build files have been written to: C:/D/S4D/python-build
10>  Performing build step for 'python'
10>  Microsoft (R) Build Engine version 12.0.40629.0
10>  [Microsoft .NET Framework, version 4.0.30319.42000]
10>  Copyright (C) Microsoft Corporation. All rights reserved.
10>  
10>  Build started 7/23/2017 2:37:56 PM.
10>  Project "C:\D\S4D\python-build\ALL_BUILD.vcxproj" on node 1 (default targets).
10>  Project "C:\D\S4D\python-build\ALL_BUILD.vcxproj" (1) is building "C:\D\S4D\python-build\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
10>  InitializeBuildStatus:
10>    Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
10>  CustomBuild:
10>    All outputs are up-to-date.
10>  FinalizeBuildStatus:
10>    Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
10>    Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
10>  Done Building Project "C:\D\S4D\python-build\ZERO_CHECK.vcxproj" (default targets).
10>  Project "C:\D\S4D\python-build\ALL_BUILD.vcxproj" (1) is building "C:\D\S4D\python-build\CMakeBuild\bdist_wininst\bdist_wininst.vcxproj" (3) on node 1 (default targets).
10>  InitializeBuildStatus:
10>    Creating "bdist_wininst.dir\Release\bdist_wininst.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
10>  CustomBuild:
10>    All outputs are up-to-date.
10>  ClCompile:
10>    All outputs are up-to-date.
10>  Link:
10>    All outputs are up-to-date.
10>    bdist_wininst.vcxproj -> C:\D\S4D\python-build\Lib\distutils\command\Release\wininst-12.0-amd64.exe
10>  PostBuildEvent:
10>    Description: bdist_wininst: Copying installer into 'Lib/distutils/command'
10>    setlocal
10>    "C:\Program Files\CMake\bin\cmake.exe" -E copy_if_different C:/D/S4D/python-build/Lib/distutils/command/Release/wininst-12.0-amd64.exe C:/D/S4D/python-build/Lib/distutils/command/wininst-12.0-amd64.exe
10>    if %errorlevel% neq 0 goto :cmEnd
10>    :cmEnd
10>    endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
10>    :cmErrorLevel
10>    exit /b %1
10>    :cmDone
10>    if %errorlevel% neq 0 goto :VCEnd
10>    :VCEnd
10>  FinalizeBuildStatus:
10>    Deleting file "bdist_wininst.dir\Release\bdist_wininst.tlog\unsuccessfulbuild".
10>    Touching "bdist_wininst.dir\Release\bdist_wininst.tlog\bdist_wininst.lastbuildstate".
10>  Done Building Project "C:\D\S4D\python-build\CMakeBuild\bdist_wininst\bdist_wininst.vcxproj" (default targets).
10>  Project "C:\D\S4D\python-build\ALL_BUILD.vcxproj" (1) is building "C:\D\S4D\python-build\CMakeBuild\extensions\extension_binascii\extension_binascii.vcxproj" (4) on node 1 (default targets).
10>  Project "C:\D\S4D\python-build\CMakeBuild\extensions\extension_binascii\extension_binascii.vcxproj" (4) is building "C:\D\S4D\python-build\CMakeBuild\libpython\libpython-shared.vcxproj" (5) on node 1 (default targets).
10>  InitializeBuildStatus:
10>    Creating "libpython-shared.dir\Release\libpython-shared.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
10>  CustomBuild:
10>    All outputs are up-to-date.
10>  ClCompile:
10>    All outputs are up-to-date.
10>    All outputs are up-to-date.
10>    All outputs are up-to-date.
10>  Link:
10>    All outputs are up-to-date.
10>    libpython-shared.vcxproj -> C:\D\S4D\python-build\bin\Release\python27.dll
10>  FinalizeBuildStatus:
10>    Deleting file "libpython-shared.dir\Release\libpython-shared.tlog\unsuccessfulbuild".
10>    Touching "libpython-shared.dir\Release\libpython-shared.tlog\libpython-shared.lastbuildstate".
10>  Done Building Project "C:\D\S4D\python-build\CMakeBuild\libpython\libpython-shared.vcxproj" (default targets).
10>  InitializeBuildStatus:
10>    Creating "extension_binascii.dir\Release\extensio.F36E4D0D.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
10>  CustomBuild:
10>    All outputs are up-to-date.
10>  ClCompile:
10>    All outputs are up-to-date.
10>  Link:
10>    All outputs are up-to-date.
10>    extension_binascii.vcxproj -> C:\D\S4D\python-build\Lib\lib-dynload\Release\binascii.pyd
10>  FinalizeBuildStatus:
10>    Deleting file "extension_binascii.dir\Release\extensio.F36E4D0D.tlog\unsuccessfulbuild".
10>    Touching "extension_binascii.dir\Release\extensio.F36E4D0D.tlog\extension_binascii.lastbuildstate".
10>  Done Building Project "C:\D\S4D\python-build\CMakeBuild\extensions\extension_binascii\extension_binascii.vcxproj" (default targets).
10>  Project "C:\D\S4D\python-build\ALL_BUILD.vcxproj" (1) is building "C:\D\S4D\python-build\CMakeBuild\extensions\extension_bz2\extension_bz2.vcxproj" (6) on node 1 (default targets).
10>  InitializeBuildStatus:
10>    Touching "extension_bz2.dir\Release\extension_bz2.tlog\unsuccessfulbuild".
10>  CustomBuild:
10>    All outputs are up-to-date.
10>  ClCompile:
10>    All outputs are up-to-date.
10>  Link:
10>    C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\D\S4D\python-build\Lib\lib-dynload\Release\bz2.pyd" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib "C:\D\S4D\bzip2-build\Release\libbz2.lib" ..\..\..\libs\Release\python27.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:"C:/D/S4D/python-build/Lib/lib-dynload/Release/bz2.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/D/S4D/python-build/libs/Release/bz2.lib" /MACHINE:X64   /machine:x64 /DLL extension_bz2.dir\Release\bz2module.obj
10>LINK : fatal error LNK1181: cannot open input file 'C:\D\S4D\bzip2-build\Release\libbz2.lib' [C:\D\S4D\python-build\CMakeBuild\extensions\extension_bz2\extension_bz2.vcxproj]
10>  Done Building Project "C:\D\S4D\python-build\CMakeBuild\extensions\extension_bz2\extension_bz2.vcxproj" (default targets) -- FAILED.

@jcfr, could you please have a look?

See also https://issues.slicer.org/view.php?id=4398

Thanks for the report. I will review and integrate the patch of @adamrankin tonight.

This should be fixed in

https://github.com/Slicer/Slicer/pull/751

Thanks @adamrankin and @lassoan for your suggestions, it was helpful to implement the fix.

Thank you, I’ve started a clean build with the patch.

1 Like

Unfortunately, it’s still broken - see details in the issue tracker.

Thanks for the report. I now have a local build with VS2013, i will report back shortly

This should now be fixed. I tested locally and I can successfully build python in Debug

@lassoan Would you mind updating your local checkout and giving an other try ?

https://github.com/Slicer/Slicer/pull/751

Fixed in r26174

1 Like