-->
Zlib provides access to compressed PNGs Starting with Pillow 3.0.0, zlib is required by default, but may be disabled with the -disable-zlib flag. Libtiff provides compressed TIFF functionality.
Creating a zlib/libzip compression library for CNTK
We use the following installation paths in our instructions:
- libzip sources:
c:localsrclibzip-1.1.3
- zlib sources:
c:localsrczlibzlib-1.2.8
- Build directory for zlib and libzip binaries:
c:localzlib-vs17
You can use any paths you like, but note the remark on target folder for binaries below.
- Install CMake. Include CMake binaries folder to your
PATH
- Download libzip source code and unpack to
c:localsrclibzip-1.1.3
- Download zlib source code and unpack it to
c:localsrczlibzlib-1.2.8
There are two ways to build the lib/libzip compression library for CNTK, either through a batch file or manually.
Building through a batch file
In the directory
ToolsdevInstallWindows
you find the batch file buildZlibVS17.bat
. This batch file takes three parameters to build the CNTK Protobuf library. The first parameter is the directory of the libzip
source files you unpacked above, the second parameter is the directory of the zlib
source files,the third parameter is the destination directory for the created library. In our case follow these steps from a standard Windows command prompt:Set the environment variable
ZLIB_PATH
to the location of the created library (this is the third parameter in the command invocation above, not the sources location!Manual build steps for a CNTK compression library
The following aspects are important:
- Build commands for zlib and libzip should use the same target folder for binaries (specified via
-DCMAKE_INSTALL_PREFIX
parameter incmake
command below) - Build order is important. You should build zlib first because libzip is dependent on it
Command prompt environment for build
Note
If
VS2017INSTALLDIR
environment variable was not set by the Visual Studio installer, set it manually. The exact installation directory depends on both the version (2017 in this case) and offering (Community, Enterprise, etc) of Visual Studio, according to the following pattern: C:Program Files (x86)Microsoft Visual Studio<version><offering>
.For Visual Studio 2017 Enterprise edition, run:
For Visual Studio 2017 Community edition, run:
Launch a 64-bit Visual Studio 2017 development environment. The most convenient way is to execute the batch file
vcvarsall.bat
in the Visual Studio directory with the required parameters from a standard windows command shell:If you can't find this batch file on your system, please revisit the installation of VS2017, and make sure you have the 'VC++ version 15.4 v14.11 toolset' option selected.
Building zlib
Execute the following commands from VS2017 x64 Native Tools Command Prompt:
Building libzip
Execute the following commands from VS2017 x64 Native Tools Command Prompt:
MSBuild command above may generate some warnings. It is expected and may be ignored.
The last
cmake
command from the list above will generate the following error:It is expected and may be ignored - all required binaries (
zip.dll
and zlib.dll
) should be already in c:localzlib-vs17
Preparing the environment
Set the following environment variable:
Hello @horta, thanks for your work to help make this installation easier. While I'm not new to computers, I am newer to this type of stuff. I'm installing this for use with a python script for RealTerrain by MarcoPolo to make a 3D terrain model and get this error:
Traceback (most recent call last):
File 'real-terrain.py', line 11, in
from PIL import Image
ModuleNotFoundError: No module named 'PIL'
File 'real-terrain.py', line 11, in
from PIL import Image
ModuleNotFoundError: No module named 'PIL'
So I figured out I need to install an imaging library and stumbled across this. I clearly don't have everything set up properly. I think I added everything I need to windows PATH and got cmake installed, but it seems I'm still getting errors:
Fetching https://zlib.net/zlib1211.zip
Downloading https://zlib.net/zlib1211.zip... Exception calling 'DownloadFile' with '2' argument(s): 'An exception occurred during a WebClient request.'
At line:10 char:1
Downloading https://zlib.net/zlib1211.zip... Exception calling 'DownloadFile' with '2' argument(s): 'An exception occurred during a WebClient request.'
At line:10 char:1
- (New-Object Net.WebClient).DownloadFile('https://zlib.net/zlib1211.zi ...
done.
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:4 (project):
Generator
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:4 (project):
Generator
does not support platform specification, but platform
was specified.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also 'F:/Python/zlib.install-master/zlib-1.2.11/build/CMakeFiles/CMakeOutput.log'.
-- Configuring incomplete, errors occurred!
See also 'F:/Python/zlib.install-master/zlib-1.2.11/build/CMakeFiles/CMakeOutput.log'.
Any help would be greatly appreciated.
Thanks for your time!
Thanks for your time!