Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
hjk41 committed Sep 12, 2020
1 parent 6b6a963 commit 38d13c7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,47 @@ Current implementation uses C++14, so you need a new compiler to compile the cod

Tested on both Linux and Windows (Visual Studio 2019).


Compiling Test
=======

test/test.cpp is a simple test demonstrating how to use Remmy. You can compile it with `CMake`, `make`, or `Visual Studio`.

**Compiling With CMake**

To compile with `CMake`, use the following command:
```bash
user@myhost:~/projects/Remmy$ mkdir build
user@myhost:~/projects/Remmy$ cd build
user@myhost:~/projects/Remmy/build$ cmake .. -DCOMM_LAYER=ASIO
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- ...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/projects/Remmy/build
user@myhost:~/projects/Remmy/build$ make
Scanning dependencies of target remmy_test
[ 50%] Building CXX object CMakeFiles/remmy_test.dir/test/test.cpp.o
[100%] Linking CXX executable remmy_test
[100%] Built target remmy_test
```

Note that we use `-DCOMM_LAYER=ASIO` option for `CMake` here. Remmy supports ASIO and ZMQ. Here we choose ASIO as the communication layer.

If you want to use ZeroMQ, you also need to install libzmq.

**Compiling With `make`**

There is a Makefile under `Remmy/test`, which can be used to compile the test. The communication can be switched by defining the `USE_ASIO` or `USE_ZMQ` at the top of the Makefile.

**Building With VS 2017/2019**

`Remmy/remmy.sln` is a VS 2019 solution file. You can use VS 2019 to open the solution and compile the test project. However, if you choose to use VS 2017, you need to retarget the solution before you can build it. To retarget the solution, open it and right-click on the `Solution 'Remmy'` in `Solution Explorer`, then choose `Retarget Solution`. In the pop-up windows, choose `latest installed version` for `Windows SDK Version`.

By default the solution uses ASIO as the communication layer. Switching to ZeroMQ requires defining `USE_ZMQ` and `USE_ASIO` macros in project properties. You will also need to specify the location to ZeroMQ library when using ZeroMQ.


Programming interface
=======

Expand Down Expand Up @@ -65,6 +106,7 @@ public:
Please refer to [/test/test.cpp](/test/test.cpp) for an example on how to use Remmy.
Contributing
=======
Everyone is welcome to contribute to this project, either to improve the code or documentation.
Expand Down
2 changes: 1 addition & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ifeq ($(USE_ZMQ), 1)
LDFLAGS += -lzmq -L../deps/zmq
endif

test: test.cpp ../remmy/*.h Makefile
remmy_test: test.cpp ../remmy/*.h Makefile
g++ test.cpp -o test $(CXXFLAGS) $(LDFLAGS)

clean:
Expand Down

0 comments on commit 38d13c7

Please sign in to comment.