Home
Products
Community
Manuals
Contact
Login or Signup

BlitzMax on Ubuntu 12.04

Miscellaneous Forums/Linux Discussion/BlitzMax on Ubuntu 12.04

dawlane(Posted 1+ years ago) #1
Greetings to all. It's been a while since I've played around with Ubuntu and now it's at version 12.04, so I thought I would have a bash at getting BlitzMax to work with it.

I've found out there have been a few changes regarding the 64bit version as the usual ia32-libs package is being replaced with a new method of dealing with 32bit application on a 64bit system. The /usr/libs32 directory is still there, but there are very few libs left in there as now they reside in /usr/lib/i386-linux-gnu when the new ia32-libs-mutiarch package is installed.
One problem I've had is sound out of the box; but I've got sound working by using skidracers pulse-audio driver or you can now use the fixed ALSA driver.

So to start with I used a clean install of Ubuntu 12.04(64bit) and using BlitzMax 1.48. An upgraded from a earlier version of Ubuntu could be a bit of a mess.

First we install the packages using a terminal.

sudo apt-get install ia32-libs-multiarch g++-multilib build-essential
sudo apt-get install libglu1-mesa-dev x11proto-core-dev x11proto-gl-dev x11proto-kb-dev libxxf86vm-dev libasound2-dev libfreetype6-dev libxpm-dev libxft-dev

Ubuntu doesn't need the next line but if your using another debian based distro or you get errors then try.
sudo apt-get update

Then try to install the packages again.

Next we need some symbolic links to the libs that we need to use.
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib32/libGL.so
sudo ln -s /usr/lib/i386-linux-gnu/libGLU.so.1 /usr/lib32/libGLU.so
sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib32/libX11.so
sudo ln -s /usr/lib/i386-linux-gnu/libfreetype.so.6 /usr/lib32/libfreetype.so
sudo ln -s /usr/lib/i386-linux-gnu/libXxf86vm.so.1 /usr/lib32/libXxf86vm.so
sudo ln -s /usr/lib/i386-linux-gnu/libXft.so.2 /usr/lib32/libXft.so
sudo ln -s /usr/lib/i386-linux-gnu/libXpm.so.4 /usr/lib32/libXpm.so

If you compile and you get can't find such and such due to an update ect, then use the method above to create a symbolic link by first finding the actual target libs true name. The symbolic's links usually the targets name with every thing to the right of the .so removed.
Note if things break after an update use the rm command to remove the current broken link e.g. sudo rm /usr/lib/libfreetype.so and then redo the link with the updated version of that .so file.

Ok you should now be able to compile the sample files that come with BMax. But you may not get sound.

The sound issue.
As I haven't got the time to look deeply into this. I used skidracer's pulse audio driver as an alternative.
Here's the link read it through. skid's also also fixed the ALSA driver as well. See here for details.
I actually put these files into path_to_blitzmax/mod/pub.mod/freeaudio.mod
Then rebuild all the modules.

All you need to do is add another symbolic link if your using the pulse audio driver.
sudo ln -s /usr/lib/i386-linux-gnu/libpulse-simple.so.0.0.3 /usr/lib32/libpulse-simple.so
or for ALSA
sudo ln -s /usr/lib/i386-linux-gnu/libasound.so.2.0.0 /usr/lib32/libasound.so
and you should have sound.

Use the following to install the dependencies for the 32bit version of Ubuntu
sudo apt-get install g++ gcc build-essential
sudo apt-get install libglu1-mesa-dev x11proto-core-dev x11proto-gl-dev x11proto-kb-dev libxxf86vm-dev libasound2-dev libfreetype6-dev libxpm-dev libxft-dev
You will also need to follow one of skid's threads to get sound working.

Last edited 4 months ago


impixi(Posted 9 months ago) #2
Thanks. I had to follow this procedure to get BlitzMax working for Linux Mint 13 64-bit (MATE desktop). Skidracer's pulse audio driver also works nicely.


SystemError51(Posted 9 months ago) #3
I did those steps on 11.10 before, apps did segfault (but compiling fine). Will test again on 12.04.


dawlane(Posted 9 months ago) #4
@SystemError51:What GFX hardware are you using? And where does the segfault occur when you debug the code?
All the samples compile and run fine apart from when I try the GUI launcher sample then I get a segfault when it tries to create a FLT canvas.


SystemError51(Posted 9 months ago) #5
On Ubuntu 12.04 the above steps with all the multilibs etc, now seems to have fixed the problem. Programs compile and run fine.

Weird.


Grisu(Posted 8 months ago) #6
Can someone please describe how to get the audio driver running under Ubuntu 12.04 (32-Bit). - I can't create the symbolic links as mentioned in the #1 post.

Is Brucey's FMod module still usable under the latest Ubuntu distribution?
I get a segmentation fault, but this might be related to my general audio driver problem.




dawlane(Posted 8 months ago) #7
You shouldn't need a symbolic link for any 32bit OS. The two links in the first post are for the 64bit OS versions only.

The pulse audio drive isn't installed by default in Ubuntu 12.04. And the current version of BlitzMax's oss/alsa audio driver doesn't work. You have to either use skidracer's pulse audio driver or the fix that skidracer has done for the alsa driver and then rebuild the modules. Links are in the first post.

If your getting a segfault see if it's any of the maxGUI code, for some reason the gui launcher caused this to happend to me (I suspect FLT Canvas has something to do with it).


Grisu(Posted 8 months ago) #8
Thanks, got the alsa driver and Fmod working now. Can't these fixes be added to the official distribution?

MaxGUI has massive problems with the WINDOW_HIDDEN flag as well as Hide and Showgadget(), these caused segmentation faults for me.


dawlane(Posted 8 months ago) #9
MaxGUI has massive problems with the WINDOW_HIDDEN flag as well as Hide and Showgadget(), these caused segmentation faults for me.
The are a few posts in the MaxGUI bug section about this.


Dinosorceror(Posted 6 months ago) #10
I've just updated my Linux Mint, and now BlitzMax projects won't compile anymore. I had gotten it to work for quite a few updates with the instructions in this post, but now when I try to compile anything, I get an error near the end. The error is:

/usr/bin/ld: cannot find -lGLU

Here's a example of me trying to compile Digesteroids:


Building digesteroids
Compiling:simplephysics.bmx
flat assembler version 1.68 (32768 kilobytes memory)
4 passes, 57473 bytes.
Compiling:minitimer.bmx
flat assembler version 1.68 (32768 kilobytes memory)
3 passes, 5416 bytes.
Compiling:dynamicgame.bmx
flat assembler version 1.68 (32768 kilobytes memory)
3 passes, 11278 bytes.
Compiling:MathUtil.bmx
flat assembler version 1.68 (32768 kilobytes memory)
3 passes, 6542 bytes.
Compiling:digesteroids.bmx
flat assembler version 1.68 (32768 kilobytes memory)
4 passes, 152908 bytes.
Linking:digesteroids.debug
/usr/bin/ld: cannot find -lGLU
collect2: ld returned 1 exit status
Build Error: Failed to link /home/xo4/BlitzMax/samples/digesteroids/digesteroids.debug
Process complete


Dinosorceror(Posted 6 months ago) #11
Oh, I'm betting I need to update one of those symbolic links, and I see which one. I'll give it a shot.


Dinosorceror(Posted 6 months ago) #12
Yep, that did it. I had to issue the following commands:

sudo rm /usr/lib32/libGLU.so
sudo ln -s /usr/lib/i386-linux-gnu/libGLU.so.1.3.08004 /usr/lib32/libGLU.so

...since that GLU library updated from 08000 to 08004. Compiling works again!


Dinosorceror(Posted 5 months ago) #13
Okay, now I've rebuilt a box with Ubuntu 12.10 (64-bit), and I can't even get the IDE to run at all. Before I start putting the dependencies back for compilation, this doesn't seem right. Back when I opened the BlitzMAX archive in Mint, the IDE would run, but I needed to follow the steps for compilation. Now the IDE won't run at all? Does that seem weird to anyone else?


Dinosorceror(Posted 5 months ago) #14
Hrm, guess I did need to do those dependencies just to run the IDE. I'm going to make a fresh post about Ubuntu 12.10 64-bit for reference in the future, including how to get the PulseAudio working.