How to get BlitzMax running on AMD64

Archives Forums/Linux Discussion/How to get BlitzMax running on AMD64

TrickyRic(Posted 2007) [#1]
It's not perfect, but I've managed to get BlitzMax running on my AMD64 system!

I use Gentoo GNU/Linux which, being source based and entirely optimised for the host system, provides the best 64bit compatibility of any GNU/Linux system. These instructions are Gentoo proprietary but I expect similar distributions provide compatibility libs too.

1. First off you need BlitzMax. No need to run any installers, just extract the files to a directory. I chose /home/trickyric/Programming/BlitzMax to avoid the possibility of file access restrictions. At the time of this writing 1.18 is the current full package, with 1.24 being the current update, so while you're at it you may as well extract the update file in there too - though note you cannot run it at this stage.

2. BlitzMax requires some 32bit development libs for both its compiler and updater to function. It also requires 32bit OpenGL libs for the graphical and sound processing. Since you're running AMD64, chances are you have 64bit libs instead. Gentoo however provides some nifty compatibility libs to emerge.

I emerged emul-linux-x86-compat and emul-linux-x86-sdl to get my system going, but I already had other compatibility libs present which may also be needed. Compat provides things like the libstdc++ library and sdl provides the simple directmedia libraries for OpenGL. Other libs I expect are needed that were already present on this system are emul-linux-x86-baselibs, emul-linux-x86-soundlibs, and emul-linux-x86-xlibs. I also have emul-linux-x86-gtklibs, emul-linux-x86-medialibs, and emul-linux-x86-qtlibs which I doubt are required but worth noting just in case.

3. Finally, BlitzMax has been hard coded to look for g++ 3.3. Why? No idea, perhaps because the developers can't be sure more recent versions provide the exact same functionality? 3.3 is masked as unstable in Gentoo's portage tree for AMD64, so it wouldn't be advised to install. Instead it's common practice to place a symlink to your current version. On AMD64 this is a little trickier but trial and error suggests /usr/x86_64-pc-linux-gnu/gcc-bin/<current version>/x86_64-pc-linux-gnu-g++ is the best place to point to. At the time of this writing 4.1.2 is the current stable, so that's where I'm pointing.

# ln -s /usr/x86_64-pc-linux-gnu/gcc-bin/4.1.2/x86_64-pc-linux-gnu-g++ /usr/bin/g++-3.3

4. With the compatibility libs installed and a symlink tricking BlitzMax into thinking g++ 3.3 is on the system, all should now work. Run the update you copied accross to update the software, and attempt to run and build a BlitzMax sample.

Note that for me, BlitzMax still returns "Skipping incompatible..." errors during build, but these errors don't appear to effect execution. I can only assume the linker is first finding the 64bit libs, skipping them, and then finding the 32bit compatibility libs we installed. Thus while your output will most likely dump an array of errors, they're all safe to ignore. Any confirmation of this would be appreciated.

Have fun with BlitzMax on AMD64!


TrickyRic(Posted 2007) [#2]
With the release of 1.26, I've just discovered that although the G++ 3.3 symlink works for general compiling, it doesn't work for the rebuilding of modules, ("Rebuild All Modules" from the Program menu). Not hugely important, but worth noting.


D4NM4N(Posted 2007) [#3]
Good to know, ive been scared of 64bit in both linux and windows as ive herd so many bad stories about it.
Next time i have to install linux I may try the 64 bit version. (which may be a while cos it doesnt break easy :)


TrickyRic(Posted 2007) [#4]
There's nothing remotely 'scary' about 64bit, though you should note that a closed source operating system such as Windows will never perform to the extent that GNU/Linux can as both the operating system and it's compatible software are built generically, so as to maintain a safe degree of reliability across the various x86 architectures its users are likely to host. Open source software such as GNU/Linux can be compiled from the ground up, specifically for the individual user system. This doesn't just apply to AMD64 performance, but to performance as a whole. The performance difference between Windows on AMD64 and GNU/Linux on AMD64 is very noticable though, mainly due to the large quantity of Windows based softwares that are still built and distributed as 32bit binary, for compatibility reasons.

While near all GNU/Linux distributions offer both x86 and x86_64 packages today, if you want to take advantage of true 64bit performance, source based distributions such as Gentoo or Slackware are the only real choice. These distributions are built from scratch, specifically for your architecture. A system such as Gentoo, if correctly configured, will take complete advantage of your hardware capabilities where pre-built RPM based distributions or distributions using installation wizards and auto configuration scripts will build packages based on safe, generic configurations known to work on all setups.

Whats more, a distribution such as Gentoo provides you with the core GNU environment from which to build on, leaving it up to you exactly what features are compiled into exactly what software you choose, and again this applies from the ground up. While a distribution such as Gentoo may not be suited to those freshly migrating to GNU/Linux, it offers complete control over a bloat-free environment where resources are not consumed by features you'll never use, software you don't want, or generically configured compilers.


TrickyRic(Posted 2007) [#5]
For the record, since posting this thread I've compiled BlitzMax software via this 64bit system and tested under another 32bit system without any of the Blitz development libraries, and the binary ran fine. This tells me that the 32bit compiler emulation is working as expected, and is not merely producing a 64bit binary.

Yay!