Compiling OpenRA on Ubuntu

Discussion about the game and its default mods.
Iran
Posts: 92
Joined: Wed Sep 08, 2010 3:16 pm

Compiling OpenRA on Ubuntu

Post by Iran »

First off, grab the source with Git:

Code: Select all

$ git clone git://github.com/chrisforbes/OpenRA.git
$ cd OpenRA
If you don't have git installed, you can install it with:

Code: Select all

$ sudo apt-get install git-core

To compile OpenRA on Ubuntu you need the following dependencies (as tested on Ubuntu 10.04):
  • mono-gmcs
  • libmono-corlib1.0-cil
  • libmono-winforms2.0-cil
  • libopenal1
  • libsdl1.2-dev
  • libfreetype6 or libfreetype6-dev
To install these dependencies type:

Code: Select all

$ sudo apt-get install mono-gmcs freetype libmono-corlib1.0-cil libmono-winforms2.0-cil libopenal1 libsdl1.2-dev
Next you need to install the assemblies of these third party libraries into the global assembly cache that the Mono compiler uses. You can either run the following script or run these command individually (the 'gacutil' program can't handle multiple files at once):

Code: Select all

#!/bin/sh 
gacutil -i thirdparty/Tao/Tao.Cg.dll
gacutil -i thirdparty/Tao/Tao.OpenGl.dll
gacutil -i thirdparty/Tao/Tao.OpenAl.dll
gacutil -i thirdparty/Tao/Tao.Sdl.dll
gacutil -i thirdparty/Tao/Tao.FreeType.dll
gacutil -i thirdparty/WindowsBase.dll
Note: You'll need to run the script as an administrator ("root"). If you run these command one per one, it is recommended that you use the 'sudo' application to obtain root privilege.

Alternatively, you can copy the dll’s into the same directory as OpenRa.Game.exe.

Once you have copied the following 'MIX' file packages into the appropriate directories (mods/*/packages), you're ready to compile (aka "build"):

For the Red Alert mod:
  • allies.mix
  • expand2.mix
  • hires1.mix
  • redalert.mix
  • scores.mix
  • sounds.mix
  • conquer.mix
  • general.mix
  • interior.mix
  • russian.mix
  • snow.mix
  • temperat.mix
For the Command & Conquer mod:
  • cclocal.mix
  • conquer.mix
  • desert.mix
  • general.mix
  • sounds.mix
  • speech.mix
  • temperat.mix
  • tempicnh.mix
  • updatec.mix
  • winter.mix
The size should be around ~20 MB if you download a stripped (no audio and videos) version of these files. You can download these for C&C here and for RA here.

If you want to use the complete, non-strippedl MIX files, you'll need to install the game and then copy these files over from the installed directory plus the game CDs. You can download all the CD (and expansions) ISOs legally:

Command & Conquer Full Game
Red Alert Full game

Note that both games' installers are 16-bit so they don't run under a 64-bit operating system, the C&C download link contains a modified 32-bit installer. To install RA1, use the Red Alert Setup Manager v0.98.

When you're done copying the MIX files to the correct folder, you'll only need to type

Code: Select all

 $ make all
and pray that it works. To actually play the game you'll need the following dependencies:
  • libglfw2
  • libmono-* (Note: you dont need all of them, but it works with all of them)
  • libopenal1
  • mono-runtime
Note that the project is in alpha phase and we don't have a complete list of possible errors and fixes for them. Please check the FAQ listed on this forum before asking for help on our forum and/or [url=irc://irc.freenode.net/openra]IRC channel[/url].
Last edited by Iran on Tue Oct 05, 2010 10:47 pm, edited 1 time in total.

Iran
Posts: 92
Joined: Wed Sep 08, 2010 3:16 pm

Post by Iran »

ignore this

relipse
Posts: 2
Joined: Fri Oct 29, 2010 3:55 am

compiling on ubuntu -- update

Post by relipse »

Well i tworked, I had to Go to System -> Preferences -> Appearances -> Visual Effects -> None to get i tto work and i'm using ubuntu 10.10

just as an update, tey are no longer using /chrisforbes/ the new git is:

git clone git://github.com/OpenRA/OpenRA.git

Pierre Monteux
Posts: 1
Joined: Sat Dec 11, 2010 4:40 pm

Post by Pierre Monteux »

I was unable to build on anything but the latest version of Ubuntu 10.10.

Also the gacutil script is out of date. What worked for me was to manually register every dll in the third party folder.

And mono-devel should be added to the compile dependency list.

krn_78
Posts: 1
Joined: Sat Jan 15, 2011 4:05 pm

Re: compiling on ubuntu -- update

Post by krn_78 »

In Ubuntu 10.10 openRA is available in Ubuntu Software Center :)

relipse wrote: Go to System -> Preferences -> Appearances -> Visual Effects -> None
Your suggestion helped me with my problem. Loader worked fine, and after choosing any mod, there was a message on console:

Unhandled Exception: System.InvalidOperationException: No valid techniques
at OpenRA.Renderer.Cg.Shader..ctor (OpenRA.Renderer.Cg.GraphicsDevice dev, System.String name) [0x00000] in <filename unknown>:0
at OpenRA.Renderer.Cg.GraphicsDevice.CreateShader (System.String name) [0x00000] in <filename unknown>:0
at OpenRA.Graphics.Renderer..ctor () [0x00000] in <filename unknown>:0
at OpenRA.Game.Initialize (OpenRA.Arguments args) [0x00000] in <filename unknown>:0
at OpenRA.Program.Run (System.String[] args) [0x00000] in <filename unknown>:0
at OpenRA.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

Thanks to you, it's ok now.

Iran
Posts: 92
Joined: Wed Sep 08, 2010 3:16 pm

Post by Iran »

This tutorial is very likely outdated

User avatar
riderr3
Posts: 98
Joined: Sat Feb 26, 2011 11:26 pm
Location: Camo pillbox
Contact:

Post by riderr3 »

error log from console terminal:

Code: Select all

CSC OpenRA.FileFormats.dll
CSC OpenRA.Game.exe
CSC OpenRA.Renderer.Cg.dll
CSC OpenRA.Renderer.Gl.dll
CSC OpenRA.Renderer.Null.dll
CSC mods/ra/OpenRA.Mods.RA.dll
OpenRA.Mods.RA/Widgets/Delegates/MusicPlayerDelegate.cs&#40;33,29&#41;&#58; warning CS0168&#58; The variable `installed' is declared but never used
Compilation succeeded - 1 warning&#40;s&#41;
CSC mods/cnc/OpenRA.Mods.Cnc.dll
resgen2 OpenRA.Editor/MapSelect.resx OpenRA.Editor.MapSelect.resources 1> /dev/null
/bin/sh&#58; resgen2&#58; not found
make&#58; *** &#91;OpenRA.Editor.MapSelect.resources&#93; Error 127
seems I can not compile the editor or what?

ddd
Posts: 272
Joined: Sat Oct 23, 2010 5:04 pm

Post by ddd »


arjun
Posts: 1
Joined: Mon Jul 11, 2011 1:57 am

How I fixed it

Post by arjun »

I followed all the instructions as above, except for the gacutil commands. Instead, following the instructions at https://github.com/OpenRA/OpenRA/blob/2 ... 63/INSTALL I just copied all the files from thirdparty/*.dll and thirdparty/Tao/* to the OpenRA root directory.

When running openra, I got an exception.
Unhandled Exception: System.InvalidOperationException: GL Error: 1282
at OpenRA.Renderer.Glsl.GraphicsDevice.CheckGlError () [0x00000] in <filename unknown>:0
at OpenRA.Renderer.Glsl.Shader..ctor (OpenRA.Renderer.Glsl.GraphicsDevice dev, System.String type) [0x00000] in <filename unknown>:0
at OpenRA.Renderer.Glsl.GraphicsDevice.CreateShader (System.String name) [0x00000] in <filename unknown>:0
at OpenRA.Graphics.Renderer..ctor () [0x00000] in <filename unknown>:0

This is apparently due to my using an onboard intel graphics card (82945G). There is a code fix here http://bugs.open-ra.org/issues/883
You can download the patch file and apply it using
git apply <filename.patch>
or you can just click on the file to see the changes (it's about 5 lines of code), directly edit the OpenRA.Renderer.Gl/Shader.cs file and make the required changes.

mainstream
Posts: 3
Joined: Mon Jan 30, 2012 4:18 pm

Post by mainstream »

Why would you wanna compile it when .deb's are available?

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

mainstream wrote: Why would you wanna compile it when .deb's are available?
If you want to work with the source code.

Have a look at http://archive.getdeb.net/getdeb/ubuntu ... etdeb1.dsc to see the dependencies for Ubuntu:

Code: Select all

Build-Depends&#58; debhelper &#40;>= 8.0.0&#41;, mono-gmcs, cli-common-dev &#40;>= 0.8&#41;, libgl1-mesa-dev, libsdl1.2-dev, libsdl-gfx1.2-dev, libsdl-image1.2-dev, libsdl-mixer1.2-dev, libsdl-net1.2-dev, libsdl-ttf2.0-dev, libsmpeg-dev, libopenal-dev, libalut-dev

tacozmeister
Posts: 126
Joined: Tue Jun 26, 2012 3:37 am
Location: St. Louis, MO

Post by tacozmeister »

I think we should also add here where to find "settings.yaml" because I can't find it >_> And I wanna enable the Cg-Renderer for every time I start.
Also, you can find the main game folder at

Code: Select all

/usr/share/openra/
.

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

You find it at ~/.openra/settings.yaml

The .mix files should belong to ~/.openra/Content/$MOD

tacozmeister
Posts: 126
Joined: Tue Jun 26, 2012 3:37 am
Location: St. Louis, MO

Post by tacozmeister »

Oh, you have to view hidden files by pressing Ctrl-H. There's the file I was looking for :D thanks

tacozmeister
Posts: 126
Joined: Tue Jun 26, 2012 3:37 am
Location: St. Louis, MO

Post by tacozmeister »

Hmm, how does one install extra mods (for example, mine) on Ubuntu? I tried simply dragging and dropping my mod into /usr/share/openra/mods/, but it says I do not have sufficient permission. But whenever I run "sudo nautilus" and DO put the file in there, the game will not even read the file when I open it up. I'm 100% positive it isn't just my mod, because it works fine on Windows and all that jazz.

Post Reply