Problems compiling ZDoom/old version of GZDoom on Linux

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE? Did your computer break? Ask here.

Moderator: GZDoom Developers

Problems compiling ZDoom/old version of GZDoom on Linux

Postby John Mendleville » Sun Dec 06, 2020 9:19 am

So I've been trying to successfully compile working copies of ZDoom and GZDoom 2.1.1 for the last few days with no real luck. I recently switched to Manjaro and have been trying to get all the Doom sourceports I use up and running. I've been able to successfully compile the most recent version of GZDoom and it works great. However, I like using ZDoom every now and again and I like to use GZDoom 2.1.1 for certain mods like Final Doomer and DoomRLA. However, I've run into the same problem trying to compile the source for both of these. Since these old versions require the fmod files, I run cmake like this:

cmake -DFMOD_LIBRARY=fmodapi44464linux/api/lib/libfmodex64-4.44.64.so -DFMOD_INCLUDE_DIR=fmodapi44464linux/api/inc

However, when I do that I get an error:

CMake Error at game-music-emu/CMakeLists.txt:90 (if):
if given arguments:

"(" "VERSION_GREATER" "4.1" ")" "OR" "(" "VERSION_EQUAL" "4.1" ")"

Unknown arguments specified

The issue seems to be the block of if statements in CMakeLists for game-music-emu that checks what version of gcc I'm using. I checked my package manager and I have 10.2.0-3. Now this might have been a bad idea, but I ended up just commenting out this whole block in the file and trying again. After doing this, cmake was successful and I was able to run make. This was the case for both ZDoom and GZDoom 2.1.1. However, now when I try running either ZDoom or GZDoom 2.1.1, I get no music in either one unless I switch the MIDI device to OPL Synth Emulation (other sounds work fine). This kind of sounds terrible, and would prefer to use something like Timidity++, which is the device that is set by default. Every other Midi device in sound options shows an error in the ZDoom/GZDoom console. When I run ZDoom I get messages in the terminal like:

No instrument mapped to tone bank 0, program 29 - this instrument will not be heard

Which sounds like maybe it can't find a soundfont? I have however tried placing gzdoom.sf2 in several of the directories shown in the .ini specifying where it looks for soundfonts but with no luck. Basically I'm wondering if anybody can help me out with getting proper music in both ZDoom and GZDoom 2.1.1. Is what I did in game-music-emu's CMakeLists.txt what might have caused this? Or is there a solution I can use with the versions I've already compiled? I'd appreciate any help, thanks.
John Mendleville
 

Re: Problems compiling ZDoom/old version of GZDoom on Linux

Postby Graf Zahl » Sun Dec 06, 2020 9:49 am

The entire sound setup in these old versions is very different from what's there now. This code was totally overhauled and made more user friendly for the 3.x versions.
First, Timidity++ back then was using an external version to pipe its output back to GZDoom, and therefore needed that external timidity executable set up properly. For FluidSynth you also need to specify a full path to a sound font via CVAR - and FMod itself needs to find gm.dls for its player to work.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Problems compiling ZDoom/old version of GZDoom on Linux

Postby ZibbidyZapps » Sun Dec 06, 2020 10:15 am

So would a possible solution be to compile timidity4zdoomsrc so I can get the executable and config file to put in zdoom/gzdoom's directory? Unfortunately I can't exactly use the windows executable since I'm on Linux.
ZibbidyZapps
 
Joined: 06 Dec 2020
Operating System: Other Linux 64-bit

Re: Problems compiling ZDoom/old version of GZDoom on Linux

Postby Graf Zahl » Sun Dec 06, 2020 11:13 am

It should be able to pick up a system-provided timidity++ executable on Linux.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Problems compiling ZDoom/old version of GZDoom on Linux

Postby ZibbidyZapps » Sun Dec 06, 2020 11:29 am

You're right, and the fix for my problem was as simple as telling Timidity where the gzdoom.sf2 soundfont was in its config file. Thanks for the help, cheers buddy.
ZibbidyZapps
 
Joined: 06 Dec 2020
Operating System: Other Linux 64-bit

Re: Problems compiling ZDoom/old version of GZDoom on Linux

Postby MartinHowe » Sun Jun 27, 2021 2:08 am

In case it helps anyone, the macro _gcc_version isn't defined in newer compilers. It can be replaced with CMAKE_C_COMPILER_VERSION (as I just did):

Code: Select allExpand view
# Check for GCC "visibility" support.
if (CMAKE_COMPILER_IS_GNUCXX)
   check_cxx_compiler_flag (-fvisibility=hidden __LIBGME_TEST_VISIBILITY)
   set (ENABLE_VISIBILITY OFF)
   if (__LIBGME_TEST_VISIBILITY)
      # get the gcc version
      exec_program(${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info)
      string (REGEX MATCH "[3-9]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}")

      # gcc <4.1 had poor support for symbol visibility
      if ((${CMAKE_C_COMPILER_VERSION} VERSION_GREATER "4.1") OR (${CMAKE_C_COMPILER_VERSION} VERSION_EQUAL "4.1"))
         set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
         set (ENABLE_VISIBILITY ON)
         add_definitions (-DLIBGME_VISIBILITY)

         # GCC >= 4.2 also correctly supports making inline members have hidden
         # visibility by default.
         if ((${CMAKE_C_COMPILER_VERSION} VERSION_GREATER "4.2") OR (${CMAKE_C_COMPILER_VERSION} VERSION_EQUAL "4.2"))
            set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
         endif()
      endif()
   endif() # test visibility
endif (CMAKE_COMPILER_IS_GNUCXX)
User avatar
MartinHowe
In space, no-one can hear you KILL an ALIEN
 
Joined: 11 Aug 2003
Location: Waveney, United Kingdom


Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 0 guests