Skip to content

Installation

Fortunate-MAN edited this page Oct 9, 2016 · 14 revisions

This bot is dependent on the OS you're running on, and uses Linux specific libraries. So if you're on any other OS than Linux or Mac, it's unlikely the bot will run.

#Linux

To run this program, you need to either have gcc or clang installed. If you have them installed you can skip to the next part. If you do not have them installed, here's what you have to do if you're on Ubuntu/Debian:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-<version>

Just run the above commands, and put the version you want to be installed in place of <version>.

For installing gcc on OpenSuse, do:

sudo zypper install gcc

Now to the next step. This program uses libwebsockets, and libCURL, which is normally not installed in a linux computer. To install them, do:

apt-get install libcurl-dev

This will show you some versions of libCURL you can install. Choose one of them, and continue.

To install libwebsockets, do:

apt-get install libwebsockets-dev

After you've installed all this, you can compile the bot. So simply run the makefile or do:

gcc chatbot/*.c -lcurl -lwebsockets -lpthread -lm -o firealarm

Note that you shouldn't have any more C files in the folder you've kept the chatbot, other than the files in the repo. If there are, you should take all the chatbot's files to another folder, or replace *.c with the names of the files.

If it compiles successfully, run the executable (firealarm).

#OS X

To build, you need to have Xcode and libwebsockets installed. You can install Xcode from the Mac App Store, and you can install libwebsockets with Homebrew:

brew install libwebsockets

If the above command gives an error complaining that the brew command does not exist, try installing Homebrew from brew.sh.

Then, build using the provided Xcode project, or follow the Linux compile instructions to compile with Clang.

Clone this wiki locally