zoukankan      html  css  js  c++  java
  • Building Redis for use on Cygwin(转)

    This is the second time I have installed Redis for use on Cygwin in the last several months. It seems that each time the version numbers change, I step in a different hole. For those of you using Cygwin (DLL version 1.7.17-1) and Redis version 2.6.9, I hope to share my experience with you so that you can save some time.

    First, make sure that you have the “make” and “gcc” Cygwin packages installed. Then, open up a Cygwin terminal window and then download and extract Redis using the following commands:

    1
    2
    3
    4
    $ wget http://redis.googlecode.com/files/redis-2.6.9.tar.gz
    $ tar xzf redis-2.6.9.tar.gz
    $ cd redis-2.6.9
    $ cd src

    Then, within the src directory, add the following to the redis.h file:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    #ifdef __CYGWIN__
    #ifndef SA_ONSTACK
    #define SA_ONSTACK 0x08000000
    #endif
    #endif
      
    #if defined(__CYGWIN__)
    #define strtold(a,b)    ((long double)strtod((a),(b)))
    #endif

    I added the code above right before the “Data types” comment (Before line 312). The first five lines resolve the`SA_ONSTACK' undeclared error originally identified here. If you were to run make with this solution only, you would bump into the next error: undefined reference to `_strtold'. The last three lines address this error.

    Ignoring warnings, make will generate the following executables in the src directory:

    • redis-benchmark.exe
    • redis-check-aof.exe
    • redis-check-dump.exe
    • redis-cli.exe
    • redis-sentinel.exe
    • redis-server.exe

    Copy these files into Cygwin’s bin directory. To quickly test that Redis works, type in redis-server to start Redis with default options. In another Cygwin terminal window, start the Redis command line interface by typing redis-cli. At the prompt, simply type “ping“. If Redis is up and running, it should simply reply with “PONG“.

    Enjoy!

    http://blog.joshuawhite.com/open-source/building-redis-for-use-on-cygwin/

  • 相关阅读:
    Git原理与命令大全
    【网络安全】加解密算法最详解
    陪你阅读《区块链:从数字货币到信用社会》序一
    Splunk初识
    红帽学习记录[RHCE] ISCSI远程块储存
    DNS 域名系统与邮件服务器
    红帽学习记录[RHCE] 防火墙与网络合作
    红帽学习笔记[RHCE]网络配置与路由转发
    红帽学习笔记[RHCE]OpenLDAP 服务端与客户端配置
    红帽学习笔记[RHCSA] 第二周
  • 原文地址:https://www.cnblogs.com/softidea/p/5044059.html
Copyright © 2011-2022 走看看