Skip to content

Commit

Permalink
Update README.md and Improvements of Installation Steps.
Browse files Browse the repository at this point in the history
  • Loading branch information
juliocspires committed Mar 2, 2017
1 parent bb29969 commit 9d51cb0
Showing 1 changed file with 40 additions and 29 deletions.
69 changes: 40 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ The API and implementation make use of modern C++ 11 and new asynchronous idioms
**Autobahn**|Cpp supports running WAMP (`rawsocket-msgpack`) over **TCP(-TLS)**, **Unix domain sockets** or **pipes** (`stdio`). The library is "header-only", light-weight (< 2k code lines) and **depends on** the following:

* C++11 compiler
* [`boost::future`](http://www.boost.org/doc/libs/1_56_0/doc/html/thread/synchronization.html#thread.synchronization.futures)
* [`boost::asio`](http://www.boost.org/doc/libs/1_56_0/doc/html/boost_asio.html)
* [msgpack-c](https://github.com/msgpack/msgpack-c)
* [`boost::future`](http://www.boost.org/doc/libs/1_63_0/doc/html/thread/synchronization.html#thread.synchronization.futures)
* [`boost::asio`](http://www.boost.org/doc/libs/1_63_0/doc/html/boost_asio.html)
* [`msgpack-c`](https://github.com/msgpack/msgpack-c)
* [`WebSocket++`](https://github.com/zaphoyd/websocketpp)

For getting help, questions or feedback, get in touch on the **[mailing list](https://groups.google.com/forum/#!forum/autobahnws)**, **[Twitter](https://twitter.com/autobahnws)** or **IRC `#autobahn`** (Freenode).

Expand Down Expand Up @@ -88,7 +89,7 @@ Here is JavaScript running in Chrome call into C++ running on command line. Both
![](doc/_static/cpp_from_js.png)

* [Example C++ code](https://github.com/crossbario/autobahn-cpp/blob/master/examples/register2.cpp)
* [Example JavaScript code](https://github.com/crossbario/autobahn-cpp/blob/master/examples/index.html)
* [Example JavaScript code](https://github.com/crossbario/autobahn-cpp/blob/master/examples/web/index.html)


## Examples
Expand Down Expand Up @@ -143,31 +144,32 @@ update-alternatives: /usr/bin/clang++ wird verwendet, um /usr/bin/c++ (c++) im m

### Boost

Most of the time, your distro's Boost libraries will be outdated (unless you're using Arch or Homebrew). Don't waste time with those: to build the latest Boost 1.60 (current release as of 2016/01) from sources
Most of the time, your distro's Boost libraries will be outdated (unless you're using Arch or Homebrew). Don't waste time with those: to build the latest Boost 1.63 (current release as of 2016/12) from sources.

Get Boost 1.63:
```console
cd ~
wget http://downloads.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.bz2
tar xvjf boost_1_60_0.tar.bz2
cd boost_1_60_0
wget https://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.tar.bz2
tar xvjf boost_1_63_0.tar.bz2
cd boost_1_63_0
```
To build using Clang:
```console
./bootstrap.sh --with-toolset=clang
./b2 toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" -j 4
```

> Note: The `-j 4` option will allow use of 4 cores for building.
>
To build using GCC instead of Clang:

To build using GCC:
```console
./bootstrap.sh --with-toolset=gcc
./b2 toolset=gcc -j 4
./b2 toolset=gcc -j 4 install --prefix=/usr/local
```

Then add the following to your `~/.profile`:
> Note: The `-j 4` option will allow use of 4 cores for building.
Then add the following to your `~/.profile` or `~/.bashrc`:

```shell
export BOOST_ROOT=${HOME}/boost_1_60_0
export BOOST_ROOT=${HOME}/boost_1_63_0
export LD_LIBRARY_PATH=${BOOST_ROOT}/stage/lib:${LD_LIBRARY_PATH}
```

Expand All @@ -179,22 +181,23 @@ Get [MsgPack-C](https://github.com/msgpack/msgpack-c) and install:
cd ~
git clone https://github.com/msgpack/msgpack-c.git
cd msgpack-c
git checkout cpp-1.4.0
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
export CXXFLAGS="$CXXFLAGS -std=c++11"
./bootstrap
./configure --prefix=$HOME/msgpack_clang
git checkout cpp-1.4.2
cmake -DMSGPACK_CXX11=ON .
make install
```

> On FreeBSD, you need to `pkg install autotools` and invoke `gmake` instead of `make`.
Then add the following to your `~/.profile`:
### WebSocket++

```shell
export MSGPACK_ROOT=${HOME}/msgpack_clang
export LD_LIBRARY_PATH=${MSGPACK_ROOT}/lib:${LD_LIBRARY_PATH}
Get [WebSocket++](https://github.com/zaphoyd/websocketpp) and install:

```console
cd ~
https://github.com/zaphoyd/websocketpp.git
cd websocketpp
cmake .
make
make install
```

### **Autobahn**|Cpp
Expand All @@ -204,12 +207,19 @@ To get **Autobahn**|Cpp library and examples, clone the repo
```console
cd $HOME
git clone https://github.com/crossbario/autobahn-cpp.git
cd autobahn
cd autobahn-cpp
cp -r ../autobahn/ /usr/local/include/
```

The library is "header-only", means there isn't anything to compile or build. Just include the relevant headers.

## Examples

```console
apt-get install scons
cd $HOME/autobahn-cpp/examples
scons
```
## Documentation

[Click here](http://autobahn.ws/cpp/reference/) for the Autobahn|Cpp reference documentation.
Expand Down Expand Up @@ -241,3 +251,4 @@ Get in touch on IRC `#autobahn` on `chat.freenode.net`, follow us on [Twitter](h
* `[=, &foo]` Capture any referenced variable by making a copy, but capture variable `foo` by reference
* `[bar]` Capture `bar` by making a copy; don't copy anything else
* `[this]` Capture the this pointer of the enclosing class

0 comments on commit 9d51cb0

Please sign in to comment.