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 »

How to compile the game (EXE) under ubuntu?
Thank!
User avatar
MasterBel
Posts: 271
Joined: 18 Mar 2018, 07:48

Re: COMPILE

Post by MasterBel »

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
ICE
Posts: 18
Joined: 06 Aug 2019, 14:52

Re: COMPILE

Post by ICE »

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.
User avatar
MasterBel
Posts: 271
Joined: 18 Mar 2018, 07:48

Re: COMPILE

Post by MasterBel »

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. :)
ICE
Posts: 18
Joined: 06 Aug 2019, 14:52

Re: COMPILE

Post by ICE »

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.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: COMPILE

Post by gajop »

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
ICE
Posts: 18
Joined: 06 Aug 2019, 14:52

Re: COMPILE

Post by ICE »

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?
User avatar
MasterBel
Posts: 271
Joined: 18 Mar 2018, 07:48

Re: COMPILE

Post by MasterBel »

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)
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: COMPILE

Post by gajop »

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
ICE
Posts: 18
Joined: 06 Aug 2019, 14:52

Re: COMPILE

Post by ICE »

Thanks, I did it!
One more question!
How to indicate the position of the unit at the beginning of the game on the map?
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: COMPILE

Post by PicassoCT »

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
User avatar
MasterBel
Posts: 271
Joined: 18 Mar 2018, 07:48

Re: COMPILE

Post by MasterBel »

Last edited by MasterBel on 14 Aug 2019, 23:00, edited 1 time in total.
ICE
Posts: 18
Joined: 06 Aug 2019, 14:52

Re: COMPILE

Post by ICE »

Thanks to all!
Post Reply

Return to “Help & Bugs”