Header Image - Quake On LAN

AssaultCube Server on Raspberry Pi

by RawShark
AssaultCube Server on Raspberry Pi

I don’t know how many threads I’ve read where people hit a brick wall with this, or how many pre-compiled binaries I’ve tried that gave segmentation faults, so I’m detailing here how I got it working myself, in case anyone wants to build their own for the experience of it.

First, you need the source code AND the game installed on your RPi. The source is on GitHub these days, but I’m a big fan of SourceForge, so I pulled it from there.

From here, you are pretty much following these instructions, apart from 3 major changes to actually get this working.

The game version we are using is 1.2.0.2 – change all download links appropriately. That’s Step 1.

When you’re done, compiling (see below) create the library link like this

sudo ln -s /usr/local/lib/libenet.so.2.1.0 /usr/lib/libenet.so.2

rather than how it’s done in the tutorial. Again, versions have change. That’s Step 2, but don’t do it just yet.

Now here’s the big one. When you run

sudo make server_install

the output will actually be

make -C ../enet all
make[1]: Entering directory '/home/pi/source/enet'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/pi/source/enet'
clang++	 -O3 -fomit-frame-pointer -Wall -fsigned-char -DSTANDALONE -I. -Ibot -I../enet/include -c -o crypto-standalone.o crypto.cpp
make: clang++: Command not found
Makefile:136: recipe for target 'crypto-standalone.o' failed
make: *** [crypto-standalone.o] Error 127

Whut? Okay, clang++ seems to be missing. Let’s install that (I’m on Raspbian here, so apt is my friend).

[email protected]:/home/pi/source/src# apt-get install clang-3.4
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libasound2-dev libavahi-client-dev libavahi-client3 libavahi-common-dev libdbus-1-dev libdrm-amdgpu1 libdrm-dev libdrm-exynos1 libdrm-freedreno1 libdrm-nouveau2 libdrm-omap1 libdrm-radeon1 libdrm-tegra0 libegl1-mesa-dev libelf1
  libelfg0 libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libgles2-mesa libgles2-mesa-dev libglib2.0-bin libglib2.0-dev libglu1-mesa libglu1-mesa-dev libice-dev libllvm3.7 libpcre3-dev libpcrecpp0 libpthread-stubs0-dev
  libpulse-dev libpulse-mainloop-glib0 libsm-dev libtxc-dxtn-s2tc0 libudev-dev libwayland-dev libx11-dev libx11-doc libx11-xcb-dev libxau-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0 libxcb-glx0-dev libxcb-present-dev
  libxcb-randr0 libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb1-dev libxcursor-dev libxdamage-dev libxdamage1 libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev
  libxkbcommon-dev libxrandr-dev libxrender-dev libxshmfence-dev libxss-dev libxt-dev libxt6 libxv-dev libxv1 libxxf86vm-dev mesa-common-dev x11proto-core-dev x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev
  x11proto-input-dev x11proto-kb-dev x11proto-randr-dev x11proto-render-dev x11proto-scrnsaver-dev x11proto-video-dev x11proto-xext-dev x11proto-xf86vidmode-dev x11proto-xinerama-dev xorg-sgml-doctools xtrans-dev
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  binfmt-support libclang-common-3.4-dev libclang1-3.4 libffi-dev libjsoncpp0 libllvm3.4 libobjc-4.9-dev libobjc4 libtinfo-dev llvm-3.4 llvm-3.4-dev llvm-3.4-runtime
Suggested packages:
  gnustep gnustep-devel clang-3.4-doc llvm-3.4-doc
The following NEW packages will be installed:
  binfmt-support clang-3.4 libclang-common-3.4-dev libclang1-3.4 libffi-dev libjsoncpp0 libllvm3.4 libobjc-4.9-dev libobjc4 libtinfo-dev llvm-3.4 llvm-3.4-dev llvm-3.4-runtime
0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded.
Need to get 35.4 MB of archives.
After this operation, 151 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libllvm3.4 armhf 1:3.4.2-13 [5,832 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main libobjc4 armhf 4.9.2-10 [93.3 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main libobjc-4.9-dev armhf 4.9.2-10 [344 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ jessie/main libclang1-3.4 armhf 1:3.4.2-13 [2,956 kB]
Get:5 http://mirrordirector.raspbian.org/raspbian/ jessie/main binfmt-support armhf 2.1.5-1 [49.1 kB]
Get:6 http://mirrordirector.raspbian.org/raspbian/ jessie/main libclang-common-3.4-dev armhf 1:3.4.2-13 [138 kB]
Get:7 http://mirrordirector.raspbian.org/raspbian/ jessie/main clang-3.4 armhf 1:3.4.2-13 [15.9 MB]
Get:8 http://mirrordirector.raspbian.org/raspbian/ jessie/main libffi-dev armhf 3.1-2 [152 kB]                                                                                                                                              
Get:9 http://mirrordirector.raspbian.org/raspbian/ jessie/main libtinfo-dev armhf 5.9+20140913-1 [65.4 kB]                                                                                                                                  
Get:10 http://mirrordirector.raspbian.org/raspbian/ jessie/main llvm-3.4-runtime armhf 1:3.4.2-13 [44.8 kB]                                                                                                                                 
Get:11 http://mirrordirector.raspbian.org/raspbian/ jessie/main llvm-3.4 armhf 1:3.4.2-13 [955 kB]                                                                                                                                          
Get:12 http://mirrordirector.raspbian.org/raspbian/ jessie/main libjsoncpp0 armhf 0.6.0~rc2-3.1 [61.1 kB]                                                                                                                                   
Get:13 http://mirrordirector.raspbian.org/raspbian/ jessie/main llvm-3.4-dev armhf 1:3.4.2-13 [8,807 kB]                                                                                                                                    
Fetched 35.4 MB in 20s (1,689 kB/s)                                                                                                                                                                                                         
Selecting previously unselected package libllvm3.4:armhf.
(Reading database ... 34744 files and directories currently installed.)
Preparing to unpack .../libllvm3.4_1%3a3.4.2-13_armhf.deb ...
Unpacking libllvm3.4:armhf (1:3.4.2-13) ...
Selecting previously unselected package libobjc4:armhf.
Preparing to unpack .../libobjc4_4.9.2-10_armhf.deb ...
Unpacking libobjc4:armhf (4.9.2-10) ...
Selecting previously unselected package libobjc-4.9-dev:armhf.
Preparing to unpack .../libobjc-4.9-dev_4.9.2-10_armhf.deb ...
Unpacking libobjc-4.9-dev:armhf (4.9.2-10) ...
Selecting previously unselected package libclang1-3.4:armhf.
Preparing to unpack .../libclang1-3.4_1%3a3.4.2-13_armhf.deb ...
Unpacking libclang1-3.4:armhf (1:3.4.2-13) ...
Selecting previously unselected package binfmt-support.
Preparing to unpack .../binfmt-support_2.1.5-1_armhf.deb ...
Unpacking binfmt-support (2.1.5-1) ...
Selecting previously unselected package libclang-common-3.4-dev.
Preparing to unpack .../libclang-common-3.4-dev_1%3a3.4.2-13_armhf.deb ...
Unpacking libclang-common-3.4-dev (1:3.4.2-13) ...
Selecting previously unselected package clang-3.4.
Preparing to unpack .../clang-3.4_1%3a3.4.2-13_armhf.deb ...
Unpacking clang-3.4 (1:3.4.2-13) ...
Selecting previously unselected package libffi-dev:armhf.
Preparing to unpack .../libffi-dev_3.1-2_armhf.deb ...
Unpacking libffi-dev:armhf (3.1-2) ...
Selecting previously unselected package libtinfo-dev:armhf.
Preparing to unpack .../libtinfo-dev_5.9+20140913-1_armhf.deb ...
Unpacking libtinfo-dev:armhf (5.9+20140913-1) ...
Selecting previously unselected package llvm-3.4-runtime.
Preparing to unpack .../llvm-3.4-runtime_1%3a3.4.2-13_armhf.deb ...
Unpacking llvm-3.4-runtime (1:3.4.2-13) ...
Selecting previously unselected package llvm-3.4.
Preparing to unpack .../llvm-3.4_1%3a3.4.2-13_armhf.deb ...
Unpacking llvm-3.4 (1:3.4.2-13) ...
Selecting previously unselected package libjsoncpp0.
Preparing to unpack .../libjsoncpp0_0.6.0~rc2-3.1_armhf.deb ...
Unpacking libjsoncpp0 (0.6.0~rc2-3.1) ...
Selecting previously unselected package llvm-3.4-dev.
Preparing to unpack .../llvm-3.4-dev_1%3a3.4.2-13_armhf.deb ...
Unpacking llvm-3.4-dev (1:3.4.2-13) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for systemd (215-17+deb8u4) ...
Processing triggers for install-info (5.2.0.dfsg.1-6) ...
Setting up libllvm3.4:armhf (1:3.4.2-13) ...
Setting up libobjc4:armhf (4.9.2-10) ...
Setting up libobjc-4.9-dev:armhf (4.9.2-10) ...
Setting up libclang1-3.4:armhf (1:3.4.2-13) ...
Setting up binfmt-support (2.1.5-1) ...
Setting up libclang-common-3.4-dev (1:3.4.2-13) ...
Setting up clang-3.4 (1:3.4.2-13) ...
Setting up libffi-dev:armhf (3.1-2) ...
Setting up libtinfo-dev:armhf (5.9+20140913-1) ...
Setting up llvm-3.4-runtime (1:3.4.2-13) ...
Setting up llvm-3.4 (1:3.4.2-13) ...
Setting up libjsoncpp0 (0.6.0~rc2-3.1) ...
Setting up llvm-3.4-dev (1:3.4.2-13) ...
Processing triggers for libc-bin (2.19-18+deb8u4) ...
Processing triggers for systemd (215-17+deb8u4) ...

Now we should be able to compile! Let’s go…

[email protected]:/home/pi/source/src# sudo make server_install
make -C ../enet all
make[1]: Entering directory '/home/pi/source/enet'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/pi/source/enet'
clang++	 -O3 -fomit-frame-pointer -Wall -fsigned-char -DSTANDALONE -I. -Ibot -I../enet/include -c -o crypto-standalone.o crypto.cpp
make: clang++: Command not found
Makefile:136: recipe for target 'crypto-standalone.o' failed
make: *** [crypto-standalone.o] Error 127

Okay, what the actual f*ck? This was getting me nowhere fast. This is the same issue all those poor bastards on the forums ran into! Then it occurred to me, WHY use clang++ at all, when g++, the C++ compiler for the GNU compiler collection, is already present in Raspbian? Okay, so now swap out all instances of “clang++” from the Makefile:

[email protected]:/home/pi/source/src# sed -i "s/clang++/g++/g" Makefile

and try the compile again:

[email protected]:/home/pi/source/src# sudo make server_install

Here’s the output this time:

make -C ../enet all
make[1]: Entering directory '/home/pi/source/enet'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/pi/source/enet'
g++	 -O3 -fomit-frame-pointer -Wall -fsigned-char -DSTANDALONE -I. -Ibot -I../enet/include -c -o crypto-standalone.o crypto.cpp
crypto.cpp: In member function ‘void ecjacobian::normalize()’:
crypto.cpp:308:33: warning: array subscript is above array bounds [-Warray-bounds]
             digit tmp = x.digits[i+dig+1];
                                 ^
crypto.cpp:308:33: warning: array subscript is above array bounds [-Warray-bounds]
             digit tmp = x.digits[i+dig+1];
                                 ^
g++	 -O3 -fomit-frame-pointer -Wall -fsigned-char -DSTANDALONE -I. -Ibot -I../enet/include -c -o log-standalone.o log.cpp
g++	 -O3 -fomit-frame-pointer -Wall -fsigned-char -DSTANDALONE -I. -Ibot -I../enet/include -c -o protocol-standalone.o protocol.cpp
g++	 -O3 -fomit-frame-pointer -Wall -fsigned-char -DSTANDALONE -I. -Ibot -I../enet/include -c -o serverms-standalone.o serverms.cpp
g++	 -O3 -fomit-frame-pointer -Wall -fsigned-char -DSTANDALONE -I. -Ibot -I../enet/include -c -o server-standalone.o server.cpp
g++	 -O3 -fomit-frame-pointer -Wall -fsigned-char -DSTANDALONE -I. -Ibot -I../enet/include -c -o stream-standalone.o stream.cpp
g++	 -O3 -fomit-frame-pointer -Wall -fsigned-char -DSTANDALONE -I. -Ibot -I../enet/include -c -o tools-standalone.o tools.cpp
g++	 -O3 -fomit-frame-pointer -Wall -fsigned-char -DSTANDALONE -I. -Ibot -I../enet/include -c -o wizard-standalone.o wizard.cpp
g++	 -O3 -fomit-frame-pointer -Wall -fsigned-char -o ac_server crypto-standalone.o log-standalone.o protocol-standalone.o serverms-standalone.o server-standalone.o stream-standalone.o tools-standalone.o wizard-standalone.o -L../enet/.libs -lenet -lz
install -d ../../bin_unix/
install -m755 ac_server ../../bin_unix/native_server

Much success! The warnings seem to be just that, warnings, and the binary has still compiled for us. Navigating up to the bin_unix directory, copy the native_server file to /usr/local/games/cube/bin_unix/ (or wherever you put the game directory) and make sure it is executable. Don’t forget to link your libraries like in Step 2 above.

AssaultCube server will now run on your Raspberry Pi. Happy happy, joy, joy! If you’re too lazy to carry out the above, you can download our build below.You will need an SD Card of at least 2GB capacity.

Download Now

RawShark has been dabbling in all things Quake since day one. He has reviewed maps, written mods, hosted servers, hacked code and even played a few games. These days he comes up with solutions for people sitting at home yearning for a blast from the past…



Quake On LAN is in no way affiliated with id Software.