-
Notifications
You must be signed in to change notification settings - Fork 7
Compilation instructions
Compilation is done by using Cmake on both Linux and Windows.
The supported software platforms are Ubuntu Linux 12.04 LTS and Windows 7 with Visual Studio 2010.
Other fairly recent *NIXes will probably work, as long as they have a fairly recent C++ compiler supporting C++11.
As of October 15th, 2014, Tinia depends on the library TurboJpeg (http://www.libjpeg-turbo.org/Main/HomePage) for its server module. Given the current state of Tinia, this will not be immediately tested on the platforms listed below, but the instructions for installing this third party component on Ubuntu 14.04 is as follows:
Installing through apt-get install
from default repositories will not do, since that only installs the static library and we need the shared one. Start by installing nasm
,
sudo apt-get install nasm
and then download and build libjpeg-turbo similarly to this:
mkdir tmp
cd tmp
svn co svn://svn.code.sf.net/p/libjpeg-turbo/code
cd code/trunk
autoreconf -fiv
mkdir build
cd build
sh ../configure
make
When this builds properly, install with
sudo make install
which will (on at least one Ubuntu 14.04 installation) place the library and header file under /opt
. One may have to add /opt/libjpeg-turbo/lib64
(or whichever location the system made use of) to the file /etc/ld.so.conf.d/local.conf
followed by a rerun of ldconfig
. (Other mechanisms for specifying library locations may be used, like, e.g., setting LD_LIBRARY_PATH
.)
When this is done, the CMake
scripts of Tinia should be able to find both the header turbojpeg.h
and the library libturbojpeg.so
. If not, check if the CMakeLists.txt
needs to be told about new hints for places to look for these files.
You need to run the apache2 server from a user that has access to the X system. The easiest way to achieve this is to disable X access control from local connections, i.e. issue the command
xhost +local:
You need to install the required packages, this can be done with the command
$ sudo apt-get install libxml2-dev libglew-dev libglm-dev libqt4-dev libapr1-dev cmake libboost-all-dev build-essential apache2-dev apache2 git
Then you need to checkout tinia from github: git clone https://github.com/sintefmath/tinia.git
and finally run cmake and make out of source:
mkdir tinia-build
cd tinia-build
cmake ../tinia
make -j9
The supported Linux platform is Ubuntu 12.04 LTS and Ubuntu 12.10, utilizing dependencies from the official repositories.
Ubuntu packages (with dependencies) for Ubuntu 12.04:
- libxml2-dev
- glew1.6-dev
- libglm-dev
- libqt4-dev
- libapr1-dev
- cmake
- libboost-all-dev
- apache2 (For server module)
- apache2-dev (For server module).
- build-essential
Ubuntu packages (with dependencies) for Ubuntu 12.10:
- libxml2-dev
- libglew-dev
- libglm-dev
- libqt4-dev
- libapr1-dev
- cmake
- libboost-all-dev
- apache2 (For server module)
- apache2-prefork-dev (For server module).
- build-essential
Once these are installed a simple
$ cmake .
$ make
Should be enough to compile it. You can optionally issue
$ make package
Which will build a debian package which installs into
/usr/lib and /usr/include/model . This package can be installed on your
system with the following command:
$ sudo dpkg -i tinia-0.1.0-Linux.deb
Follow the instructions for Ubuntu 13.04. In case of compilation error during $ make
of the form
make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libGL.so', needed by 'src/qtcontroller/libtinia_qtcontroller.so'. Stop.
try the following:
The target described above is a link, pointing as
/usr/lib/x86_64-linux-gnu/libGL.so -> mesa/libGL.so -> libGL.so.1.2.0
where libGL.so.1.2.0
does not exist. Verify that /usr/lib/libGL.so
points to a valid library, by
$ ls -l /usr/lib/libGL.so
which on the test system gives a two step link path as
/usr/lib/libGL.so -> libGL.so.1 -> libGL.so.331.62
where the libGL.so.331.62
is the version installed by the Nvidia driver. Therefore, make the troubled link point to the existing libGL.so
file, by (and adjusting to the correct filenames on your system)
$ sudo rm /usr/lib/x86_64-linux-gnu/libGL.so
$ sudo ln -s /usr/lib/libGL.so.1 /usr/lib/x86_64-linux-gnu/libGL.so
When this is done, try to run make
again.
To compile on Windows it is required to download and install several thirdparty packages.
Compilation and running on Windows is definitely quite complicated, and it is not possible to guarantee 100% compatability with other software you have installed.
- CMake 2.8 from http://www.cmake.org
- Qt 4.8 from http://qt.nokia.com/downloads you need just the Qt libraries, but feel free to grab the larger SDK packages if you prefer them.
- A precompiled archive of Boost, GLEW and GLM from can be downloaded from here.
Once the dependencies are installed, we invoke CMake to generate a Visual Studio
solution file that can be compiled either on the command line by msbuild
or loaded
into the IDE.
For the following example, we assume you have extracted the precompiled
package to <tinia_3rdparty_location> and that Qt is installed by the normal installer (so that
it can be found either by registry keys or the QTDIR
environment variable).
You can now invoke the Cmake-gui and point it to the folder where the Tinia sources are installed. If you are using Visual Studio and intend to modify the Tinia sources, we recommend letting the build directory be the same directory as the source code (known as an in-source-build).
Click configure
and it will probably complain about not finding Boost, GLM and
Glew. This situation can be fixed by expanding the Tinia-section and setting
the variable Tinia_3RDPARTY_LOC to point to <tinia_3rdparty_location>.
Hit configure
again, and you should hopefully find all dependencies.
It is now time to click generate
which should make a tinia.sln
file
you can open in Visual Studio.
The generated tinia.sln
file contain absolute paths on your computer
and is not suitable beeing checked into version control.
Compilation should now be relatively straightforward. The tinia.sln
file
produced by the above step can be loaded into Visual Studio and compiled using
the IDE, or you can open a Visual Studio Command prompt and invoke msbuild tinia.sln
which will build the libraries, unit tests, tutorials and examples.
Running the compiled programs can however be a bit troublesome. You must ensure that the following is in you path:
<tinia_3rdparty_location>\bin
-
QTDIR
\bin
It is possible you have installed other tools which include dlls from the package above in your path. However, they might very well be of different and incompatible versions than the ones provided in the above packages leading to the so called Windows DLL-hell.
For invoking Tinia-application you can ensure that the above directories are first in your path, this should be acceptable for developement.