%prevogre%

HOWTO Ubuntu 7.10

On Ubuntu, you can compile OGRE from the Debian source package, the official tar.bz2 archive or from CVS. Compiling from the Debian source package will allow better integration with your system compared to the standard source compilation. Using CVS gives you the latest bugfixes, but is less guaranted to work than stable versions.

Using the Debian source package

At the place where you can find OGRE 1.0.3 packages for Ubuntu 5.0.4, there is a recompile_readme.txt file which describes how to recompile Debian OGRE and CEGUI packages for Ubuntu 5.0.4 (Hoary Hedgehog). The version of Ogre in the Ubuntu repositories is very outdated so you might as well download the latest from ogre3d.org instead. Instructions for compiling and installing the latest version can be found here.

On the Ubuntu forums you can find information about how to rebuild the Debian packages for Ubuntu on amd64 in this thread. The author of the post says that he's only done it on amd64 but that it should work in the same way for other architectures.

Using the tar.bz2 archive

This install documentation will work on a fresh install of Ubuntu 7.10 (gutsy gibbon)

The official tar.bz2 source to compile OGRE from is located here

Since Ubuntu was originally based on Debian and uses the same package management system, the same install process works for Debian with only slight changes to package names.

Note: The only changes you may be required to make are the versions of the packages that are installed with apt-get.

The rest of Ogre3D should install on either after the required packages are installed.

With it being so difficult to keep up with the changes of package versions, this is something you may have to change yourself but really it just requires a little bit of research into what package versions your current version of Debian or Ubuntu have.

Anyway, let us begin.

Note: Since this is also written for Debian, I haven't included "sudo" at the start of each command so if you're using Ubuntu, put a sudo at the start of each of them or it will blow out with permission errors when you run the command.

Enable all apt-get sources in Ubuntu's /etc/apt/sources.list file. (Get rid of the hash in from of the "deb" parts)

You may also want to enable contrib and non-free for future use since it simply expands the possible selection of packages available to you.

Apt-get install the following packages using:

apt-get install libfreeimage-dev libfreeimage3 pkg-config build-essential libtool make automake g++ gcc cpp make automake1.9 libtool libsdl1.2-dev libdevil-dev libfreetype6-dev libgtkmm2.0-dev libcegui*
 libpng12-dev libmng-dev libtiff4-dev liblcms1-dev libpng3 libjpeg62-dev libglade* libzzip-dev libxaw7-dev libopenexr-dev libopenexr2c2a nvidia-cg-toolkit checkinstall libcppunit-1.12-0 libcppunit-dev
 libcppunit-doc libxxf86vm-dev libtiff4-dev and libmng-dev libois1 libois-dev


Download the ogre source package for compilation. At the time of writing the most current source was:
http://downloads.sourceforge.net/ogre/ogre-linux_osx-v1-4-6.tar.bz2
Extract with:

tar -xvjf ogre-linux_osx-v1-4-6.tar.bz2

Enter the extracted source directory (ogrenew) with:

cd ogrenew

Run aclocal with:

aclocal

Run the bootstrapping program to create the initial files required for compiling.

./bootstrap

Configure the package for your distribution and exact configuration.

./configure

Make the source files

make

Install the made files into their respective locations (which will also create a .deb package for future use should you need to reinstall).

checkinstall

After the install, there is one more thing you need to do: Tell Ubuntu where to find the libraries.

Do this with by adding the following line to the bottom of /etc/ld.so.conf:

include /usr/local/lib

You should be able to use the tutorials for Setting Up An Application for Ogre3D and voila, all done!

If the sample applications are not working in /Samples/Common/bin, check ogre.log. If the log says something like,

OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library <RenderSystem_GL.so>.
 System Error: libOgreMain.so.14: cannot open shared object file: No such file or directory in DynLib::load at OgreDynLib.cpp (line 80)

You may need to build from the CVS if this problem persist. Ubuntu installations will typically have gcc 4.1+.(from build-essential pkg) gcc 4.0+ can cause trouble at runtime with dynamic link libraries. You can test for this by using the absolute path of the libraries in loadLibrary.

Additionally, or if you get stuck anywhere along the way, you might want to have a look at some of the other tutorials for previous versions of Ubuntu.

Installation guide for Ubuntu 7.04
Tutorial

Installation guide for Ubuntu 5.04
Tutorial

Using CVS

Use the vanilla GCC/make guide:
Building From Source - Linux - Shoggoth

If you run into linker problems, try issuing the command export CC=g++ before running ./configure.
See the Developers page if you want to get OGRE from CVS.

Using a semi-automated script (Ubuntu 6.10)

This method is probably not best suited to be up to date (at least concerning the 3rd party libraries like Cg) but it has been put together to set up OGRE (CVS version) on all the development platforms of our team. You can download and read more about this at the QBIC project. It downloads, compiles and installs OGRE and all required 3rd party libraries (including some deb-packages).

HowTo


I (madmark), a Windows guy, have documented my process getting Ogre installed from a fresh Kubuntu 5.10 (Breezy-Badger) install Kubuntu Install.

Using Checkinstall instead of "make install"

By using Checkinstall, you can automatically create a custom .deb package. This is the recommended way for building from source on ubuntu/kubuntu/debian systems.

Ubuntu 7.04 and ogre v-1.4.1 and v-1.4.2 fail after successful running make, when doing a checkinstall or make install at the point relinking RenderSystem_GL libs. I only found this workaround to build a debian package and install: copy the main-lib libOgreMain-1.4.2.so (or 1.4.1 for 1.4.1) to the directory where the install would put it - thats normaly /usr/local/lib - and create there too the link-entry libOgreMain.so (ln -s libOgreMain-1.4.2.so libOgreMain.s). Run ldconfig to update the lib-tables and do the checkinstall again. It will now find the dependencies to relink RenderSystem_GL.so with the main-lib from this place. After this you can delete the previous copy+link. Some packages create replacements for files in /lib, /bin -
i dont know why - to avoid them: checkinstall --exclude /lib,/bin,/usr/share excludes those files (ld, strip, ..).
To install/use both release versions together is normaly not possible, because only the main-libs have different filenames. The libs like RenderSystem_GL have the same filename and you have to put those in different directorys and manually enter their locations into the plugins.cfg of the programs using them. All samples did run, except the hdr and those using the missing quake-pk3.

I do not know if the fail of the relink is normal, i could not find any differences between the working relink of the Cg_Plugins lib and the RenderSystem libs, the first error message (of a lot) is:

.libs/OgreGLEngineDll.o: In function `dllStopPlugin':
/mybuild/src/ogre/ogrenew/RenderSystems/GL/src/OgreGLEngineDll.cpp:47: undefined reference to `Ogre::Root::uninstallPlugin(Ogre::Plugin*)'

HOWTO : Compile and Install Ogre 1.4.x from source on Ubuntu 7.04

Here is the original post : http://www.ogre3d.org/phpBB2/viewtopic.php?t=32549

STEP 1 : Install Dependencies

sudo apt-get install alien automake1.9 build-essential libcppunit-1.12-0 libcppunit-dev libmng-dev libsdl1.2-dev libtool libxaw-header 
            libxaw7-dev libfreetype6 libfreetype6-dev libpcre3 libpcre3-dev libzzip-dev libxrandr-dev libxxf86vm-dev freeglut3-dev

Here is the list of the package for those who want to use synaptic :

alien automake1.9 build-essential libcppunit-1.12-0 libcppunit-dev libmng-dev libsdl1.2-dev libtool libxaw-header libxaw7-dev libfreetype6 libfreetype6-dev libpcre3 libpcre3-dev libzzip-dev libxrandr-dev libxxf86vm-dev freeglut3-dev

STEP 2 : Build other dependancies

  • OIS 1.0 :

http://www.sourceforge.net/projects/wgois

  • FreeImage 3.9 :

http://freeimage.sourceforge.net

  • CEGUI 5.0b :

http://www.cegui.org.uk/wiki/index.php/CEGUI_Downloads_0.5.0

  • Cg Toolkit 1.5 :

download the lastest Cg toolkit here (the RPM file) :
http://developer.nvidia.com/object/cg_toolkit.html

And use alien to create au .deb :

sudo alien Cg-1.5.i386.rpm

Then install it :

sudo dpkg -i cg_1.5.0-15_i386.deb

Or download the .tar.gz file and merge /usr directory, go in the /usr directory unpacked and type :

sudo cp ./* /usr/ -R

Or take this .deb which apperently work fine with Ubuntu :
http://http.us.debian.org/debian/pool/contrib/n/nvidia-cg-toolkit/nvidia-cg-toolkit_1.5.0.0019-1_i386.deb

STEP 3 : Download Ogre3D Sources

from here:
http://www.ogre3d.org/index.php?option=com_content&task=view&id=412&Itemid=132

STEP 4 : Install Ogre3D

Unpack the folder and go with the terminal in the ogrenew folder and type :

aclocal
./bootstrap
./configure
make
sudo make install (or checkinstall)


And then everything should be fine!!

STEP 5 : Launch an example

In order to verify if Ogre is well installed, go in the /ogrenew/Sample/Common/bin directory and type the name of the demo like that :

./DemoName (example : ./Water)

STEP 6 : Finilize Installation



Edit the ld.so.conf file :

sudo gedit /etc/ld.so.conf

And add this :

/usr/local/lib

HOWTO: Compile and Install the Latest Ogre3D from Source on Ubuntu (Out of Date)


(Problems seem to have been fixed in final release of Edgy)

The version of Ogre in the Ubuntu repositories is quite old and will not work with recent Ogre3d based applications, hence the need to compile the latest versions from source.

There is an alternative HOWTO here

This guide is based on Ubuntu Edgy. Other releases may vary.

STEP 1: Download Source

download the latest Ogre3D Linux source from here and extract somewhere in your home directory. You'll get a folder called 'ogrenew'.

For a quick reference, the steps to install are as follows, but you'll need to install some packages before you can do this.

./bootstrap
    ./configure
    make
    sudo checkinstall


More info on Checkinstall

STEP 2: Install Dependencies

Install the required packages using either apt-get in the console or some other GUI package management tool like Synaptic or Adept. This is the command line to install all the packages you need:

sudo apt-get install build-essential automake1.7 alien libtool xlibs-static-dev libdevil-dev libsdl1.2-dev libcppunit-dev libmng-dev checkinstall libxxf86vm-dev libzzip-dev libxaw-headers libxrandr-dev libtiff-dev libpng-dev
sudo apt-get build-dep libogre-dev


It may be a good idea to run the command aclocal at this point. If you get warnings you might be missing some required libraries.

Note: Automake1.9 gave me errors about CPPUNIT so make sure you install automake1.7. If you change versions after you do ./bootstrap you'll have to re-run ./bootstrap and ./configure.

Note: The version of DevIL in dapper has a bug in it that will cause the default render settings window it malfunction. The bug is fixed with the version in Edgy, but if you're still using dapper, don't install the later package because it could break things due to dependency conflicts. Dapper users can try downloading and compiling the latest DevIL package from source.

Note: On Feisty Fawn, I had to use libpng12-dev instead of libpng-dev.

You'll have to install nVidia's Cg libraries manually because Ubuntu isn't allowed to redistribute them. Go here and download the Redhat Linux RPM either x86 or x86_64 if you have amd64. Run this command to convert the redhat rpm into a .deb file. You may have to change the RPM filename if you downloaded a different version

sudo alien Cg-1.5.i386.rpm


It will take a minute to finish. Then install the new .deb file by running this command (change filename as needed)

sudo dpkg -i cg_1.5.0-15_i386.deb

STEP 3: Compile and install

Now you should have everything you need and you should be able to run the following commands in succession.

aclocal
    ./bootstrap
    ./configure
    make
    sudo checkinstall // sudo make install <- use this instead 
        sudo ldconfig


If you get any missing library errors they will probably be in the ./bootstrap or ./configure process. Just install the library its asking for and try again. Please also update this wiki with any additional packages you needed to install.

The make process could take up to 20 minutes. Read some of the tutorials on this wiki while you wait.

During the checkinstall process it detects the version as 1.2.4 repeated for around 10 lines. I like to change that to just one line.

You should be all set! Ask in the forums or IRC if you need help. Good luck.

<HR>
Creative Commons Copyright -- Some rights reserved.


THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.

BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.

1. Definitions

  • "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
  • "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
  • "Licensor" means the individual or entity that offers the Work under the terms of this License.
  • "Original Author" means the individual or entity who created the Work.
  • "Work" means the copyrightable work of authorship offered under the terms of this License.
  • "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
  • "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.

2. Fair Use Rights

Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.

3. License Grant

Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:

  • to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
  • to create and reproduce Derivative Works;
  • to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
  • to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
  • For the avoidance of doubt, where the work is a musical composition:
    • Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
    • Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
    • Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).


The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.

4. Restrictions

The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:

  • You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(c), as requested.
  • You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-ShareAlike 2.5 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
  • If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.

5. Representations, Warranties and Disclaimer

UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.

6. Limitation on Liability.

EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

7. Termination

  • This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
  • Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.

8. Miscellaneous

  • Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
  • Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
  • If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
  • No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
  • This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.