BlitzMax on Debian 7

Archives Forums/Linux Discussion/BlitzMax on Debian 7

dawlane(Posted 2012) [#1]
Greetings to all.

This tutorial should get you up and running with Debian 7 (aka Wheeze). As this version is still marked as testing it could be subject to change, but it's current status is frozen so there should be no new packages being added only bug fixes and soon (depending on the debian team's testing time) will become the main stable version. And by that time the Linux world will have moved on to something new.

You can get the Wheeze ios images from here. The instructions below used the weekly build DVD and so some of the system links may change.

The 32bit version should use the same install method as the 32bit version of Ubuntu 12.04.

The rest of this tutorial is for the 64bit version.

If you've come looking for how to install BlitzMax on the stable branch of Debian (6 aka Squeeze) 64bit then your out of luck unless you are prepared to mess around building the newest version of dpkg and possibly other files. If you do and are successful then the following procedures should be valid.

First things first were going to need to be root, luckily there should be a root terminal in Application->Accessories. If not find out how you can be added to the sudoers list by searching the web and add sudo before each apt-get. E.G. sudo apt-get install anything-you-want.

To ensure that there are no errors during the next phase you have to open the Synaptic Package Manager (Applications->System Tools->Administrator->Synaptic Package Manager) and remove the DVD repository found in the Settings->Repositories->Other Software dialog tab, un-check cdrom.
Note if you used the small net install cd you don't need to do this.

Now you need to let dpkg know that we want to add another architecture, in our case it's i386. And also make sure that the repositories also search for the i386 versions.
NOTE:You may not need to do the next bit if you downloaded the Multi-Arch iso cd as it should be setup.
dpkg --add-architecture i386
sed -i 's/deb\ /deb\ [arch=amd64,i386]\ /g' /etc/apt/sources.list
apt-get update


Now lets install the the required libraries first as this would remove the build tools if we installed them first.
apt-get install libglu1-mesa-dev:i386 x11proto-core-dev:i386 x11proto-gl-dev:i386 x11proto-kb-dev:i386 libxxf86vm-dev:i386 libasound2-dev:i386 libfreetype6-dev:i386 libxpm-dev:i386 libxft-dev:i386
A thing to note here is that these are the 32bit development libraries which will remove the 64bit versions. Like wise if you install the 32bit libraries then the 64bit versions will be removed. This should not effect any binary files that were installed only the system links should be effected.

Now lets install the build tools.
apt-get install g++-multilib build-essential


As we have directly used the i386 versions of the development lib's we can just build and go, but if for some reason you need to use those 64bit devs to build applications then your going to need to do some system links after you have installed them so you can still use BlitzMax.
ln -s /usr/lib/i386-linux-gnu/libGL.so.1.2 /usr/lib32/libGL.so
ln -s /usr/lib/i386-linux/libGLU.so.1 /usr/lib32/libGLU.so
ln -s /usr/lib/i386-linux-gnu/libXxf86vm.so.1 /usr/lib32/libXxf86vm.so
ln -s /usr/lib/i386-linux-gnu/libfreetype.so.6 /usr/lib32/libfreetype.so

If you compile and you get can't find such and such due to an udate etc, 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 you will have to remove the old system link with the rm (e.g e.g. sudo rm /usr/lib/libfreetype.so) command before using the ln command to link the new version of the .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.
I used skidracer's pulse audio driver as an alternative.
Here's the link read it through.
Add don't forget to install the pulse audio lib with..
sudo apt-get install libpulse-dev:i386

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.

Also if your going to need use the 64bit development versions you need to add more symbolic links 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.


dawlane(Posted 2012) [#2]
Greetings to all.

This tutorial should get you up and running with Debian 7 (aka Wheeze). As this version is still marked as testing it could be subject to change, but it's current status is frozen so there should be no new packages being added only bug fixes and soon (depending on the debian team's testing time) will become the main stable version. And by that time the Linux world will have moved on to something new.

You can get the Wheeze ios images from here. The instructions below used the weekly build DVD and so some of the system links may change.

The 32bit version should use the same install method as the 32bit version of Ubuntu 12.04.

The rest of this tutorial is for the 64bit version.

If you've come looking for how to install BlitzMax on the stable branch of Debian (6 aka Squeeze) 64bit then your out of luck unless you are prepared to mess around building the newest version of dpkg and possibly other files. If you do and are successful then the following procedures should be valid.

First things first were going to need to be root, luckily there should be a root terminal in Application->Accessories. If not find out how you can be added to the sudoers list by searching the web and add sudo before each apt-get. E.G. sudo apt-get install anything-you-want.

To ensure that there are no errors during the next phase you have to open the Synaptic Package Manager (Applications->System Tools->Administrator->Synaptic Package Manager) and remove the DVD repository found in the Settings->Repositories->Other Software dialog tab, un-check cdrom.
Note if you used the small net install cd you don't need to do this.

Now you need to let dpkg know that we want to add another architecture, in our case it's i386. And also make sure that the repositories also search for the i386 versions.
NOTE:You may not need to do the next bit if you downloaded the Multi-Arch iso cd as it should be setup.
dpkg --add-architecture i386
sed -i 's/deb\ /deb\ [arch=amd64,i386]\ /g' /etc/apt/sources.list
apt-get update


Now lets install the the required libraries first as this would remove the build tools if we installed them first.
apt-get install libglu1-mesa-dev:i386 x11proto-core-dev:i386 x11proto-gl-dev:i386 x11proto-kb-dev:i386 libxxf86vm-dev:i386 libasound2-dev:i386 libfreetype6-dev:i386 libxpm-dev:i386 libxft-dev:i386
A thing to note here is that these are the 32bit development libraries which will remove the 64bit versions. Like wise if you install the 32bit libraries then the 64bit versions will be removed. This should not effect any binary files that were installed only the system links should be effected.

Now lets install the build tools.
apt-get install g++-multilib build-essential


As we have directly used the i386 versions of the development lib's we can just build and go, but if for some reason you need to use those 64bit devs to build applications then your going to need to do some system links after you have installed them so you can still use BlitzMax.
ln -s /usr/lib/i386-linux-gnu/libGL.so.1.2 /usr/lib32/libGL.so
ln -s /usr/lib/i386-linux-gnu/libGLU.so.1 /usr/lib32/libGLU.so
ln -s /usr/lib/i386-linux-gnu/libXxf86vm.so.1 /usr/lib32/libXxf86vm.so
ln -s /usr/lib/i386-linux-gnu/libfreetype.so.6 /usr/lib32/libfreetype.so

If you compile and you get can't find such and such due to an udate etc, 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 you will have to remove the old system link with the rm (e.g e.g. sudo rm /usr/lib/libfreetype.so) command before using the ln command to link the new version of the .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.
I used skidracer's pulse audio driver as an alternative.
Here's the link read it through.
Add don't forget to install the pulse audio lib with..
sudo apt-get install libpulse-dev:i386

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.

Also if your going to need use the 64bit development versions you need to add more symbolic links 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.


dawlane(Posted 2012) [#3]
OK WTF IS GOING ON HERE. DOUBLE POST DUE TO THAT SYSTEM DELAY AGAIN


Richard Betson(Posted 2012) [#4]
dawlane,

Very cool. I'm off to vote (USA) but when I get back I will give this a try. :D


dawlane(Posted 2012) [#5]
I'm off to vote (USA) but when I get back I will give this a try. :D
I hope Obama wins. If Romney wins then the US will have a David Cam-moron (play on UK's current leaders name there) of their own and would soon find out what the UK has been suffering from since the last UK election in 2010. The UK economy was growing until just after the election. And the current government keeps blaming the last government, weather, riots, people who have lost the jobs because of their policies in fact every body but them selves.
Though I did like Romney's quote about "Going after the bad guy's" as it must mean he's going after the big city bankers, money men, racist and religious bigots who cause all the trouble in the world.

Last edited 2012


Richard Betson(Posted 2012) [#6]
Hi,

Newbie here so I may be doing this wrong but using "dpkg --add-architecture i386" yields this in terminal (tried as well prefixing 'su' and 'sudo'). Did I do it wrong?



and as 'su dpkg --add-architecture i386'



To ensure that there are no errors during the next phase you have to open the Synaptic Package Manager and remove the DVD repository found in the Settings->Repositories->Other Software, un-check cdrom.
Applications->System Tools->Administrator->Synaptic Package Manager.

I use the small cd net install of debian and in the above there is no Other-Software tab. I can post a pic if you need to see mine.

Thanks,


dawlane(Posted 2012) [#7]
I will have to check out the installation using the small net install as the above instructions use the DVD installer.
What version of dpkg is installed? dpkg --version should give you the answer. If it's 1.16.2 or above then dpkg is compatible, then the problem will be down to the fact that it's a minimal install and multi-arch support isn't in there.

Information about multi-arch and Debian is thin on the ground, plus the number of installation methods can complicate matters. You will see on the Debian wheeze down load page that there is a CD that is already setup for Multi-Arch.

Due to the complexity of installing and setting up Debian is why there are so many distributions based on Debian's testing branch that are easier to setup and use for new users to the Linux world. I can set up a Linux Mint desktop in under an hour with every thing needed for Max and web development.

Last edited 2012


Richard Betson(Posted 2012) [#8]
Yup I'm using version 1.15.8.13 (amd64).

So download the cd image? If so which one?


dawlane(Posted 2012) [#9]
I suspect that you have installed the stable branch of Debian.
You need to look here. and try the beta3 or the weekly builds. The amd64 net installer iso will work.

Last edited 2012


Richard Betson(Posted 2012) [#10]
OK,

I guess I'll order the DVD set.

But before I do I am downloading this long shot.

Multiarch CD?
http://cdimage.debian.org/cdimage/wheezy_di_beta3/multi-arch/iso-cd/

Thanks


dawlane(Posted 2012) [#11]
I actually used debian-wheezy-DI-b3-amd64-netinst.iso found here to test net install.
But if you do use the multi-arch disk don't use the first 3 command lines that tell dpkg to look for the i386 repositories.

Last edited 2012


Richard Betson(Posted 2012) [#12]
Right on,

The multiarch link was from this page
http://www.debian.org/devel/debian-installer/
Which under CD (so CD/AMD64 on that page) leads to your link above.

So downloading the your above link (8 ISO/CD's) then the multiarch ISO might work? Or just dl everything on your link page as I've noticed the 'Multiarch' link is this "debian-wheezy-DI-b3-amd64-netinst.iso" which make me think its a net install of debian. All confusing, hu.

What file do I have to modify to change those first 3 commands lines?

Thanks. I might get this working today. :)

Last edited 2012


dawlane(Posted 2012) [#13]
So downloading the your above link (8 ISO/CD's) then the multiarch ISO might work?
You only need to down load one of the following from the link I used (http://cdimage.debian.org/cdimage/wheezy_di_beta3/amd64/iso-cd)

debian-wheezy-DI-b3-amd64-CD-1.iso
debian-wheezy-DI-b3-amd64-kde-CD-1.iso
debian-wheezy-DI-b3-amd64-lxde-CD-1.iso
debian-wheezy-DI-b3-amd64-xfce-CD-1.iso
These are the main install disk for the most popular desktops
The first one is the main install disk that uses the gnome3 desktop and really is the only one that's needed as all the others numbered 2-8 are use if you don't have a internet connection to install the other additional packages during the install or when you use the package manager. The irony here is you need a internet connection to down load them.
The disks number 1 should also give you the option to install packages directly from the repositories.

debian-wheezy-DI-b3-amd64-netinst.iso
This one is the minimum net install disk and every package will be downloaded from the repositories.

Trying to install the Multi-Arch disk after one of the others above would be pointless as the others are Multi-Arch enabled and if I'm right the Multi-Arch disk should have every thing good to go so the first three lines in the first post
dpkg --add-architecture i386
sed -i 's/deb\ /deb\ [arch=amd64,i386]\ /g' /etc/apt/sources.list
apt-get update
shouldn't bee needed.

Last edited 2012

Last edited 2012


Richard Betson(Posted 2012) [#14]
Hi,

I've downloaded the multiarch iso and the readme states as follows:

This disc is labeled Debian GNU/Linux wheezy-DI-b3 "Wheezy" - Official Snapshot Multi-architecture amd64/i386 NETINST #1 20121011-12:07 . It contains programs ("binaries") for `amd64/i386' computers.


I'm digesting your comments above, but does this mean it's good to go for install with multiarch?

Anyway downloading your suggestions

Last edited 2012


dawlane(Posted 2012) [#15]
I'm digesting your comments above, but does this mean it's good to go for install with multiarch?
There's only one way to find out and that is to try it. If it works out of the box the first thing I would do is see if there is a directory called i386-linux-gnu in /usr/libs if there is then I would look to see if the default max libs are the libGL.so, libGLU.so, libfreetype.so etc. If they are then I would just use
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
apt-get install g++-multilib build-essential
and make sure that there are links in /usr/lib32 to those libs in /usr/lib/i386-linus-gnu if not the I would make those links.
If there isn't any libs or the i386-linux-gnu folder, then I would do apt-get install those libs but with the :i386 after each name.

One thing of note the list for the repositories is stored in /etc/apt/sources.list. If the repositories line contains [arch=amd64,i386] then
sed -i 's/deb\ /deb\ [arch=amd64,i386]\ /g' /etc/apt/sources.list
isn't needed.


Richard Betson(Posted 2012) [#16]
Hi dawlane,

Well I have installed CD-1 and all is well. Love the desktop.

I entered "dpkg --add-architecture i386" in terminal and nothing happens it just goes to the next line in terminal. Should I continue to enter the next two lines from above?

The good news here as I'm using debian 7 and dkpg -version is '1.16.9 (amd64)' . I have also disabled (unchecked CD-Rom) in the 'other software tab' in the Synaptic Package Manager. All good so far.

If I understand things correctly it should be cool to proceed. Yes?

Thanks for nursing me through this. :)


Richard Betson(Posted 2012) [#17]
Success!

I still have to get the sound working but it is compiling. Awesome!

I get this error when I quit firepaint and the screen resolution changes to 640 x 480:
nvfx_screen_get_param:95 -  Warning: unknown PIPE_CAP 30
nvfx_screen_get_param:95 -  Warning: unknown PIPE_CAP 30
nvfx_screen_get_param:95 -  Warning: unknown PIPE_CAP 55
nvfx_screen_get_param:95 -  Warning: unknown PIPE_CAP 56
nvfx_screen_get_param:95 -  Warning: unknown PIPE_CAP 59
nvfx_screen_get_param:95 -  Warning: unknown PIPE_CAP 58
nvfx_screen_get_param:95 -  Warning: unknown PIPE_CAP 30

This may be a graphic driver issue or even an issue with the sound not being setup, but I thought I would mention it.

Thanks for the walk through dawlane. So very helpful. :D

Last edited 2012


dawlane(Posted 2012) [#18]
I've see this before and there harmless. You see them in the old and unsupported nvidia nvfx drivers. Updating to the latest development mesa package or the new nvidia driver may solve this, but as your a newbie trying to update/install those without a good understanding of the way Linux OS's work could cause no end of problems for example.

Last edited 2012


Richard Betson(Posted 2012) [#19]
Ya, I could us this to instal 173.xx nividia driver, but I'm not sure if it would work on debian 7. I actually can live with it as dropping the hertz option in the Graphics() command stops it from going 640 x 480 on app exit. Still I might give it a shot. I mean now is the time to experiment; before I get to dependent on the Linux install. New Linux fanboy here. :)


dawlane(Posted 2012) [#20]
I think the driver that is in stalled is 173.
To check open a terminal and type
lsmod
to list all the modules that are in stalled.
Look for the nvidia driver usually nvidia or nvfx depending on if it's a propriety driver or the messa driver. Then type
modinfo [driver name]
Replacing [driver name] with the name that was list with the first command.

Or try this in a terminal
cat /proc/driver/nvidia/version


EDIT:Come to think of it it would be using the MESA driver when first installed until you activate one of the propriety drivers.

Last edited 2012


Richard Betson(Posted 2012) [#21]
I already did, and nouveau is the video driver, which as I understrand it is what debian defaults to.



Last edited 2012


dawlane(Posted 2012) [#22]
Yeah the nouveau driver is the open source version. The last time I had any open source nvidia drivers installed it was called something completely different.

Last edited 2012


Richard Betson(Posted 2012) [#23]
The version of nouveau installed here actually is pretty good on perfomance, much better then in the past. Thats why I'm inclined to work around it. But IDK imight install the nividia driver.


Richard Betson(Posted 2012) [#24]
Hi,

Trying to get sound working. I tried ALSA but after seting it up I get this error after an application exits.:
ALSA lib conf.c:3314:(snd_config_hooks_call) Cannot open shared library libasound_module_conf_pulse.so
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM default


I have tried to setup for pulse but trying this locks up when I try to rebuild the freeaudio mod.

Any ideas?
Thanks,

Last edited 2012


dawlane(Posted 2012) [#25]
I have tried to setup for pulse but trying this locks up when I try to rebuild the freeaudio mod.
The reason this happens is you are probably using Max IDE to create the file and pasting the code before you save the file as a cpp.
To get round this you need to save a file first as a cpp then reload it, then paste the code and then re-save it.
I had to explain the same thing to Captain Wicker I think it was in the new Alsa post.
I'll look into the other later.


Richard Betson(Posted 2012) [#26]
Thankyou!

Weird, but works. :)


dawlane(Posted 2012) [#27]
I believe the reason why it happens is that when you create a new file it's treated as a MaxBasic file. So pasted code gets parsed and any cpp keywords etc that resemble MaxBasic get capitalised (print becomes Print) rendering the pasted code meaningless when it gets passed to g++.

Last edited 2012