-
Notifications
You must be signed in to change notification settings - Fork 57
All in one wiselib and shawn installation and integration
This tutorial was created to help programmers and mostly users to use Wiselib and shawn. Although this repo is about wiselib, shawn is a powerful simulator that helps a lot when you want to simulate algorithms you create in wiselib, thus installation and configuration guide is included. The tutorial is based on the following outdated guides:
- https://github.com/CEID-DS/cbox/wiki/Installing-Wiselib-%26-shawn
- https://github.com/ibr-alg/wiselib/wiki/Direct-integration-shawn-application
- https://github.com/ibr-alg/wiselib/wiki/Config-files
- http://www.ceid.upatras.gr/courses/katanemhmena/ds2/images/files10-11/wiselib.pdf (in greek)
Although this guide was tested under lubuntu environment, it should work for any linux based machine(and also in windows under cygwin but it's not recommended). You should have installed git and svn. In debian based distros you can install them by typing:
sudo apt-get install git subversion
- Download wiselib:
git clone https://github.com/ibr-alg/wiselib.git
- Download shawn:
svn co https://shawn.svn.sourceforge.net/svnroot/shawn
- The rest assume that you have downloaded wiselib and shawn in folder /home/<username>/wiselib and /home/<username>/shawn respectively. If its not the case, please change the commands bellow approprietly.
- Copy std_config.h to config.h
cp ~/wiselib/wiselib.stable/std_config.h ~/wiselib/wiselib.stable/config.h
- Copy std_config_testing.h to config_testing.h
cp ~/wiselib/wiselib.testing/std_config_testing.h ~/wiselib/wiselib.testing/config_testing.h
- Copy wiselib/apps/generic_apps/Makefile.template to wiselib/apps/generic_apps/Makefile.local
cp ~/wiselib/apps/generic_apps/Makefile.template ~/wiselib/apps/generic_apps/Makefile.local
- Edit the wiselib/apps/generic_apps/Makefile.local: Set the WISELIB_BASE and the SHAWN_INCLUDE_DIR to the correct full paths and change the SHAWN_LINK_LIBS
pico wiselib/apps/generic_apps/Makefile.local
export WISELIB_BASE=/home/<username>/wiselib
...
export SHAWN_INCLUDE_DIR=/home/<username>/shawn
...
export SHAWN_LIB_DIR=$(SHAWN_INCLUDE_DIR)/libraries
...
#Small example with only basic libs
#export SHAWN_LINK_LIBS=-rdynamic -lshawnlib -llegacyapps -lapps_exampleslib \
-lapps_externalapplib -lshawnlib \
-ldl
...
#Full example with most libs
export SHAWN_LINK_LIBS=-rdynamic -lshawnlib -lapps_wiseliblib -lapps_topologylib -lapps_readinglib \
-lapps_testbedservicelib -lapps_exampleslib -lapps_externalapplib -lshawnlib \
-ldl -lboost_date_time-mt -lboost_thread-mt -lapps_wisemllib
- Now you should be able to use wiselib. Keep in mind that we have not set up shawn yet. To test that wiselib works navigate to apps/pc_apps/timer_test and hit make. Then by running timer_test you should receive "It's time!" message.
- As of 25-03-2012 there was a tiny bug in the file apps/pc_apps/Makefile.base. Make sure in that file that there is:
WISELIB_PATH=../../..
- If you don't indent to use shawn you can skip this part
- Create a folder libraries under shawn directory
mkdir ~/shawn/libraries
- Goto the shawn/buildfiles directory
cd ~/shawn/buildfiles
- Execute: ccmake ../src
- Type c
- Check the status of the following features:
BUILD_LIB_WITH_MAIN ON
BUILD_SINGLE_LIB OFF
CONFIGURE_APPS ON
- Type c
- Check the status of the following features:
MODULE_APPS_EXAMPLES ON
MODULE_APPS_EXTERNAL_APPLICATION ON
MODULE_APPS_READINGS ON
MODULE_APPS_TOPOLOGY ON
MODULE_APPS_WISELIB ON
OPT_ENABLE_SHAWN_REALTIME ON
- Type c
- Set INCLUDE_PATH_WISELIB_STABLE and INCLUDE_PATH_WISELIB_TESTING to the full path of your wiselib/wiselib.stable and wiselib/wiselib.testing directories
INCLUDE_PATH_WISELIB_STABLE=/home/<username>/wiselib/wiselib.stable
INCLUDE_PATH_WISELIB_TESTING=/home/<username>/wiselib/wiselib.testing
LIBRARY_OUTPUT_PATH=/home/<username>/shawn/libraries
- Type c & g
- Execute: make
First of all, the Wiselib module must be added to Shawn. Since it is not yet part of the official Shawn release, it must be added as a legacy application (described in Shawn Wiki). Basically, this only requires three steps:
- Create a folder where your Shawn legacy applications should be located (for instance, at shawn/src/legacyapps - in parallel to the existing apps and sys directories)
mkdir ~/shawn/src/legacyapps
- Copy legacyapps_init.h and legacyapps.cpp to this newly created folder
wget http://www.ibr.cs.tu-bs.de/users/tbaum/wiselib/legacyapps_init.h http://www.ibr.cs.tu-bs.de/users/tbaum/wiselib/legacyapps_init.cpp
- Go to shawn/buildfiles, call ccmake ../src, and set LEGACYAPPS_PATH
LEGACYAPPS_PATH=/home/<username>/shawn/src/legacyapps
Once the legacyapps folder is created, you can add Wiselib Shawn examples. Optionally (but recommended) check out
git clone https://github.com/ibr-alg/wiselib/tree/master/apps/shawn_apps/wiselib_examples
Afterward, the directory structure should look as follows:
shawn/src/legacyapps/wiselib_examples
Test that your installation works, compile a test wiselib application for shawn:
- Goto the wiselib/apps/generic_apps/example_app
cd wiselib/apps/generic_apps/example_app
- Type make shawn
make shawn
- Execute: ./example_app -f test.conf (The default processor when you build with target shawn is wiselib_shawn_standalone)
./example_app -f test.conf