如何在Windows上安装google snappy库?

时间:2016-12-10 08:34:38

标签: python c++ windows-8.1 snappy

我在Windows 8.1,Python 3.5上。

简短版本:我想通过pip安装镶木地板包。我被困在编译谷歌的snappy库。在Windows上编译snappy库应该采取哪些步骤?图书馆应该放在哪里?否则,是否有另一种使用python处理镶木地板的方法?

长版:

C:\Users\sdf>pip install parquet
Collecting parquet
  Using cached parquet-1.1-py3-none-any.whl
Collecting python-snappy (from parquet)
  Using cached python-snappy-0.5.tar.gz
Requirement already satisfied: thriftpy>=0.3.6 in c:\users\sdf\appdata\local\pr
ograms\python\python35-32\lib\site-packages (from parquet)
Requirement already satisfied: ply<4.0,>=3.4 in c:\users\sdf\appdata\local\prog
rams\python\python35-32\lib\site-packages (from thriftpy>=0.3.6->parquet)
Installing collected packages: python-snappy, parquet
  Running setup.py install for python-snappy ... error
    Complete output from command c:\users\sdf\appdata\local\programs\python\pyt
hon35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Data
\\AppData\\Local\\Temp\\pip-build-3o1be9ua\\python-snappy\\setup.py';f=getattr(t
okenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();e
xec(compile(code, __file__, 'exec'))" install --record C:\Users\sdf\AppData\Loc
al\Temp\pip-en53ikyp-record\install-record.txt --single-version-externally-manag
ed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.5
    copying snappy.py -> build\lib.win32-3.5
    running build_ext
    building '_snappy' extension
    creating build\temp.win32-3.5
    creating build\temp.win32-3.5\Release
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo
 /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\sdf\appdata\local\programs\python\python35
-32\include -Ic:\users\sdf\appdata\local\programs\python\python35-32\include "-
IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program F
iles (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\
Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8
.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\
Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tpsnappymodule.cc /Fo
build\temp.win32-3.5\Release\snappymodule.obj
    snappymodule.cc
    snappymodule.cc(31): fatal error C1083: Cannot open include file: 'snappy-c.
h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\B
IN\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "c:\users\sdf\appdata\local\programs\python\python35-32\python.exe -u -
c "import setuptools, tokenize;__file__='C:\\Users\\sdf\\AppData\\Local\\Temp\\
pip-build-3o1be9ua\\python-snappy\\setup.py';f=getattr(tokenize, 'open', open)(_
_file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file
__, 'exec'))" install --record C:\Users\sdf\AppData\Local\Temp\pip-en53ikyp-rec
ord\install-record.txt --single-version-externally-managed --compile" failed wit
h error code 1 in C:\Users\sdf\AppData\Local\Temp\pip-build-3o1be9ua\python-sna
ppy\

看到没有安装snappy库,我从google's snappy page

下载了它

我现在有了这些文件,必须尝试编译和安装它们。我注意到包含autogen.sh脚本。

由于这是Windows,我使用mingw64 shell来执行autogen.sh。然后它返回此错误

./autogen.sh: line 3: aclocal: command not found

好的,所以我发现aclocal是automake的一部分,我也必须安装它。

我使用页面上的两个设置文件下载并安装了automake here(一个用于源,一个用于除源之外的所有其他内容)

现在我安装了automake,但仍然有同样的错误:

./autogen.sh: line 3: aclocal: command not found

接下来,我决定尝试用Cygwin编译库。所以我下载了它,添加了一些开发包,包括automake和gcc,将snappy tarball提取到我的工作目录中,并运行bash autogen.sh

$ bash autogen.sh
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ([^ \t=:+{}]+)}/ at /usr/bin/automake-1.14 line 3930.
/usr/share/automake-1.14/am/ltlibrary.am: warning: 'libsnappy.la': linking libtool libraries using a non-POSIX
/usr/share/automake-1.14/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac'
Makefile.am:4:   while processing Libtool library 'libsnappy.la'

没有破坏,文件configure已创建。所以我跑了$ ./configure。这是输出。

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking build system type... x86_64-unknown-cygwin
checking host system type... x86_64-unknown-cygwin
checking how to print strings... printf
checking for style of include used by make... none
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... none
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/x86_64-pc-cygwin/bin/ld.exe
checking if the linker (/usr/x86_64-pc-cygwin/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 8192
checking how to convert x86_64-unknown-cygwin file names to x86_64-unknown-cygwin format... func_convert_file_noop
checking how to convert x86_64-unknown-cygwin file names to toolchain format... func_convert_file_noop
checking for /usr/x86_64-pc-cygwin/bin/ld.exe option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-pc-cygwin/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... none
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/x86_64-pc-cygwin/bin/ld.exe
checking if the linker (/usr/x86_64-pc-cygwin/bin/ld.exe) is GNU ld... yes
checking whether the g++ linker (/usr/x86_64-pc-cygwin/bin/ld.exe) supports shared libraries... yes
checking for g++ option to produce PIC... -DDLL_EXPORT -DPIC
checking if g++ PIC flag -DDLL_EXPORT -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/x86_64-pc-cygwin/bin/ld.exe) supports shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether byte ordering is bigendian... no
checking for size_t... yes
checking for ssize_t... yes
checking for stdint.h... (cached) yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking windows.h usability... yes
checking windows.h presence... yes
checking for windows.h... yes
checking byteswap.h usability... yes
checking byteswap.h presence... yes
checking for byteswap.h... yes
checking sys/byteswap.h usability... no
checking sys/byteswap.h presence... no
checking for sys/byteswap.h... no
checking sys/endian.h usability... no
checking sys/endian.h presence... no
checking for sys/endian.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for mmap... yes
checking for 'gtest-config'... checking for gtest-config... no
no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for gflags... no
checking if the compiler supports __builtin_expect... yes
checking if the compiler supports __builtin_ctzll... yes
checking for zlibVersion in -lz... no
checking for lzo1x_1_15_compress in -llzo2... no
checking for lzf_compress in -llzf... no
checking for fastlz_compress in -lfastlz... no
checking for qlz_compress in -lquicklz... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating snappy-stubs-public.h
config.status: creating snappy.pc
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

接下来我跑了make,但它没有用。

我无法为snappy编译库,所以我坚持使用镶木地板。

如何在Windows中设置库?

0 个答案:

没有答案