Commit b6af0c8b authored by Timothee Habra's avatar Timothee Habra

issue #4 apt-get SDL2

parent c7699395
### Manual installation of SDL 2.0 from source
Download [SDL 2.0](http://www.libsdl.org/). For instance, you can use this [link](http://www.libsdl.org/download-2.0.php) and download _SDL2-2.0.x.tar.gz_.
Install it with [CMake](http://www.cmake.org/).
* _cd SDL2-2.0.x_
* _mkdir build_
* _cd build_
* _cmake .._
* _make_
* _sudo make install_
Alternative: install it with the following lines:
* _cd SDL2-2.0.x_
* _./configure_
* _make_
* _sudo make install_
Install [freetype](http://www.freetype.org/) (possibly with package _libfreetype6_).
* _sudo apt-get install freetype*_
Later, if you get the following error: " _fatal error: GL/gl.h: No such file or directory_ ", you might need to run this command: " _sudo apt-get install freeglut3-dev_ ".
Download _SDL2_ttf_. For instance, you can use this [link](https://www.libsdl.org/projects/SDL_ttf/) and download _SDL2_ttf-2.0.xx.tar.gz_.
Install _SDL2_ttf_.
* _cd SDL2_ttf-2.0.xx_
* ./configure
* _make_
* _sudo make install_
......@@ -26,7 +26,11 @@ Install [CMake](http://www.cmake.org/) to be able to generate the project from t
### Compiler ###
If you want to install another compiler (e.g. _gcc-4.4_). The _gcc_ compiler should already be installed and is enough to compile the code. Nevertheless, other compilers (like _gcc-4.4_) are faster to compile the code.
You need a c++ compiler. You can install g++ for instance
* _sudo apt-get install g++_
The _gcc_ compiler should already be installed and is enough to compile the code. Nevertheless, other compilers (like _gcc-4.4_) are faster to compile the code. If you want to install another compiler (e.g. _gcc-4.4_).
* _sudo apt-get install gcc-4.4_
* _sudo apt-get install g++-4.4_
......@@ -47,38 +51,11 @@ Install [GSL](http://www.gnu.org/software/gsl/) to perform numerical computation
### SDL 2.0: Graphs and interactions with the simulator (in real-time) ###
Download [SDL 2.0](http://www.libsdl.org/). For instance, you can use this [link](http://www.libsdl.org/download-2.0.php) and download _SDL2-2.0.x.tar.gz_.
Install it with [CMake](http://www.cmake.org/).
* _cd SDL2-2.0.x_
* _mkdir build_
* _cd build_
* _cmake .._
* _make_
* _sudo make install_
Alternative: install it with the following lines:
* _cd SDL2-2.0.x_
* _./configure_
* _make_
* _sudo make install_
Install [freetype](http://www.freetype.org/) (possibly with package _libfreetype6_).
* _sudo apt-get install freetype*_
Later, if you get the following error: " _fatal error: GL/gl.h: No such file or directory_ ", you might need to run this command: " _sudo apt-get install freeglut3-dev_ ".
Download _SDL2_ttf_. For instance, you can use this [link](https://www.libsdl.org/projects/SDL_ttf/) and download _SDL2_ttf-2.0.xx.tar.gz_.
Install [SDL 2.0](http://www.libsdl.org/) to plot graphs and interact with the simulation (from keyboard or joystick).
Install _SDL2_ttf_.
* _sudo apt-get install libsdl2-ttf-dev_
* _cd SDL2_ttf-2.0.xx_
* ./configure
* _make_
* _sudo make install_
Alternatively, if you prefer to install it manually, you can follow these [instructions](Documentation/src/installSDL.md)
### Java for the real-time visualization ###
......@@ -259,7 +236,7 @@ The _build folder_ will be created by CMake anywhere on your computer: you defin
__Important__: _CMake_ needs to find the external libraries. The paths to these libraries are defined in the files located in the _StandaloneC/src/other/conf_ folder. Some possible paths are already provided but you might have to increment these files to add your own paths. Read the comments after CMake launch to know which files should be modified if needed (more information available below, in the _External Libraries_ section).
You can use CMake with a terminal or with a graphical interface.
You can use CMake with a terminal (Unix only) or with a graphical interface.
### Using a Terminal ###
......@@ -269,7 +246,7 @@ Examples of Unix Terminal lines are provided. In this example, we decided to pla
* _cd StandaloneC_
* _mkdir build_ (or any other name you choose for the build folder)
* _cd build_
* _cmake_ .. (You must point to the file called _CMakeLists.txt_ and located at the root of the _StandaloneC_ folder, so you should use 'cmake ../..' if the build folder location was _StandaloneC/exampleFolder/build_)
* _cmake_ .. (You must point to the file called _CMakeLists.txt_ and located at the root of the _StandaloneC_ folder, for example if the build folder location was _StandaloneC/exampleFolder/build_ you should use 'cmake ../..')
Then, the project is already created, but you used the default flags configuration (see the subsection _CMake Flags_ for more information). If you want to modify these flags, use the following lines:
......
......@@ -52,11 +52,13 @@ ELSE (APPLE)
# possible paths for: 'SDL.h'
SET(TRIAL_PATHS_INC
/usr/local/include/SDL2
/usr/include/SDL2
)
# possible paths for: 'libSDL2.so'
SET(TRIAL_PATHS_LIB_SDL2
/usr/local/lib
/usr/lib/x86_64-linux-gnu
)
FIND_PATH(SDL2_INCLUDE_PATH SDL.h ${TRIAL_PATHS_INC})
......
......@@ -43,11 +43,13 @@ ELSE (APPLE)
# possible paths for: 'SDL_ttf.h'
SET(TRIAL_PATHS_INC
/usr/local/include/SDL2
/usr/include/SDL2
)
# possible paths for: 'libSDL2_ttf.so'
SET(TRIAL_PATHS_LIB
/usr/local/lib
/usr/lib/x86_64-linux-gnu
)
FIND_PATH(SDL2TTF_INCLUDE_PATH SDL_ttf.h ${TRIAL_PATHS_INC})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment