The official "ZDoom on Linux" thread.

Handy guides on how to do things, written by users for users.

Moderators: GZDoom Developers, Raze Developers

Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
User avatar
MartinHowe
Posts: 2047
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom

Re: The official "ZDoom on Linux" thread.

Post by MartinHowe »

I haven't done any but trivial development on Unix for years (yes I said Unix not Linux, that should tell you how long ago) and never used CMake before (maybe it didn't exist in 2002) so there's a lot to learn. Just Plain old Make :) So to get people started, it would help if the Wiki instructions were up to date; it's much easier to learn this sort of thing by tinkering with a working build system. So the Wiki needs to include getting the other libraries and also gtk+ 3.0 (sorry forgot to mention that, as that is not present on a default install). This procedure was on a newly installed Linux Mint Cinnamon "Sarah" 18.

I am re-running the entire process from scratch (after the libraries already installed), starting with the fresh zdoom_build directory (I use a different location but paths are not the issue here) and this is what I get:

Code: Select all

make: *** No rule to make target 'clean'. Stop.
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found BZip2: /usr/lib/x86_64-linux-gnu/libbz2.so (found version "1.0.6") 
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so  
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") 
-- Found GME: /usr/lib/x86_64-linux-gnu/libgme.so  
-- Using system zlib, includes found at /usr/include
-- Using system jpeg library, includes found at /usr/include
-- Using system bzip2 library, includes found at /usr/include
-- Using system gme library, includes found at /usr/include
-- Looking for strdup
-- Looking for strdup - found
-- Looking for strndup
-- Looking for strndup - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of 0i8
-- Check size of 0i8 - failed
-- Check size of 0l
-- Check size of 0l - done
-- Check size of 0ll
-- Check size of 0ll - done
-- Check size of char
-- Check size of char - done
-- Check size of short
-- Check size of short - done
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of long long
-- Check size of long long - done
-- Check size of void *
-- Check size of void * - done
-- Check size of __int64
-- Check size of __int64 - failed
-- Looking for itoa
-- Looking for itoa - not found
-- Performing Test DUMB_CAN_USE_SSE
-- Performing Test DUMB_CAN_USE_SSE - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'gtk+-3.0'
--   Found gtk+-3.0, version 3.18.9
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found SDL2: /usr/lib/x86_64-linux-gnu/libSDL2main.a;/usr/lib/x86_64-linux-gnu/libSDL2.so;-lpthread  
-- Found OpenAL: /usr/lib/x86_64-linux-gnu/libopenal.so  
-- FMOD include files found at /home/martin/Games/System.Linux/ZDoom/zdoom/fmodapi42636linux64/api/inc
-- FMOD version: 0004.26.36
CMake Error at src/CMakeLists.txt:314 (message):
  Use of FMOD Ex 0004.26.36 with OpenAL will result in crashes.  Either
  update FMOD to 4.36 or later or set NO_OPENAL.


-- FMOD library found at /home/martin/Games/System.Linux/ZDoom/zdoom/fmodapi42636linux64/api/lib/libfmodex64-4.26.36.so
-- Found SndFile: /usr/lib/libsndfile.so  
-- Found MPG123: /usr/lib/libmpg123.so  
-- Found FluidSynth: /usr/lib/x86_64-linux-gnu/libfluidsynth.so  
-- Selected assembler: /usr/bin/as
-- Performing Test CAN_DO_CPP14
-- Performing Test CAN_DO_CPP14 - Success
-- Looking for filelength
-- Looking for filelength - not found
-- Looking for strupr
-- Looking for strupr - not found
-- Looking for stricmp
-- Looking for stricmp - not found
-- Looking for strnicmp
-- Looking for strnicmp - not found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Fluid synth libs: /usr/lib/x86_64-linux-gnu/libfluidsynth.so
-- Looking for FMOD_System_GetDriverCaps in /home/martin/Games/System.Linux/ZDoom/zdoom/fmodapi42636linux64/api/lib/libfmodex64-4.26.36.so
-- Looking for FMOD_System_GetDriverCaps in /home/martin/Games/System.Linux/ZDoom/zdoom/fmodapi42636linux64/api/lib/libfmodex64-4.26.36.so - found
-- Configuring incomplete, errors occurred!
See also "/home/martin/Games/System.Linux/ZDoom/zdoom/build/CMakeFiles/CMakeOutput.log".
See also "/home/martin/Games/System.Linux/ZDoom/zdoom/build/CMakeFiles/CMakeError.log".
Note the following:
*Lack of a "clean" target in Make.
*CMake Error at src/CMakeLists.txt:314 (message): Use of FMOD Ex 0004.26.36 with OpenAL will result in crashes. Either update FMOD to 4.36 or later or set NO_OPENAL.

I then open up src/CMakeLists.txt and set NO_OPENAL. When I rebuild, it works, issuing only some "uninitialised" warnings which are inevitable with a dev build.

I then use the git commands to get the current release version 2.8.1. This is after deleting the modified CMakeLists.txt file to avoid clashes.
Building this does NOT incur a warning about OpenAL, so clearly the current dev version is the one affected by it.
I now have a working release build of ZDoom.

I hope the devs and Wiki maintainers find this helpful :)
Blzut3
 
 
Posts: 3178
Joined: Wed Nov 24, 2004 12:59 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: The official "ZDoom on Linux" thread.

Post by Blzut3 »

NO_OPENAL can be set with cmake-gui, ccmake, or with -DNO_OPENAL=ON. No need to modify any files.

I'm not sure why the make clean line is there.

Only the dev builds produce the OpenAL error since the diagnostic was added recently. It's still relevant.
User avatar
MartinHowe
Posts: 2047
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom

Re: The official "ZDoom on Linux" thread.

Post by MartinHowe »

Thanks for that, cheers.

For Linux audio experts:

On a separate note, I keep getting warnings about fluidsynth not being able to pin sample data in memory - on a machine with 12GB physical RAM!
None of the usual fixes work: low-latency kernel, /etc/security/limits.d/martin.conf with priority 85 and unlimited memlock, adding myself to the audio group.
The music plays just fine, but these warnings are irritating.
Am I doing something extremely stupid here?
Blzut3
 
 
Posts: 3178
Joined: Wed Nov 24, 2004 12:59 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: The official "ZDoom on Linux" thread.

Post by Blzut3 »

As far as I know the fluidsynth thing would be something to ask on their mailing list (or whatever). It never bothered me and I don't think it's anything that ZDoom's doing.

I've simplified the wiki article to hopefully be easier to follow for first timers. I feel like the article got a bit on the verbose side and started to make compiling ZDoom look way more complicated than it actually is.
User avatar
MartinHowe
Posts: 2047
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom

Re: The official "ZDoom on Linux" thread.

Post by MartinHowe »

I actually came here this morning to thank whoever did that - so THANKS :D
Will give it a walk-through later today.

EDIT:
I couldn't wait :)

Works as is except that the ${a} needs removing in the next-to-last line shown below; the FMOD folder tree has both 64 and 32 bit versions and its name isn't suffixed with anything:

a='' && [ "$(uname -m)" = x86_64 ] && a=64
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DFMOD_LIBRARY="fmodapi44462linux/api/lib/libfmodex${a}-4.44.62.so" \
-DFMOD_INCLUDE_DIR="fmodapi44462linux${a}/api/inc" &&
make
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: The official "ZDoom on Linux" thread.

Post by Matt »

How do you load a mod that's in a folder with a space in its name? I've tried just typing as is and typing with a backslash before the space and neither works.
_mental_
 
 
Posts: 3819
Joined: Sun Aug 07, 2011 4:32 am

Re: The official "ZDoom on Linux" thread.

Post by _mental_ »

Vaecrius wrote:How do you load a mod that's in a folder with a space in its name? I've tried just typing as is and typing with a backslash before the space and neither works.
I'm using double quotes around a name. This is especially helpful if there are several characters in its path that need to be escaped.
Gez
 
 
Posts: 17934
Joined: Fri Jul 06, 2007 3:22 pm

Re: The official "ZDoom on Linux" thread.

Post by Gez »

Vaecrius wrote:How do you load a mod that's in a folder with a space in its name? I've tried just typing as is and typing with a backslash before the space and neither works.
zdoom "folder with spaces in its name/mod with spaces in its name.pk3" "another spaced folder/another spaced mod name.wad" "and a third why not/you get how it works I guess.zip"
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: The official "ZDoom on Linux" thread.

Post by Matt »

Apparently it wasn't working because I was trying to run this instead of gzdoom directly:

Code: Select all

#!/bin/bash
~/doom/./gzdoom $*
Is there any way to make this perform the same way?
_mental_
 
 
Posts: 3819
Joined: Sun Aug 07, 2011 4:32 am

Re: The official "ZDoom on Linux" thread.

Post by _mental_ »

It should be

Code: Select all

#!/bin/sh
~/doom/gzdoom "$@"
Consider to create an alias instead.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: The official "ZDoom on Linux" thread.

Post by Matt »

Sweet, thanks!

EDIT: seems I have to set them separately in bash and gmrun...
Elias79
Posts: 50
Joined: Mon Jan 30, 2017 6:09 am

Re: The official "ZDoom on Linux" thread.

Post by Elias79 »

Is Gzdoom discussion allowed here?
as i had some issues compiling it from scratch due to all the dependencies when having different versions of zdoom or gzdoom.
User avatar
Rachael
Posts: 13793
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: The official "ZDoom on Linux" thread.

Post by Rachael »

Yes.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: The official "ZDoom on Linux" thread.

Post by Matt »

I haven't had to do anything about dependencies in ages... what's missing?
Elias79
Posts: 50
Joined: Mon Jan 30, 2017 6:09 am

Re: The official "ZDoom on Linux" thread.

Post by Elias79 »

Vaecrius wrote:I haven't had to do anything about dependencies in ages... what's missing?
Many of those lol: https://aur.archlinux.org/packages/gzdoom/

The problem comes when i want to install more that one version using the package manager, and i failed compiling it from scratch.

Return to “Tutorials”