Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 190 lines (119 sloc) 5.814 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
Apache CouchDB README.Windows
==============================

For a high-level guide to Microsoft Windows.

Dependencies
------------

You will need the following installed:

 * Erlang OTP (=14B01) (http://erlang.org/)
 * ICU (http://icu.sourceforge.net/)
 * OpenSSL (http://www.openssl.org/)
 * Mozilla SpiderMonkey (1.8) (https://github.com/couchbase/spidermonkey)
 * libcurl (http://curl.haxx.se/libcurl/)
 * Cygwin (http://www.cygwin.com/)
 * Visual Studio 2008 (http://msdn.microsoft.com/en-gb/vstudio/default.aspx)
 * Windows .NET Framework 4 (http://msdn.microsoft.com/en-us/netframework/aa569263)

General Notes
-------------

 * For Windows + Cygwin, when installing Erlang, you must build it from source.

   The CouchDB build makes use of a number of the Erlang build scripts.

 * For Windows + MinGW + MSYS, you should copy your Erlang setup to a temp directory
   and use it to build your Couchdb application.

 * When installing ICU, select the binaries built with Visual Studio 2008.
   Please select icu4c-4_2_1-Win32-msvc9.zip even though the latest one is 4.6

 * When installing Cygwin, be sure to select all the `development` tools.
   It is not needed on Windows + MinGW + Msys environemnt.

 * When installing libcurl, be sure to install by hand.

   The Cygwin binaries are incompatible and will not work with Erlang.

Setting Up Cygwin (Skip the step on minGW environment)
-----------------

Before starting any Cygwin terminals, run:

    set CYGWIN=nontsec

To set up your environment, run:

    [VS_BIN]/vcvars32.bat

Replace [VS_BIN] with the path to your Visual Studio `bin` directory.

You must check that:

    * The `which link` command points to the Microsoft linker.

    * The `which cl` command points to the Microsoft compiler.

    * The `which mc` command points to the Microsoft message compiler.

    * The `which mt` command points to the Microsoft manifest tool.

If you do not do this, the build may fail due to Cygwin ones found in `/usr/bin`
being used instead.

Building Erlang (Skip the step on minGW environment)
---------------

You must include Win32 OpenSSL.

However, you can skip the GUI tools by running:

   echo "skipping gs" > lib/gs/SKIP

   echo "skipping ic" > lib/ic/SKIP

Follow the rest of the Erlang instructions as described.

After running:

   ./otp_build release -a

You should run:

   ./release/win32/Install.exe

This will set up the release/win32/bin directory correctly.

To set up your environment for building CouchDB, run:

    eval `./otp_build env_win32`

To set up the `ERL_TOP` environment variable, run:

    export ERL_TOP=[ERL_TOP]

Replace `[ERL_TOP]` with the Erlang source directory name.

Remember to use `/cygdrive/c/` instead of `c:/` as the directory prefix.

To set up your path, run:

    export PATH=$ERL_TOP/release/win32/erts-5.8.2/bin:$PATH

If everything was successful, you should be ready to build CouchDB.

Relax.

Clone Erlang setup (only needed on minGW environement)
-----------------------------------------------------
The CouchDB build makes use of a number of the Erlang build scripts.
You can clone an existed Erlang setup to a temp directory for build purpose.
For example, run the following command
c:\> xcopy /e c:/erl5.7.4 c:/temp/couch_dist

Build Mozilla SpiderMonkey
--------------------------
You need MozillaBuild to build spidermonkey successfully. You can get it from
http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe

After the prerequisites are installed, launch one of the following batch files from the c:\mozilla-build directory:
start-msvc8.bat (VS 2005)
start-msvc9.bat (VS 2008)
start-msvc10.bat (VS 2010)

On Windows7 platform, you need to clone the ref-config\WINNT6.0.mk as ref-config\WINNT6.1.mk in order to build.

Building CouchDB
----------------

Once you have satisfied the dependencies you should run:

on Cygwin
    ./configure \
        --with-js-include=/cygdrive/c/path_to_spidermonkey_include \
        --with-js-lib=/cygdrive/c/path_to_spidermonkey_lib \
        --with-win32-icu-binaries=/cygdrive/c/path_to_icu_binaries_root \
        --with-erlang=$ERL_TOP/release/win32/usr/include \
        --with-win32-curl=/cygdrive/c/path/to/curl/root/directory \
        --with-openssl-bin-dir=/cygdrive/c/openssl/bin \
        --with-msvc-redist-dir=/cygdrive/c/dir/with/vcredist_platform_executable \
        --prefix=$ERL_TOP/release/win32

This command could take a while to complete.

On minGW + MSYS
    ./configure \
        --with-js-include=/c/devtest/spidermonkey/dist/include \
        --with-js-lib=/c/devtest/spidermonkey/dist/lib \
        --with-win32-icu-binaries=/c/icu4c-4_2_1-Win32-msvc9/icu \
        --with-erlang=/c/erl5.7.4/usr/include \
        --with-win32-curl=/c/dev/grommit/curl-7.20.1 \
        --with-msvc-redist-dir=/c/erl5.7.4/vcredist_x86.exe \
        --with-msbuild-dir=/c/Windows/Microsoft.NET/Framework/v4.0.30319
        --prefix=/c/temp/couch_dist

If everything was successful you should see the following message:

    You have configured Apache CouchDB, time to relax.

Relax.

To install CouchDB you should run:

    make install

If everything was successful you should see the following message:

    You have installed Apache CouchDB, time to relax.

Relax.

First Run
---------

You can start the CouchDB server by running:

    $ERL_TOP/release/win32/bin/couchdb.bat

When CouchDB starts it should eventually display the following message:

    Apache CouchDB has started, time to relax.

Relax.

To check that everything has worked, point your web browser to:

    http://127.0.0.1:5984/_utils/index.html

From here you should run the test suite in either Firefox 3.6+ or Safari 4+.
Something went wrong with that request. Please try again.