1 | Title: Ogre in linux |
---|
2 | Author: Ben Woodhead |
---|
3 | Last Updated: 19 Feb 05 |
---|
4 | License: LGPL |
---|
5 | |
---|
6 | Edited by Steve Streeting following configuration changes. |
---|
7 | Edited by James O'Sullivan following requirement changes. |
---|
8 | Edited by Wladimir J. van der Laan following configuration changes. |
---|
9 | |
---|
10 | Downloading The Files |
---|
11 | ===================== |
---|
12 | |
---|
13 | If are going to using Ogre for more then just to have a look you will want to have a cvs copy of Ogre. If you are just testing it out, feel free to grab one of the release files. |
---|
14 | |
---|
15 | Release files can be found: |
---|
16 | http://ogre.sourceforge.net/modules.php?op=modload&name=Downloads&file=index |
---|
17 | |
---|
18 | CVS version (anonymous) |
---|
19 | If you are not an ogre developer then use anonymous. You can't write but why would you want to if you are not a developer. Help is always welcome and the occasional thing can be sent with a patch. |
---|
20 | |
---|
21 | Anyway enough of the talk, you probably are not reading it anyway. |
---|
22 | |
---|
23 | Login in |
---|
24 | cvs -d:pserver:anonymous@cvs.ogre.sourceforge.net:/cvsroot/ogre login |
---|
25 | password is blank so just press enter. |
---|
26 | |
---|
27 | Getting the module |
---|
28 | cvs -z3 -d:pserver:anonymous@cvs.ogre.sourceforge.net:/cvsroot/ogre co ogrenew |
---|
29 | // Note the new part on ogre, there is an order version in the repository as well (called ogre).. Don't get that one. |
---|
30 | |
---|
31 | |
---|
32 | Dependencies |
---|
33 | ============ |
---|
34 | |
---|
35 | So additional files that may not be found on your system that ogre will need. |
---|
36 | |
---|
37 | SDL 1.2.x (when not using the GLX platform manager -- see below) - To find out if you have it type sdl-config --version. This will tell you the version, if its not found then you will have to get sdl. sdl can be found at www.libsdl.org. It would be best to insure that this installs into a standard directory. If you are installing from source run ./configure --prefix=/usr. |
---|
38 | |
---|
39 | FreeType2 2.1.x - If you don't have this on your system then you can get it http://www.freetype.org/. Run freetype-config --version, if you have a version lower then 9.1.x, you will have to upgrade. |
---|
40 | |
---|
41 | DevIL 1.5.x or greater - If you don't have this on your system then you can get |
---|
42 | it from http://openil.sourceforge.net/. UPDATE: DevIL 1.6.6 seems to introduce some problems, stick to 1.6.5 for the moment. |
---|
43 | |
---|
44 | zziplib 0.12.x or above, available from http://zziplib.sourceforge.net. |
---|
45 | |
---|
46 | Cg, preferably version 1.1 since later versions have known bug which have been reported to nVidia. http://developer.nvidia.com/cg |
---|
47 | |
---|
48 | *Important* |
---|
49 | Do not install the binary version of DevIL as this has caused problems for some |
---|
50 | users, install the source distribution instead. |
---|
51 | |
---|
52 | Also if you have libpng3 installed on your system look at the following link: |
---|
53 | http://ogre.sourceforge.net/modules.php?op=modload&name=FAQ&file=index&myfaq=yes&id_cat=1&categories=Building+OGRE&parent_id=0#20 |
---|
54 | |
---|
55 | Optional Libraries |
---|
56 | ================== |
---|
57 | For the samples gui you will need gnome2, if you don't have gnome2 on your system the you will have to use the command line interface. If you are running gnome 2 then you will need 2 additional libraries. |
---|
58 | |
---|
59 | Gtkmm2 version 1.3.26 and Glademm2 version 1.3.4, both libraries can be found at http://gtkmm.sourceforge.net/. Gtkmm will also need libsigc (http://libsigc.sourceforge.net/). When configuring gtkmm and glademm insure that you use an appropriate prefix. (ie if gnome is found /usr then run ./configure --prefix=/usr). |
---|
60 | |
---|
61 | |
---|
62 | Compiling Ogre |
---|
63 | ============== |
---|
64 | |
---|
65 | You are not just going to read the code, I am guessing that you actually want to try it and even play with it. So here goes. |
---|
66 | |
---|
67 | GCC Compiler |
---|
68 | I have no idea if Intels compiler will work and I am not going to test to find out. |
---|
69 | |
---|
70 | What version of you compiler are you running. (gcc --version will tell you) |
---|
71 | |
---|
72 | 2.95.3 or 2.95.4 |
---|
73 | ---------------- |
---|
74 | |
---|
75 | I didn't have a lot of luck with this, but I upgraded straight away and didn't bother playing with it much. If you are running this you will need to get a copy of STLport (www.stlport.com). |
---|
76 | |
---|
77 | STLPort v4.5.3 Install |
---|
78 | |
---|
79 | cd STLport/src (or what ever its called) |
---|
80 | cp gcc-linux.mak Makefile (I am lazy, and I don't want to type things more then once) |
---|
81 | make clean all |
---|
82 | su -c "make install" |
---|
83 | |
---|
84 | Linking Problems |
---|
85 | The part that messed me up regarding this is what STL called itself when I was fished. The library is found in /usr/local/lib and its named libstlport_gcc.so. |
---|
86 | Can you think of something more irritating. To fix this su to root. |
---|
87 | |
---|
88 | ln -s /usr/local/lib/libstlport_gcc.so.4.5 /usr/local/lib/libstlport.so |
---|
89 | ldconfig |
---|
90 | |
---|
91 | Compiling Ogre |
---|
92 | cd ogrenew (where ever you put that). |
---|
93 | |
---|
94 | NOTE: if you are running the cvs version then you must run ./bootstrap first. It will setup the configure files for you. If you have some of the dependent libraries installed in another directory (like /usr/local) you might need to set the ACLOCAL_FLAGS variable to point at the extra aclocal directory. An example |
---|
95 | is: export ACLOCAL_FLAGS="-I /usr/local/share/aclocal"; ./bootstrap |
---|
96 | |
---|
97 | ./configure --with-stlport=/usr/local/include/stlport (don't do any associating pathing, i.e. ../stlport or ~/stlport, it does not work.. I don't know why but it doesn't so save yourself sometime and don't do it). |
---|
98 | |
---|
99 | make (if this causes problems send email to null@null.com ;) Go to the forum there are always people talking about building there) |
---|
100 | |
---|
101 | make install |
---|
102 | |
---|
103 | GCC 3.x |
---|
104 | ------- |
---|
105 | |
---|
106 | I have not tried 3.0 or 3.1 but 3.2 does work nicely. I personally don't have a lot of faith in 3.0 or 3.1, but to upgrade would be very difficult. If you are reading this I don't recommend you try this yourself. |
---|
107 | |
---|
108 | Well the god news is that gcc 3.2 does not need STLport, making things a lot easier. |
---|
109 | |
---|
110 | Compiling Ogre |
---|
111 | |
---|
112 | NOTE: if you are running the cvs version then you must run ./bootstrap first. It will setup the configure files for you. If you have some of the dependent libraries installed in another directory (like /usr/local) you might need to set the ACLOCAL_FLAGS variable to point at the extra aclocal directory. An example is: export ACLOCAL_FLAGS="-I /usr/local/share/aclocal"; ./bootstrap |
---|
113 | |
---|
114 | ./configure |
---|
115 | make |
---|
116 | make install |
---|
117 | |
---|
118 | Well you must be thinking that was easy compared to 2.95.3 and you are right. That's part of the reason I decided to upgrade (again changing compilers is a really good way to turn a linux box into a paper wait, if you can't compile what else are you going to do). |
---|
119 | |
---|
120 | GLX platform manager |
---|
121 | ==================== |
---|
122 | |
---|
123 | If you add the options --with-gl-support=GLX --with-platform=GLX to the ./configure statement, the GLX platform manager will be used instead of the default, SDL. This means that OGRE will work without the SDL libraries installed and directly make use of the capabilities of your X server. You will also get a nice X startup screen to select your resolution. There is little reason to use SDL, unless you want to use it for input or sound. |
---|
124 | |
---|
125 | Ogre Samples |
---|
126 | ============ |
---|
127 | |
---|
128 | Alright on to the samples, if you have not used Visual C++ you may find this a little confusing when you start. |
---|
129 | |
---|
130 | cd <ogrenew>/Samples/Common/bin/ - you will see 2 directories there one is Release and Debug. If you were running windows the files would already be in these directories but with Linux there are files only in the Debug directory. |
---|
131 | |
---|
132 | So the first thing is getting all the plugins (this worked for me, but I don't know about you). During the make install all the plugins were copied to /usr/local/lib/ogre except for the OgrePlatform.so which is found in the <ogrenew>/Samples/Common/bin with the samples. This didn't work for me, so I made a few changes. I copied the OgrePlatform.so to /usr/local/lib and the plugins from /usr/local/lib/ogre to /usr/local/lib and ran ldconfig. |
---|
133 | |
---|
134 | |
---|
135 | Next, in windows you have a nice little popup window that you can say the resolution in, Linux has 2 options, due to the fact that a lot of people are not running gnome2 yet, it has a gtk2 config or a cli (command line interface). CLI is the default and I have not figured out how to change that yet. |
---|
136 | |
---|
137 | |
---|
138 | Ok so now we have everything in place. The next thing you are going to have to do is try running some of the examples. You may need to check the case of the textures found in the media directory. |
---|
139 | |
---|
140 | COMMENTS |
---|
141 | ======== |
---|
142 | |
---|
143 | And that is it.. I hope this helps |
---|
144 | If you have any comments or questions regarding this document please send them to me at zander@echotech.ca |
---|
145 | |
---|
146 | Ben Woodhead |
---|