[Tutorial] Compiling the GZDoom source code with CMake

Discuss anything ZDoom-related that doesn't fall into one of the other categories.

[Tutorial] Compiling the GZDoom source code with CMake

Postby The Zombie Killer » Sat Jan 25, 2014 3:44 am

I recently (a few seconds ago as of this writing) compiled the GZDoom source code, and thought I'd write up a tutorial as the wiki page seemed a little outdated.

It uses some stuff from the wiki page, and Delyon's ModDB tutorial
It's probably pretty messy since I'm not very good at making tutorials.

Things that will be required (just dump it all into a folder somewhere)
NASM v2.0+ (2.11 linked)
FMOD Ex v4.26.36
Platform SDK
February 2010 DirectX SDK
CMake
Visual Studio Express 2013 for Windows Desktop
The GZDoom source code (put it in some directory like C:\GZDoomSrc\source)

1. Install Visual Studio Express 2013
2. Install NASM
3. Install FMOD Ex
4. Install the Platform SDK, but when prompted to choose what to install, ONLY choose the following (image from Delyon's tutorial):
Image
5. Install the DirectX SDK
6. Install and run CMake
7. In the box labeled "Where is the source code:" point it to the directory where you put the source code. (eg C:\GZDoomSrc\source)
8. In the box labeled "Where to build the binaries:" create a subdirectory in the path to the source code to contain the build files (eg C:\GZDoomSrc\source\Release)
9. Click the Configure button at the bottom of the window. If the build directory does not exist, it will ask to create it. Let it.
10. When asked which generator to use, pick "Visual Studio 12"
11. After it has finished configuring, most of it should be correct/already filled in, but some stuff might require changing:
Code: Select allExpand view
 CMAKE_BUILD_TYPE: This defaults to Debug. You probably want to change it to Release.
 DYN_FLUIDSYNTH: If you want support for fluidsynth.dll, check this.
 FMOD_INCLUDE_DIR: Make sure this points to *Where you installed FMOD*/api/inc
 FMOD_LIBRARY: Make sure this points to *Where you installed FMOD*/api/lib/libfmodex.a

12. If you changed any of the above items, click Configure again
13. Now press "Generate" and wait for it to complete.
14. Browse to "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include" and open up "intrin.h" in notepad.
15. Change the following two lines:
Code: Select allExpand view
__MACHINEI(unsigned char _interlockedbittestandset(long volatile *a, long b))
__MACHINEI(unsigned char _interlockedbittestandreset(long volatile *a, long b))

into:
Code: Select allExpand view
//__MACHINEI(unsigned char _interlockedbittestandset(long volatile *a, long b))
//__MACHINEI(unsigned char _interlockedbittestandreset(long volatile *a, long b))

16. Open up Visual Studio Express 2013, and open up "GZDoom.sln" which can be found in "C:\GZDoomSrc\Release" (do not use the one in C:\GZDoomSrc!)
17. Hit "F7" and wait for GZDoom to build. When it's done, the compiled binary should be located in "C:\GZDoomSrc\Release\Release"
Last edited by The Zombie Killer on Sat Jan 25, 2014 6:50 am, edited 9 times in total.
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: [Tutorial] Compiling the GZDoom source code with CMake

Postby Graf Zahl » Sat Jan 25, 2014 4:36 am

You can scrap the glheaders step. Those files are part of the GZDoom repo - they have been for some time now.

More importantly. do NOT(!!!) change the project settings in Visual Studio if it isn't absolutely necessary. Those will be reset each time CMake rebuilds them.
I also recommend against using VS 2010. I found it's by far the most inefficient compiler since 2005. Either use 2005 or 2013, those seem to generate the fastest code.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [Tutorial] Compiling the GZDoom source code with CMake

Postby The Zombie Killer » Sat Jan 25, 2014 4:48 am

Graf Zahl wrote:You can scrap the glheaders step. Those files are part of the GZDoom repo - they have been for some time now.

Thanks for the tip, I didn't know they had been put into the repo (well, obviously since I included that in the tutorial)
The wiki should probably be updated to reflect this.

Graf Zahl wrote:More importantly. do NOT(!!!) change the project settings in Visual Studio if it isn't absolutely necessary. Those will be reset each time CMake rebuilds them.

Again, thanks for the info

Graf Zahl wrote:I also recommend against using VS 2010. I found it's by far the most inefficient compiler since 2005. Either use 2005 or 2013, those seem to generate the fastest code.

In that case, I'll install 2013 and update the tutorial once I have it all set up for it.
EDIT: It appears that I need Windows 8 for VS2013. I'll stick with VS2010/2005 for now I guess.
EDIT2: It appears that CMake doesn't seem to like VS2005 on my PC, so to be on the safe side I've reverted the tutorial to use VS2010
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: [Tutorial] Compiling the GZDoom source code with CMake

Postby Siberian Tiger » Sat Jan 25, 2014 5:41 am

The Zombie Killer wrote:I recently (a few seconds ago as of this writing) compiled the GZDoom source code, and thought I'd write up a tutorial as the wiki page seemed a little outdated.


Why not update the article instead of making a forum topic - which will be outdated in a short time? I never understood why people think that making tutorials on the forums is the best alternative, - - when infact the Wiki provides better functionality for an article to be 'alive' for generations. When your forum post becomes obsolete, then more users will create a new topic on how to compile GZDoom, which will add more redundancy within the forum database and your post will still overlap other tutorials during searches - making it harder to know what is current and what is outdated.

Please consider updating the wiki article.
User avatar
Siberian Tiger
Siberian Tigers Rule All~!!!
 
Joined: 13 Jun 2009
Location: United States
Github ID: SibTiger
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: [Tutorial] Compiling the GZDoom source code with CMake

Postby The Zombie Killer » Sat Jan 25, 2014 6:05 am

I actually tried updating the article, but for some reason the wiki hates me and it won't actually change the page.
The forums were actually my last resort :p
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: [Tutorial] Compiling the GZDoom source code with CMake

Postby edward850 » Sat Jan 25, 2014 6:37 am

The Zombie Killer wrote:EDIT: It appears that I need Windows 8 for VS2013. I'll stick with VS2010/2005 for now I guess.

Huh?
Express 2013 for Windows Desktop wrote:System Requirements:
Supported operating systems
Windows 7 SP1 (x86 and x64)
User avatar
edward850
[netcode intensifies]
 
Joined: 20 Jul 2005
Location: New Zealand

Re: [Tutorial] Compiling the GZDoom source code with CMake

Postby The Zombie Killer » Sat Jan 25, 2014 6:47 am

Strangely enough, I have Windows 7 SP1 (x64), and when I tried to install it, it told me that it requires a newer version of Windows.
EDIT: I'm dumb. I was trying to get "For Windows" instead of "For Windows Desktop"
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: [Tutorial] Compiling the GZDoom source code with CMake

Postby edward850 » Sat Jan 25, 2014 6:55 am

There is actually a difference between "Visual Studio Express 2013 for Windows" and "Visual Studio Express 2013 for Windows Desktop". The non-desktop one (which ironically still runs on the desktop) has additional Metro development tools.
Edit: And I see you found out yourself. :P
User avatar
edward850
[netcode intensifies]
 
Joined: 20 Jul 2005
Location: New Zealand

Re: [Tutorial] Compiling the GZDoom source code with CMake

Postby Graf Zahl » Sat Jan 25, 2014 12:01 pm

edward850 wrote:There is actually a difference between "Visual Studio Express 2013 for Windows" and "Visual Studio Express 2013 for Windows Desktop". The non-desktop one (which ironically still runs on the desktop) has additional Metro development tools.
Edit: And I see you found out yourself. :P


Make that: "Visual Studio Express 2013 for Windows" is for Metro only. It not only requires Windows 8, it's also for Windows 8 toy apps only.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [Tutorial] Compiling the GZDoom source code with CMake

Postby edward850 » Sat Jan 25, 2014 6:53 pm

Really? Huh. I didn't think that would have been different between Express and Ultimate.
User avatar
edward850
[netcode intensifies]
 
Joined: 20 Jul 2005
Location: New Zealand

Re: [Tutorial] Compiling the GZDoom source code with CMake

Postby Graf Zahl » Sun Jan 26, 2014 3:36 am

There's two 2013 Express versions:

The useless one: Visual Studio Express 2013 for Windows

The good one: Visual Studio Express 2013 for Windows for desktop
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [Tutorial] Compiling the GZDoom source code with CMake

Postby imed » Sun Aug 10, 2014 2:57 pm

A little question here.

I have Windows Xp sp 3, and it seems like Visual Studio Express 2013 is not compatible.
¿Any compatible alternative?
imed
 
Joined: 05 Jul 2013

Re: [Tutorial] Compiling the GZDoom source code with CMake

Postby mallo » Sun Aug 10, 2014 3:18 pm

VS2010 I believe
User avatar
mallo
GO TO NEXT SECTOR.
 
Joined: 22 May 2010
Location: Once upon a land in a far off time

Re: [Tutorial] Compiling the GZDoom source code with CMake

Postby jpalomo » Sun Aug 10, 2014 3:22 pm

You will need an older program. I recommend VS 2005, since it can still compile ZDoom with the solution file included with the source. The link for 2005 should still be on the zdoom wiki page for compiling on Windows.
User avatar
jpalomo
 
Joined: 17 May 2010

Re: [Tutorial] Compiling the GZDoom source code with CMake

Postby phantombeta » Sun Aug 10, 2014 4:27 pm

What about VS2008?
I use it and it's pretty good IMO.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: Brazil, South America, Earth, Orion-Cygnus Arm, Milky Way
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Next

Return to General

Who is online

Users browsing this forum: No registered users and 3 guests