1. Forum moved (you can use login and pass from old forum)
  2. Many discussions moved to the bugtracker

HOWTO: Getting started under Linux

Discussion in 'Coding' started by JonnyH, Feb 16, 2015.

  1. JonnyH

    JonnyH Well-Known Member Official Developer Administrator
    0/28

    Joined:
    Jul 17, 2014
    Messages:
    183
    Likes Received:
    36
    Best Answers:
    0
    I realise some of this is non-trivial, and I hope to make some of it simpler going ahead, but here is some initial instructions on 'How to get OpenApoc building under Linux'

    Specifically, these instructions are tested on ubuntu 14.04 64bit - they will likely work on any recent ubuntu, but other distros will require changes (different ways of installing packages etc.). And unless you have a positively ancient pc (pentium-4 or older) there's no reason not to choose 64bit (sometimes called amd64, or x86_64).

    Code:
    Lines in monospace (like this) should be entered into the terminal.
    Lines prefixed by '$' should be typed into the terminal as your user. Lines prefixed by '#' should be typed into a root terminal (This can be entered by running 'sudo -s' in your normal terminal, and exited by typing 'exit' (The username at the beginning of the command line should change accordingly). The prefix itself should not be entered.

    - Install ubuntu 14.04 (Or use one you already have installed)
    - Login to the installation
    - Install the following dependencies:
    git cmake build-essential g++ libglm-dev liballegro5-dev libtinyxml2-dev
    The can either be found individually in the ubuntu software center, or (more quickly) installed in one command by typing the following into a root terminal:
    Code:
    # apt-get install git cmake build-essential g++ libglm-dev liballegro5-dev libtinyxml2-dev
    - Use git to checkout the source
    Code:
    $ git clone https://github.com/JonnyH/OpenApoc
    Note this is using 'my' branch, this is where I'm doing current development - every now and then I'll push it up to pmprog's repository (at https://github.com/pmprog/OpenApoc) but I've not been keeping that up to date recently...
    - Move to the source directory, create a new 'build' folder and move to that
    Code:
    $ cd OpenApoc; mkdir build;cd build
    - Run cmake to generate the makefiles (This will shout at you if you're missing a dependency - if so check you've installed all the packages required above) - this will need to be re-run if you add a new source file
    Code:
    $ cmake ../
    - Run make to actually build - this will need to be re-run if you modify a source file
    Code:
    $ make
    If you have a multi-core CPU, you can speed this up by running parallel compiles by using the '-j' option - You'll want to give it a number of processes to use - a good bet is the number of cores
    Code:
    $ make -j4
    This should create a 'bin' folder in your build directory, with a build OpenApoc binary and some data files under a 'data' folder.
    - Copy data files from the Apocalypse CD-ROM - This is required - without this it will crash on startup!
    You can mount an .iso file by using a command similar to:
    Code:
    # mount -o loop /path/to/cd.iso /mnt
    When done, you can unmount it with:
    Code:
    # umount /mnt
    -- Copy the 'music' file from the cd root to 'bin/data/'
    Code:
    $ cp /mnt/music bin/data/
    -- Copy everything under the 'xcom3' folder to 'bin/data/'
    Code:
    $ cp -dvpR /mnt/xcom3/* bin/data/
    - Move to the 'bin' folder
    Code:
    $ cd bin
    - Run OpenApoc
    Code:
    $ ./OpenApoc 
    Troubleshooting:
    - Crashes on startup
    -- Check the terminal output, just before the crash does it fail to open a file? Some of these messages are normal, but this may suggest the apocalypse data files haven't been correctly copied.
    - 'OpenGL implementation too old'
    -- Currently I check for opengl 3.0 - all halfway modern graphics chips should support this, so this likely means the drivers aren't correctly installed or you're running in a VM. Unfortunately, this isn't supported (yet?)
    - Other crashes:
    -- Check the log output for something suspicious - you can post here with details. There's a good change a 'backtrace' would be useful - install 'gdb' and run OpenApoc using it:
    Code:
    $ gdb ./OpenApoc
    then type 'r' and return to start it running. When it crashes, go back to the gdb console and type 'bt' and return to get the backtrace. This should say exactly where it crashed, which is damned useful for figuring out what went wrong :D

    (If anyone finds this unclear/incorrect, please comment below!)
     
  2. kkmic

    kkmic Undefined
    44/56

    Joined:
    Jul 17, 2014
    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    I was wondering where the action was taking place... thanks for the info :)
     
  3. Colombo

    Colombo Registered
    0/28

    Joined:
    Feb 11, 2015
    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    It seems, that I can finally get it to compilation.

    Unfortunately, my Ironlake Mobile shit doesn't support OpenGL 3. It could, but developers don't care.

    Why do we need OpenGL 3 anyways?
     
  4. JonnyH

    JonnyH Well-Known Member Official Developer Administrator
    64/112

    Joined:
    Jul 17, 2014
    Messages:
    183
    Likes Received:
    36
    Best Answers:
    0
    Bah, that's a shame - we use opengl3 for framebuffer objects (plus some optional go-faster-but-not-really-needed stuff).

    We might be able to use opengl 2.1 with the framebuffer_object extension, if that is supported? You should be able to find out by running 'glxinfo' and seeing if the extensions list contains 'GL_EXT_framebuffer_object' or 'GL_ARB_framebuffer_object
     
  5. Colombo

    Colombo Registered
    0/28

    Joined:
    Feb 11, 2015
    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    both are there, Ill take a look into it. I need to learn that stuff anyway.

    btw. what is your background?
     
  6. JonnyH

    JonnyH Well-Known Member Official Developer Administrator
    64/112

    Joined:
    Jul 17, 2014
    Messages:
    183
    Likes Received:
    36
    Best Answers:
    0
    As an aside, can you post your full glxinfo output? The only '3.0' features I'm using are texture_integer, texture_array and texture_rg - if there are platforms that support all of them but not '3.0' I will push them all down to check for the extensions instead.

    My background? My 'day job' is working on OpenGL-ES drivers, if that's what you mean.... Possibly related to me wanting to play with the latest and greatest :)
     

Share This Page