We've launched our new site at www.openlighting.org. This wiki will remain and be updated with more technical information.
Difference between revisions of "OLA on Linux"
From wiki.openlighting.org
(→Checkout or Download an Archive) |
Mcallegari79 (talk | contribs) m (Removed fixed packages versions, as -dev packages automatically install the latest available) |
||
(38 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
− | This describes how to get [[OLA]] working on a Linux system either from the git repo or by using a [ | + | This describes how to get [[OLA]] working on a Linux system either from the git repo or by using a [https://github.com/OpenLightingProject/ola/releases released tarball]. |
− | + | =Install dependencies = | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | =Install | ||
You need a couple of libraries installed for everything to work correctly. Some of these are available as packages in distros but others need to be downloaded and built manually. | You need a couple of libraries installed for everything to work correctly. Some of these are available as packages in distros but others need to be downloaded and built manually. | ||
− | First | + | First you'll need at least the following: |
* cppunit | * cppunit | ||
* uuid or ossp uuid | * uuid or ossp uuid | ||
* pkg-config | * pkg-config | ||
* curses | * curses | ||
− | + | * lex (or flex) | |
− | + | * yacc (or bison) | |
− | + | * the protocol buffers library [http://code.google.com/p/protobuf/ http://code.google.com/p/protobuf/] (version 2.3.0 or later) | |
− | + | * microhttpd [ftp://ftp.gnu.org/gnu/libmicrohttpd/ ftp://ftp.gnu.org/gnu/libmicrohttpd/] (if you want the web UI). You need version >= 0.4.0 of microhttpd | |
− | + | * avahi [http://www.avahi.org] if you want discovery enabled. | |
If you're building from git you'll also need the following: | If you're building from git you'll also need the following: | ||
Line 30: | Line 22: | ||
* autoconf | * autoconf | ||
− | + | == Debian / Ubuntu == | |
+ | There is a fully packaged version of OLA you can just install, for info see [[OLA Debian / Ubuntu]]. There's also a more specific Ubuntu walkthrough for building [[The Newbie Guide for OLA on Ubuntu]]. | ||
+ | |||
+ | Debian/Ubuntu users can install them with apt: | ||
+ | sudo apt-get install libcppunit-dev uuid-dev pkg-config libncurses5-dev libtool autoconf automake g++ libmicrohttpd-dev \ | ||
+ | libmicrohttpd10 protobuf-compiler python-protobuf libprotobuf-dev libprotoc-dev zlib1g-dev bison flex make libftdi-dev libftdi1 libusb-1.0-0-dev liblo-dev libavahi-client-dev | ||
− | + | Note: Some distributions may offer libprotobuf-lite6 instead of libprotobuf-lite7, which is an acceptable substitution. | |
− | + | If you're using Ubuntu 12.04 or later you can just use the command above. In earlier versions of Ubuntu the version of libprotobuf is too old, so you'll need to install them by hand. You may also need to install an older version of libmicrohttpd (libmicrohttpd9 rather than libmicrohttpd10). | |
− | |||
+ | == Centos 6 / RHEL 6 / Fedora 17 == | ||
+ | Users of rpm based distributions can install them with yum (protobuf*, libmicrohttpd* and libftdi* are in the EPEL repository): | ||
− | + | sudo yum install flex bison protobuf protobuf-devel uuid-devel cppunit-devel protobuf-python libmicrohttpd-devel libusb-devel libftdi-devel libuuid-devel openslp-devel | |
− | |||
− | |||
− | + | (The remaining libs already come with the OS installation) | |
+ | |||
+ | == Other Distributions == | ||
+ | |||
+ | Install using your package manager, or build everything by hand | ||
+ | |||
+ | If you installed things by hand (rather than using your package manager), you need to run ldconfig as root to pick up the new libraries | ||
sudo ldconfig | sudo ldconfig | ||
− | = | + | =Checkout or Download an Archive= |
+ | |||
+ | You can either download a tarball, or pull the latest version from the git repo | ||
+ | |||
+ | == Tarball == | ||
− | + | Download the most recent tarball from https://github.com/OpenLightingProject/ola/releases | |
+ | Extract using | ||
− | + | tar -zxf ola-0.X.Y.tar.gz | |
+ | cd ola-0.X.Y | ||
− | + | == Git == | |
− | + | If you don't have '''git''' yet, you'll need to install it with your distro's package manager. On Debian / Ubuntu run: | |
− | + | sudo apt-get install git | |
− | |||
− | |||
+ | Check out the git repo with the following command: | ||
+ | |||
+ | git clone https://github.com/OpenLightingProject/ola.git ola | ||
+ | cd ola | ||
+ | |||
+ | {{ MacOLABuild }} | ||
+ | |||
+ | Finally run ldconfig so you can use the new libraries. | ||
+ | |||
+ | sudo ldconfig | ||
+ | |||
+ | =Device drivers= | ||
+ | Note that, for some devices, it is necessary to install drivers for OLA to work with them. For example, the [[Open DMX USB]] device needs an additional kernel module that could be built using the instuctions on [[LLA_and_Q_Light_Controller_Ubuntu_Tutorial]]. For other devices, refer to the corresponding device page on this wiki. | ||
+ | |||
+ | =Known Issues= | ||
If you get an error like the following: | If you get an error like the following: | ||
Line 82: | Line 103: | ||
and then start from the autoreconf step again. | and then start from the autoreconf step again. | ||
− | + | If you should get the following error try to fix it with one of [http://groups.google.com/group/open-lighting/msg/72060f6327d30df6 two available solutions]: | |
− | + | ||
+ | Rpc.pb.cc: In copy constructor 'ola::rpc::RpcMessage::RpcMessage(const ola::rpc::RpcMessage&)': | ||
+ | Rpc.pb.cc:143: error: base class 'class google::protobuf::Message' should be explicitly initialized in the copy constructor | ||
− | + | You should be able to prevent this by [http://groups.google.com/group/open-lighting/msg/c6d86d03dd74ed5b editing <code>./src/Makefile.am</code>], removing <code>-Werror</code> and then start from the autoreconfig step again. | |
− | + | ||
− | + | =Optional= | |
− | = | + | ==Doxygen Documentation== |
+ | There is also an option to build the doxygen documentation! To do so you will need to install [http://www.stack.nl/~dimitri/doxygen/manual/install.html doxygen]. | ||
− | + | Once you have installed Doxygen you may need to run ./configure in your ola directory, so that it can generate the correct make file. To build the docs just use: | |
− | + | make doxygen-doc | |
− | + | You'll have to run a webserver to get the experience. A simple way to do this is to navigate to open-lighting/html and run: | |
− | + | python -m SimpleHTTPServer | |
− | |||
− | |||
− | |||
− | + | This opens a web server at your local IP address on port 8000. I can be accessed through 127.0.0.1:80000 on your local machine as well. |
Latest revision as of 02:33, 23 December 2016
This describes how to get OLA working on a Linux system either from the git repo or by using a released tarball.
Contents
Install dependencies
You need a couple of libraries installed for everything to work correctly. Some of these are available as packages in distros but others need to be downloaded and built manually.
First you'll need at least the following:
- cppunit
- uuid or ossp uuid
- pkg-config
- curses
- lex (or flex)
- yacc (or bison)
- the protocol buffers library http://code.google.com/p/protobuf/ (version 2.3.0 or later)
- microhttpd ftp://ftp.gnu.org/gnu/libmicrohttpd/ (if you want the web UI). You need version >= 0.4.0 of microhttpd
- avahi [1] if you want discovery enabled.
If you're building from git you'll also need the following:
- libtool
- automake
- autoconf
Debian / Ubuntu
There is a fully packaged version of OLA you can just install, for info see OLA Debian / Ubuntu. There's also a more specific Ubuntu walkthrough for building The Newbie Guide for OLA on Ubuntu.
Debian/Ubuntu users can install them with apt:
sudo apt-get install libcppunit-dev uuid-dev pkg-config libncurses5-dev libtool autoconf automake g++ libmicrohttpd-dev \ libmicrohttpd10 protobuf-compiler python-protobuf libprotobuf-dev libprotoc-dev zlib1g-dev bison flex make libftdi-dev libftdi1 libusb-1.0-0-dev liblo-dev libavahi-client-dev
Note: Some distributions may offer libprotobuf-lite6 instead of libprotobuf-lite7, which is an acceptable substitution.
If you're using Ubuntu 12.04 or later you can just use the command above. In earlier versions of Ubuntu the version of libprotobuf is too old, so you'll need to install them by hand. You may also need to install an older version of libmicrohttpd (libmicrohttpd9 rather than libmicrohttpd10).
Centos 6 / RHEL 6 / Fedora 17
Users of rpm based distributions can install them with yum (protobuf*, libmicrohttpd* and libftdi* are in the EPEL repository):
sudo yum install flex bison protobuf protobuf-devel uuid-devel cppunit-devel protobuf-python libmicrohttpd-devel libusb-devel libftdi-devel libuuid-devel openslp-devel
(The remaining libs already come with the OS installation)
Other Distributions
Install using your package manager, or build everything by hand
If you installed things by hand (rather than using your package manager), you need to run ldconfig as root to pick up the new libraries
sudo ldconfig
Checkout or Download an Archive
You can either download a tarball, or pull the latest version from the git repo
Tarball
Download the most recent tarball from https://github.com/OpenLightingProject/ola/releases Extract using
tar -zxf ola-0.X.Y.tar.gz cd ola-0.X.Y
Git
If you don't have git yet, you'll need to install it with your distro's package manager. On Debian / Ubuntu run:
sudo apt-get install git
Check out the git repo with the following command:
git clone https://github.com/OpenLightingProject/ola.git ola cd ola
Run autoreconf
If this is the first time run with -i to install the missing files
autoreconf -i
Do the usual build steps
You can pass additional options to ./configure . Run
./configure --help
to see all options. The most popular option is --enable-python-libs to build the Python Client Module. If you want to use the RDM responder tests add --enable-rdm-tests.
Once you've decided on the options, it's time to build OLA. If you have a multi-core machine, you can speed up the build by using make -j N. A good value of N is the number of cores on your machine. On a MacBook Pro (4 core) using -j 4 reduced the build time from 5 minutes to 2.5 minutes.
./configure --enable-rdm-tests make make check sudo make install
Finally run ldconfig so you can use the new libraries.
sudo ldconfig
Device drivers
Note that, for some devices, it is necessary to install drivers for OLA to work with them. For example, the Open DMX USB device needs an additional kernel module that could be built using the instuctions on LLA_and_Q_Light_Controller_Ubuntu_Tutorial. For other devices, refer to the corresponding device page on this wiki.
Known Issues
If you get an error like the following:
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I/opt/local/var/macports/software/protobuf-cpp/2.0.3_0/opt/local/include/ -g -O2 -c -o ltdl.lo ltdl.c ./libtool: line 464: CDPATH: command not found /Users/simonn/lighting/lla/libltdl/libtool: line 464: CDPATH: command not found /Users/simonn/lighting/lla/libltdl/libtool: line 1142: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again.
Your system uses a different version of libtool. Run:
libtoolize --ltdl -c -f
and then start from the autoreconf step again.
If you should get the following error try to fix it with one of two available solutions:
Rpc.pb.cc: In copy constructor 'ola::rpc::RpcMessage::RpcMessage(const ola::rpc::RpcMessage&)': Rpc.pb.cc:143: error: base class 'class google::protobuf::Message' should be explicitly initialized in the copy constructor
You should be able to prevent this by editing ./src/Makefile.am
, removing -Werror
and then start from the autoreconfig step again.
Optional
Doxygen Documentation
There is also an option to build the doxygen documentation! To do so you will need to install doxygen.
Once you have installed Doxygen you may need to run ./configure in your ola directory, so that it can generate the correct make file. To build the docs just use:
make doxygen-doc
You'll have to run a webserver to get the experience. A simple way to do this is to navigate to open-lighting/html and run:
python -m SimpleHTTPServer
This opens a web server at your local IP address on port 8000. I can be accessed through 127.0.0.1:80000 on your local machine as well.