Compile in 64 bit under Windows?

Monkey Targets Forums/Desktop/Compile in 64 bit under Windows?

[VOLOFORCE](Posted 2017) [#1]
Hi,

I've heard this is possible. But I am pretty much a noob in that regard, I've tried some stuff but it doesn't compile so far. The problem is that I am trying to load insane map sizes into my strategy game and 32 bit ends processes at 2 GB, so I need more. Can someone guide me step by step? What files do I have to download? Already got TDM64...

Would be nice!


dawlane(Posted 2017) [#2]
Yes it is possible, but you will need to do a few things:

First
The most important thing is you need a 64 bit operating system or you will not be able to test.
The you will need a 64 bit cross compiler. TDM 5.x+ will do, but there is a known bug that stops it from using .LIB files. You will find some of these type of files in the directory MonkeyX/targets/glfw3/template/openal/libs. So these need to be removed, the directories renamed, or the gcc_winnt makefile altered as to not search in those locations (see the bit below).
You will also have to modify the config.winnt.txt in the MonkeyX bin directory and change the MINGW_PATH variable to point to the location of the newly installed TDM compiler.
You will also have to make a few changes to the makefile in MonkeyX/targets/glfw3/template/gcc_winnt if you wish to compile any application as a 32 bit executable.
You do this by adding the -m32 compiler option switch to CPPFLAGS and LDFLAGS. You can also remove the -L options for openal/lib: leaving the openal/dll should be OK.
If you have Visual studio and know how to set up the solution files to compile for x64 then it's not such a problem if you edit the template solution in MonkeyX/targets/glfw3/template/msvc.

Second
You will need a 64 bit version of the OpenAL dynamic link library installed. You can copy the ones from the templates in the OpenAL directory mentioned above, or download the OpenAL-soft version from http://kcat.strangesoft.net/openal.html. You will find that there are some pre-built binaries for Windows 32/64 bit that you can manually install to your system, but you have to make sure that the they are in the correct directory of Windows/System/32 for the library architecture and both have the name of OpenAL32. There is nothing stopping you from adding the dll in the final application directory when you are ready to distribute it.

But the real thing you should be thinking about is "Do I really need such large map files in the first place". Can they be optimised or pre-loaded in sections before use.


Gerry Quinn(Posted 2017) [#3]
Indeed - how will the poor AI be able to cope, even just pathfinding?


[VOLOFORCE](Posted 2017) [#4]
That's a great reply, dawlane. What do you mean by:

but you have to make sure that the they are in the correct directory of Windows/System/32 for the library architecture and both have the name of OpenAL32


So I am re-naming the *.dll's and then put it where exactly? The System32 dir?

I cannot test it right now, so... well, there are a few grids, so a lot of ram is used on big maps. I do not want the program to abort accidentially, I am mostly testing stuff right now.


dawlane(Posted 2017) [#5]
Both DLLs need the name OpenAL32. The 64 bit version if I remember needs to go into Windows/System32 and the 32 bit version in Windows/SysWOW64 or create a system environment variable to include the locations in the system PATH variable. There should be plenty of tutorials on how to add additional system variable.
There is a caveat with putting those DLL directly into the system directories. Some programs expect to find the Creative Labs version installed and there are some inconsistencies between OpenAL-soft and the Creative release. As far as I am aware, there is no 64 bit version of the Creative Labs version of OpenAL. There are claims that there exists a 2.0 version for download, but the state nor the security of it cannot be confirmed.


EdzUp(Posted February) [#6]
Not to hijack the thread or anything is it the same for Linux and OSX I heard they were 64bit already? IIRC only windows has 32bit variants for backwards compatibility.

Ubuntu 16.04+ apparently will not have a 32bit release and OSX went 64bit only ages ago.


dawlane(Posted February) [#7]
A few Linux distributions are 64 bit only, so you would be unable to compile any apps to 32 bit, but Ubuntu is still 32 and 64 bit. You can access both 32 bit and 64 bit distribution ISO files and Network install via alternative downloads and use one of the mirrors.

And from a 64 bit Linux distribution, all it takes in most cases to build for both 64 bit and 32 bit is to install GCC multilib with both the the 32 bit and 64 bit run-time libraries, along with the 64 bit development libraries and a few system links for the 32 bit support. Then do a bit of makefile editing to add the aforementioned compiler flag. Hell, if you know what you are doing, with a few changes to transcc you can set up the system to do cross compiling with the Linux MinGW cross compiler or any other cross compiler.
It should be noted that for near maximum compatibility a Long Term Support distribution should be used and not what is in fact a testing branch or rolling release.

OS X has been 64 bit since Lion, but I don't know for sure if they have finally put the nail into the coffin for legacy 32 bit OS X applications or dropped 32 bit compilation from XCode, as I cannot install Sierra. But you can take it as read that you end up with 64 bit binary applications by default, as all new Apple devices have headed in that direction.

As for Windows, you need to see a tool to read the PPE header. But I would guess that it's a mish-mash of 32 bit and 64 bit with parts of the tools being compiled with BlitzMax. What you compile to depends on the compiler and it's flags.


EdzUp(Posted February) [#8]
ah OK

I read on conical website that the 32bit is gonna be dropped as of 16.04

OSX iirc don't accept 32bit apps to the store now


dawlane(Posted February) [#9]
I read on conical website that the 32bit is gonna be dropped as of 16.04
Apparently support for 32 bit will be completely gone after 18.10 and anyone wanting to still use 32 bit applications would have to hope that someone makes a SNAPS package for it. Those LTS versions already released will be supported until 2023-ish.

For those still using 32 bit PPC's there will be no new ISO images available from 17.04 from what I have read.