COMPILE

COMPILE

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
ICE
Posts: 18
Joined: 06 Aug 2019, 14:52

COMPILE

Post by ICE » 10 Aug 2019, 21:09

How to compile the game (EXE) under ubuntu?
Thank!
0 x

MasterBel
Posts: 170
Joined: 18 Mar 2018, 07:48

Re: COMPILE

Post by MasterBel » 10 Aug 2019, 23:53

Hey !
See https://springrts.com/wiki/Building_Spring_on_Linux – or, if you want to get into the habit of finding things yourself (saving everyone time), see "Documentation" up top of this page, then the "Engine and Native Development" section on the right column, and then the "Building Spring on Linux" link on the left
2 x

ICE
Posts: 18
Joined: 06 Aug 2019, 14:52

Re: COMPILE

Post by ICE » 11 Aug 2019, 13:36

Done!
git clone --recursive git://github.com/spring/spring.git -b master
What I installed.
sudo apt install cmake #versin 3.13.4-1
7zip
sudo apt install build-essential
make
sudo apt install install libsdl2-dev
sudo apt install libdevil-dev
sudo pt-get install libopenal-dev
sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev
sudo apt install zlib1g
sudo apt update && sudo apt install freetype2-demos
sudo apt-get install libogg-dev
sudo apt install vorbis-tools
sudo apt-get install libvorbis-dev
sudo apt install curl
sudo apt install python #version 2.7.16-1
sudo apt-get install default-jdk
sudo apt-get install libboost-all-dev

Plus that.
Ubuntu
sudo apt-get install build-essential cmake cmake-gui git

sudo apt-get install libglew-dev libsdl2-dev libdevil-dev libopenal-dev \
libogg-dev libvorbis-dev libfreetype6-dev p7zip-full libxcursor-dev \
libboost-thread-dev libboost-regex-dev libboost-system-dev \
libboost-program-options-dev libboost-signals-dev \
libboost-chrono-dev libboost-filesystem-dev libunwind8-dev \
default-jdk libcurl4-gnutls-dev

$ git stash
fatal: bad revision 'HEAD'
fatal: bad revision 'HEAD'
fatal: Needed a single revision
You do not have the initial commit yet

$ git checkout $ MY_OTHER_BRANCH
error: pathspec '$' did not match any file(s) known to git
error: pathspec 'MY_OTHER_BRANCH' did not match any file(s) known to git

$ git pull --rebase
fatal: Updating an unborn branch with changes added to the index.

Done!
git submodule sync
git submodule update --init

$ cmake .
CMake Error: The source directory "/home/alex" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

$ make spring
make: Nothing to be done for 'spring'.

$ make install-spring
make: *** No rule to make target 'install-spring'. Stop.

cmake -LH
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.


CMake Error: The source directory "/home/alex" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
-- Cache values

The question is, what should I do with these errors?
And from this article I did not understand how to compile it.
Where to indicate that I need to compile Game.ssd?
I would not refuse a simple explanation for the teapot.

Thank!
Last edited by ICE on 13 Aug 2019, 17:31, edited 1 time in total.
0 x

MasterBel
Posts: 170
Joined: 18 Mar 2018, 07:48

Re: COMPILE

Post by MasterBel » 12 Aug 2019, 07:35

Awesome! About the errors – check you're in the right directory, the common theme among them is it can't find what it's looking for.
Also, feel free to update the wiki if it needs anything. :)
0 x

ICE
Posts: 18
Joined: 06 Aug 2019, 14:52

Re: COMPILE

Post by ICE » 13 Aug 2019, 17:28

Yes, I had to go to the folder cd spring.
Everything is working


Besides
make install-spring


[100%] Built target spring-legacy
[100%] spring-legacy: Installing ...
-- Install configuration: "RELWITHDEBINFO"
-- Installing: /usr/local/bin/spring
CMake Error at rts/builds/legacy/cmake_install.cmake:47 (file):
file INSTALL cannot copy file "/home/alex/spring/spring" to
"/usr/local/bin/spring".

rts/builds/legacy/CMakeFiles/install-spring-legacy.dir/build.make:57: recipe for target 'rts/builds/legacy/CMakeFiles/install-spring-legacy' failed
make[3]: *** [rts/builds/legacy/CMakeFiles/install-spring-legacy] Error 1
CMakeFiles/Makefile2:4202: recipe for target 'rts/builds/legacy/CMakeFiles/install-spring-legacy.dir/all' failed
make[2]: *** [rts/builds/legacy/CMakeFiles/install-spring-legacy.dir/all] Error 2
CMakeFiles/Makefile2:4017: recipe for target 'rts/builds/CMakeFiles/install-spring.dir/rule' failed
make[1]: *** [rts/builds/CMakeFiles/install-spring.dir/rule] Error 2
Makefile:1098: recipe for target 'install-spring' failed
make: *** [install-spring] Error 2

And I still do not understand how to specify the source files, maps, logic of the game, etc.
0 x

gajop
Moderator
Posts: 3023
Joined: 05 Aug 2009, 20:42

Re: COMPILE

Post by gajop » 13 Aug 2019, 18:42

Why are you even compiling the engine? It seems to me this thread exhibits the XY problem. Just use one of the nightly maintenance builds: https://springrts.com/dl/buildbot/default/maintenance/

To actually make a game or map, start here: https://springrts.com/wiki/Main_Page

Regarding your compile issue, your problem is that you're actually trying to install the game in /usr/local (default install prefix), and you don't have write access there with your normal user. You could sudo.. but you probably shouldn't. Check: https://cmake.org/cmake/help/latest/var ... REFIX.html . I normally specify this as

Code: Select all

cmake . -DCMAKE_INSTALL_PREFIX=~/opt/spring
2 x

ICE
Posts: 18
Joined: 06 Aug 2019, 14:52

Re: COMPILE

Post by ICE » 13 Aug 2019, 19:53

I just need to make a Windows game in exe format, without any emulators.
Without springlobby.
Like in Unity3d and other engines.
Is it possible?
0 x

MasterBel
Posts: 170
Joined: 18 Mar 2018, 07:48

Re: COMPILE

Post by MasterBel » 13 Aug 2019, 22:13

ICE wrote:
13 Aug 2019, 19:53
I just need to make a Windows game in exe format, without any emulators.
Can we have more specific requirements for this game?

Afaik, SpringRTS is designed to have everything separate i.e. your .sdd may be compressed into a .sdz (a renamed zip of the contents of the .sdd) and then it would be placed in, for example on macOS the ~/.spring/games folder. Beside that, you need the engine at some (any) location, and at least one map downloaded to the ~/.spring/maps directory

Disclaimer: These paths are different on Windows!

If a single .exe is absolutely necessary, I'm not sure this is possible to achieve with Spring. (But wait to see what the people who actually know what they're talking about say – I just play one of the games)
Note that games will pretty much only be single-player without SL (although, technically otherwise is possible, just not particularly easy, it's not recommended to play MP without a lobby)

@ devs – is it possible that one could modify the engine to store the game & map inside its executable (as .sdz or whichever), and instead of taking a start script pointing to a map, it already knows where the map and game are, number of AIs etc.
How much work would this be?
Is it simple enough that someone like me could pitch in to make it possible (if it's not already)?
(With a bit of guidance, I think I'd be able to write decent C++ code)

More questions…
How much work would it to be to, instead of simply booting straight into the game, start by loading up a Lua menu which lets you select map + number of AIs … (if AIs will work with ICE's game?)
(Acknowledging how much larger the file would have to be for a number of maps to be contained within it)
0 x

gajop
Moderator
Posts: 3023
Joined: 05 Aug 2009, 20:42

Re: COMPILE

Post by gajop » 14 Aug 2019, 01:33

ICE wrote:
13 Aug 2019, 19:53
I just need to make a Windows game in exe format, without any emulators.
Without springlobby.
Like in Unity3d and other engines.
Is it possible?
Sure, just rename spring.exe to MyGame.exe and setup a default startscript so your game gets launched. You can see how we've done it in one of our LD games: https://github.com/SpringCabal/Skeleton ... ies-scores
0 x

ICE
Posts: 18
Joined: 06 Aug 2019, 14:52

Re: COMPILE

Post by ICE » 14 Aug 2019, 18:38

Thanks, I did it!
One more question!
How to indicate the position of the unit at the beginning of the game on the map?
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10238
Joined: 24 Jan 2006, 21:12

Re: COMPILE

Post by PicassoCT » 14 Aug 2019, 22:13

Eh.. usually maps have default start positions.
If a lobby is used, the lobby createds a standardized configuration document that contains the startpositions..

You can of course supply this document yourself and modify it
0 x

MasterBel
Posts: 170
Joined: 18 Mar 2018, 07:48

Re: COMPILE

Post by MasterBel » 14 Aug 2019, 23:00

Last edited by MasterBel on 14 Aug 2019, 23:00, edited 1 time in total.
0 x

ICE
Posts: 18
Joined: 06 Aug 2019, 14:52

Re: COMPILE

Post by ICE » 15 Aug 2019, 11:04

Thanks to all!
0 x

Post Reply

Return to “Help & Bugs”