Transition to ZMusic as DLL

Here, developers communicate stuff that does not go onto the main News section or the front page of the site.
[Dev Blog] [Development Builds] [Git Change Log] [GZDoom Github Repo]

Moderator: GZDoom Developers

Transition to ZMusic as DLL

Postby Graf Zahl » Sat Feb 15, 2020 3:31 am

I just pushed a commit that completes the transition of the entire music playback code as a separate DLL.
This was done to avoid maintaining this code in separate project, both public and private.

The new project will still out of the box on Windows but you will now need to get the DLL from here, until these are available in GZDoom release packages.
For Linux and Mac users the following needs to be run before compiling GZDoom:

Code: Select allExpand view
git clone https://github.com/coelckers/ZMusic.git
cd ZMusic
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/../build_install ..
make install


You may have to delete your CMake cache and rebuild it for the changes to work because it may happen that the dependencies will not be fully updated.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Transition to ZMusic as DLL

Postby _mental_ » Sat Feb 15, 2020 4:22 am

Most likely, removal of cache is needed if you want to use CMAKE_PREFIX_PATH for ZMusic header and library discovery.
Code: Select allExpand view
cmake -DCMAKE_PREFIX_PATH=/path/to/build_install ...

Setting ZMUSIC_INCLUDE_DIR and ZMUSIC_LIBRARIES directly should not require this.
Code: Select allExpand view
cmake -DZMUSIC_INCLUDE_DIR=/path/to/build_install/include -DZMUSIC_LIBRARIES=/path/to/build_install/lib/libzmusic.so ... # Linux
cmake -DZMUSIC_INCLUDE_DIR=/path/to/build_install/include -DZMUSIC_LIBRARIES=/path/to/build_install/lib/libzmusic.dylib ... # macOS
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Transition to ZMusic as DLL

Postby Graf Zahl » Sat Feb 15, 2020 4:35 am

The problem I had was that the cache retained the old dependencies and I couldn't make it forget about them.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Transition to ZMusic as DLL

Postby MartinHowe » Sat Feb 15, 2020 9:47 am

OK, so how does this work? I tried building gzdoom on devuan this afternoon having not seen this post, did what the post says, but I still get this:

Code: Select allExpand view
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29")
CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
  Could NOT find ZMusic (missing: ZMUSIC_LIBRARIES ZMUSIC_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindZMusic.cmake:21 (find_package_handle_standard_args)
  src/CMakeLists.txt:20 (find_package)


is there some way to tell the gzdoom stuff where ZMusic is? Or is ZMusic expected to be in a specific relative path to gzdoom?
User avatar
MartinHowe
In space, no-one can hear you KILL an ALIEN
 
Joined: 11 Aug 2003
Location: Waveney, United Kingdom

Re: Transition to ZMusic as DLL

Postby Graf Zahl » Sat Feb 15, 2020 10:11 am

If all else fails you have to specify the path manually, I think _mental_ can give you better help, he wrote the script for the dependency.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Transition to ZMusic as DLL

Postby _mental_ » Sat Feb 15, 2020 10:12 am

MartinHowe wrote:is there some way to tell the gzdoom stuff where ZMusic is?

Read my post above, it's exactly about how to do this.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Transition to ZMusic as DLL

Postby Nash » Sat Feb 15, 2020 12:35 pm

Does the ZMusic DLL replace the lib*.dll files from previous distributions?
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Transition to ZMusic as DLL

Postby drfrag » Sat Feb 15, 2020 12:50 pm

Now when i try to compile with MinGW i get the following error:
Code: Select allExpand view
CMake Error at C:/DEV/cmake-3.12.4-win64-x64/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find ZMusic (missing: ZMUSIC_LIBRARIES ZMUSIC_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/DEV/cmake-3.12.4-win64-x64/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindZMusic.cmake:21 (find_package_handle_standard_args)
  src/CMakeLists.txt:20 (find_package)

Edit: it's compiling now.
Last edited by drfrag on Sat Feb 15, 2020 1:05 pm, edited 2 times in total.
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Github ID: drfrag666

Re: Transition to ZMusic as DLL

Postby Rachael » Sat Feb 15, 2020 12:51 pm

Nash wrote:Does the ZMusic DLL replace the lib*.dll files from previous distributions?
Simply adds to them, AFAIK.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Transition to ZMusic as DLL

Postby Graf Zahl » Sat Feb 15, 2020 1:10 pm

The existing DLLs will remain, it makes little sense to incorporate all that code into zmusic as well - all this did was to offload the entire music system into a reusable subproject.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Transition to ZMusic as DLL

Postby Nash » Sat Feb 15, 2020 1:12 pm

What's the difference between ZMusic.dll and ZMusicLite.dll and should I have both alongside gzdoom.exe?
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Transition to ZMusic as DLL

Postby Matt » Sat Feb 15, 2020 1:28 pm

Okay I have no idea what the hell I'm doing.

Is there a completely idiot-proof step by step way of getting the new dev versions to compile?
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Transition to ZMusic as DLL

Postby lowskill. » Sat Feb 15, 2020 1:32 pm

Nash wrote:What's the difference between ZMusic.dll and ZMusicLite.dll and should I have both alongside gzdoom.exe?

The lite version is missing the other MIDI players I think.
User avatar
lowskill.
GZDoom RO Translator & Raze Tester
 
Joined: 05 Nov 2019
Twitch ID: sixhundredsixteen
Github ID: sinisterseed
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Transition to ZMusic as DLL

Postby Graf Zahl » Sat Feb 15, 2020 1:33 pm

Nash wrote:What's the difference between ZMusic.dll and ZMusicLite.dll and should I have both alongside gzdoom.exe?


No, the lite version is just the GPL free subset - in case someone wants to use this in a non-GPL project, e.g. Raze uses that because it cannot use GPL code with its licensing mess.


Matt wrote:Okay I have no idea what the hell I'm doing.
Is there a completely idiot-proof step by step way of getting the new dev versions to compile?


When it comes to compiling complex projects with dependencies there is no such thing as idiot-proof-ness.
Normally it should work if you follow _mental_*s instructions.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Transition to ZMusic as DLL

Postby Matt » Sat Feb 15, 2020 1:51 pm

Working now that I'm no longer trying to think of another thing I'm trying to do and can actually sit down and read and critically process instructions.

In case anyone else has a similar problem: Mental's "-DZMUSIC_INCLUDE_DIR=..." stuff is supposed to be added to the cmake command in Graf's OP not entered as a separate command.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Next

Return to Developer Blog

Who is online

Users browsing this forum: No registered users and 0 guests