Instructions for installing BlitzMax on Ubuntu 8.x

Archives Forums/Linux Discussion/Instructions for installing BlitzMax on Ubuntu 8.x

MrTAToad(Posted 2008) [#1]
Installing and getting BlitzMax is actually relatively easy. First, you need to install Ubuntu/Xubuntu/Kubuntu 8.04/Ubuntu Studio and make sure everything is updated first. You will, of course, need some sort of internet access.

Then, its best to get hardware acceleration up and running, as that requires a restart. To do that, you need to go into System -> Administration -> Hardware Drivers. In there should be your graphics driver, with an empty tick box currently showing that graphics are not accelerated.

Tick the box and apply to download relevant files and enable a hardware acceleration. You will then need to restart your machine.

Next, the relevant system files need to be installed, once you are back into the desktop. This can be done by opening a terminal window (Applications -> System -> Terminal). At the prompt type in (or copy) :

sudo apt-get install g++-3.3 libglu1-mesa-dev x11proto-core-dev x11proto-gl-dev x11proto-kb-dev libxxf86vm-dev libasound2-dev build-essential libidn11-dev libxft-dev

and press RETURN

Numerous files will be downloaded. Once that has finished, type in exit and press RETURN.

Now, you need to download BlitzMax 1.18, followed by the latest update.

BlitzMax 1.18 will need to be extracted to some location - I usually put it in my home folder. This can be done by double-clicking on the file, at which point an unzip utiity will display the contents of the file, at which point you click on the BlitzMax_118 directory, select Extract and select a location where you what it to be extracted to.

Once done, you can run the latest update - if everything has been installed okay, you will see a prompt asking you to find the location for BlitzMax, and which point you will need to find it and double-click on the base folder.

All the files will then be updated.

Now, you need to run BlitzMax, which should run when you double-click on the BlitzMax icon. The first thing that happens is that you will be asked if the documentation needs rebuilding - press OK to continue.

Before you start writing your own programs, all modules will need to be compiled. This can be done in Program -> Rebuild All Modules.

Note : If you receive any link errors relating to libGL or libX11. Then you more than likely have the 64bit version of Ubuntu installed on your sytem. This is ONLY for 32-bit OS's - 64-bit wont work without quite a bit of fiddlin' (or Mark changes the GCC version used for compiling).
For more information on this read dawlanes post: BlitzMax on Ubuntu AMD 64: A Solution, availiable from your usual web browser at this link : http://www.blitzbasic.com/Community/posts.php?topic=77778#870954


DanO(Posted 2008) [#2]
Thanks for posting this, I'm just trying out Ubuntu 8.04 and was in the process of testing BlitzMax so this is just what I was looking for.

Nice one!


MrTAToad(Posted 2008) [#3]
Ubuntu/Xubuntu/Kubuntu is the easiest system for installing & using BlitzMax.
It also easy with Mandrake or Xandros...


Glenn Dodd(Posted 2008) [#4]
Many thanks for this.
Which version of MinGW should be used nowadays?
I saw a thread for Bruceys modules that mentioned GCC or G++ 4.something.
Any ideas where that is?

Regards
Glenn


CASO(Posted 2008) [#5]
What would be the best way to download the gcc 3.3 files (and others?) on a windows machine with internet access and transport the files on a usb to a computer without internet access?

FYI: My Linux computer has Xubuntu 8.04 and no internet connection.


MrTAToad(Posted 2008) [#6]
Which version of MinGW should be used nowadays?

I dont install MinGW seperately - I just keep with the stuff installed with the sudo apt-get install - works fine. As far as I know, Bruceys stuff will have no problems.

Apparently Ubuntu/Xubuntu does store the packages somewhere - if they could be found, it may be possible to manually install them - somehow.


dawlane(Posted 2008) [#7]
@CASO
You will find the deb packages for Ubuntu at http://gb.archive.ubuntu.com/ubuntu/pool/ ( UK server ) or http://us.archive.ubuntu.com/ubuntu/pool/ (US server)
You will just have to find the latest version of the packages you are looking for but be warned: You could wined up breaking your Ubuntu installation as some package may depend on other packages ( it should warn you that package X depend on package Y when you try and install them).

To add to MrTAToad instructions: If the BlitzMax compiler complains about libstdc++5 just install libstdc++5 package and don't worry about the compiler complaining about libstdc++5 conflicts with libstdc++6 as your programs will work fine.

One more note: the instruction by MrTAToad work out of the box for the 32Bit installation of Ubuntu but not for the 64Bit version ( gcc/g++ 3.3 in Ubuntu 64 has no 32Bit library equivalents as only the later version of gcc/g++ have these and BlitzMax is hard coded to use gcc/g++ 3.3).
Some people would be tempted to system link g++/gcc 3.3 to 4.x: this would be a mistake for both the 32Bit version and the 64Bit version. You would be able to compile your programs but not rebuild the modules as using anything other than gcc/g++3.3 screws them up.

The only way I got round this was to create a special sub folder that was a very minimal install of the 32Bit version of Ubuntu.
To do this follow this thread http://www.blitzbasic.com/Community/posts.php?topic=77778

Which version of MinGW should be used nowadays?

I wouldn't bother installing MinGw on Ubuntu: it's only there as a cross compiler and would be tricky to set up so BlitzMax can use it.
It's best to use a Windows PC to compile for Windows, a Apple Mac for a Mac compile and a Linux install for a linux PC.


MrTAToad(Posted 2008) [#8]
I've updated my text a bit now.


Tachyon(Posted 2008) [#9]
Thank you MrTAToad. It's very nice to have cleanly written updated instructions for the latest version of Ubuntu.

Moderators, you really need to sticky this.


MrTAToad(Posted 2008) [#10]
Its just really anh accumulation of information scatter around here - it does save the searching though :)


WildStorm(Posted 2008) [#11]
Note : This is ONLY for 32-bit OS's - 64-bit wont work without quite a bit of fiddlin' (or Mark changes the GCC version used for compiling).


What kind of fiddlin?

Getting the following errormessages:

/usr/bin/ld: skipping incompatible /usr/lib/libX11.so when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/lib/libX11.a when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/lib/gcc-lib/x86_64-linux-gnu/3.3.6/../../../../lib/libX11.so when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/lib/gcc-lib/x86_64-linux-gnu/3.3.6/../../../../lib/libX11.a when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/lib/gcc-lib/x86_64-linux-gnu/3.3.6/../../../libX11.so when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/lib/gcc-lib/x86_64-linux-gnu/3.3.6/../../../libX11.a when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libX11.so when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libX11.a when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libX11.so when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libX11.a when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/lib/libX11.so when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/lib/libX11.a when searching for -lX11
/usr/bin/ld: cannot find -lX11


linkin g++3.3 to g++4.2 doesn't help


dawlane(Posted 2008) [#12]
@WildStorm
I take it that you haven't read the complete thread then?

@MrTAToad
please update the
Note : This is ONLY for 32-bit OS's - 64-bit wont work without quite a bit of fiddlin' (or Mark changes the GCC version used for compiling).

bit by adding "for more information on this read dawlanes post: BlitzMax on Ubuntu AMD 64: A Solution"


WildStorm(Posted 2008) [#13]
ups didn't see that, sorry


MrTAToad(Posted 2008) [#14]
All done.


slenkar(Posted 2008) [#15]
I installed all the libraries mentioned in the first post, rebuilt all modules and I still get the same error message 'signal handler'
and FLIP gets highlighted in the IDE


dawlane(Posted 2008) [#16]
Try typing gcc-3.3 -v in a terminal.
If you get this
Reading specs from /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/specs

Configured with: ../src/configure -v --enable-languages=c,c++
 --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3
 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext
 --enable-clocale=gnu --enable-debug
 i486-linux-gnu
Thread model: posix
gcc version 3.3.6 (Ubuntu 1:3.3.6-15ubuntu6)

Then gcc-3.3 is installed.
If you don't get anything but a not found error then it's not installed.
If you do get something like gcc version 4.2.3 then you have a symbolic link.

Plash had a problem like this the solution was to remove gcc-3.3/g++-3.3 and any symbolic links to 3.3, then reinstalling gcc-3.3/g++-3.3.
One more note make sure that you have the accelerated grahics drives enabled.
Type glxinfo | grep render in a terminal


Filax(Posted 2008) [#17]
Hi

I'm trying to compile but the program say :

Linking:arraysort
/usr/bin/ld: skipping incompatible /usr/lib/libGL.so when searching for -lGL
/usr/bin/ld: skipping incompatible /usr/lib/gcc-lib/x86_64-linux-gnu/3.3.6/../../../../lib/libGL.so when searching for -lGL
/usr/bin/ld: skipping incompatible /usr/lib/gcc-lib/x86_64-linux-gnu/3.3.6/../../../libGL.so when searching for -lGL
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libGL.so when searching for -lGL
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libGL.so when searching for -lGL
/usr/bin/ld: skipping incompatible /usr/lib/libGL.so when searching for -lGL
/usr/bin/ld: cannot find -lGL
collect2: ld a retourné 1 code d'état d'exécution
Build Error: Failed to link /home/filax/Bureau/BlitzMax/samples/hitoro/arraysort
Process complete

My graphics Card NVidia is ok (compiz work perfectly) and all specified
package has been installed :/ any idea ?


dawlane(Posted 2008) [#18]
@Filax
Your using the 64bit version of Ubuntu there are no 32bit lib archives for gcc-3.3 on the 64bit of Ubuntu. To find out open a command terminal (Applications->Accessories->Terminal) and type uname -a. If it says AMD64 or x86_64 then its the 64bit version. i686 is the 32bit version.
I suggest that you read the rest of this thread from the top.

@MrTAToad
I think we need to update the
Note : This is ONLY for 32-bit OS's - 64-bit wont work without quite a bit of fiddlin' (or Mark changes the GCC version used for compiling).
For more information on this read dawlanes post: BlitzMax on Ubuntu AMD 64: A Solution
bit more to say something like.
Note : If you receive any link errors relating to libGL or libX11. Then you more than likely have the 64bit version of Ubuntu installed on your sytem. This is ONLY for 32-bit OS's - 64-bit wont work without quite a bit of fiddlin' (or Mark changes the GCC version used for compiling).
For more information on this read dawlanes post: BlitzMax on Ubuntu AMD 64: A Solution - http://www.blitzbasic.com/Community/posts.php?topic=77778


plash(Posted 2008) [#19]
And maybe actually link to the post ;)


dawlane(Posted 2008) [#20]
And maybe actually link to the post ;)

And if they read this thread in it entirety they they would find it. :)


plash(Posted 2008) [#21]
And if they read this thread in it entirety they they would find it. :)
I was going based on information in the first post, which does not link to it.


MrTAToad(Posted 2008) [#22]
All done!


slenkar(Posted 2008) [#23]
I have gcc 3.3 installed,
funny thing is, GUI apps work fine, its just graphical apps that slow down and crash.


dawlane(Posted 2008) [#24]
Have you tried uninstalling and the re-installing gcc-3.3?
And have you checked that your xorg.conf file is showing the correct graphics driver and modules?


slenkar(Posted 2008) [#25]
yep just uninstalled and reinstalled and no joy
I also have the right graphics driver because GLTron works fast now,
before I installed the drivers it was slow.


dawlane(Posted 2008) [#26]
Just out of curiosity run the code from Plash's post here http://www.blitzbasic.com/Community/posts.php?topic=77575
Make sure that libxml2 is installed.

And one way to find out what bmk is using is to modify the bmk_util.bmx source file.
In function CompileC add -v to opts string in the Linux section.
opts:+" -m32 -mfancy-math-387 -v"

And in the LinkApp function add -v to the end of the cmd$ string in the Linux section.
cmd$="g++-3.3 -m32 -s -Os --eh-frame-hdr -pthread -static-libgcc -v"

Then complie the bmk.bmx file, back up your original bmk executable and copy over the one in your bmk source directory.
As a last resort try uninstalling gcc/g++ 4.x,gcc/g++ 3.3 any symbolic links to any gcc/g++ then reinstall gcc 4.x then gcc 3.3 and re-run the sudo command in the first post and re-build the modules.

And test a few other GL apps.

EDIT: Also try a clean install of BlitzMax witout rebuilding any modules.


Repentless(Posted 2008) [#27]
Fixed my problems with the other Ubuntu thread. This really should be stickied. :)


slenkar(Posted 2008) [#28]
plashs code works for me..

blitzmax crashes on the flip command every time, but only after about a minute of operation.

I compiled the community IDE and it works with no problems (because flip is not used)

when i put -v in the bmk file I got this output

Reading specs from /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/specs
Configured with: ../src/configure -v --enable-languages=c,c++ --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug i486-linux-gnu
Thread model: posix
gcc version 3.3.6 (Ubuntu 1:3.3.6-15ubuntu6)
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o /home/keith/Desktop/BlitzMax/spaceship/spaceship -s /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../crt1.o /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../crti.o /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/crtbegin.o -L/usr/X11R6/lib -L/usr/lib -L/home/keith/Desktop/BlitzMax/lib -L/usr/lib/gcc-lib/i486-linux-gnu/3.3.6 -L/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../.. /home/keith/Desktop/BlitzMax/tmp/ld.tmp -lstdc++ -lm -lgcc -lgcc_eh -lpthread -lc -lgcc -lgcc_eh /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/crtend.o /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../crtn.o


how do I remove symbolic links?

I also tried a free linux 3d pinball game which works OK


markcw(Posted 2008) [#29]
how do I remove symbolic links?

rm name_of_softlink

For the truly parnoid

ls -l name_of_softlink
(look and see it truly is - the first field will look like
lrwxrwxrwx)
then type
rm -i name_of_softlink
(This will ask you if you really want to remove it)

for those who don't care then the following will override
and precautions that might be there...

\rm name_of_softlink

Remember everything is a file or a directory in *NIX
so rm is the way to go....

HTH

As Always

r



slenkar(Posted 2008) [#30]
how do i get the name of the softlink?


markcw(Posted 2008) [#31]
You usually already know the name. I don't follow what you're trying to do.


dawlane(Posted 2008) [#32]
It doesn't look like you need to delete any symbolic links. The output from the -v option added to your bmk file says that gcc-3.3 is being used.

Just to be on the safe side type g++-3.3 -v in a command terminal. If it say exactly the same as gcc-3.3 then you can rule out gcc and start to look at installed libs, xorg configuration (do you need addition options for your graphics card or load any extra xorg configuration modules(dig around on the ubuntu forums and if need be ask).

What markcw is basically saying is
use the list command (ls) with the single file option (-l) to look for a file that may be a symbolic link. For more info on ls type "man ls" in a terminal.
Here's an example of a know symbolic link
dawlane@ubuntu32:~$ ls -l /usr/bin/gcc
lrwxrwxrwx 1 root root 7 2008-06-10 21:44 /usr/bin/gcc -> gcc-4.2

Here a break down of the result
lrwxrwxrwx this is the file permissions the "l" is basically saying that this is a link
rwx (read,write,execute) is repeated 3 time for (user,group,other). You can read more about this from here http://www.tuxfiles.org/linuxhelp/filepermissions.html and http://www.comptechdoc.org/os/linux/usersguide/linux_ugfilesp.html
The first root (who on this machine is god all mighty and can do what ever he likes on mount Olympus) is the owner of that file and the second "root " is the group (Those users that live on mount Olympus and are related to god) .
The number is the size in bytes the next is date and time stamp.
The /usr/bin/gcc is the file you specifically listed and the -> is showing what that file links to.

It is a lot easer to see these in nautilus just navigate to /usr/bin.
To delete links using nautilus I run nautilus from the command terminal by using sudo nautilus (or ALT+F2 and type sudo nautilus)

The remove (rm) command does what it says. The -i option just show you a prompt asking if you want to delete the file.
BE WARNED THAT IF YOU DO NOT KNOW WHAT YOU ARE DOING MESSING AROUND AS sudo (aka root) IN ANY SYSTEM FOLDER (in other words any thing thats not /home and then in /home you can cause problems) CAN SERIOUSLY RUIN YOUR DAY.


markcw(Posted 2008) [#33]
BE WARNED THAT IF YOU DO NOT KNOW WHAT YOU ARE DOING MESSING AROUND AS sudo (aka root) IN ANY SYSTEM FOLDER (in other words any thing thats not /home and then in /home you can cause problems) CAN SERIOUSLY RUIN YOUR DAY

lol


dawlane(Posted 2008) [#34]
I update the definition of root a bit ;)


Warpy(Posted 2008) [#35]
I've made an installation script that installs all the dependencies from aptitude, checks out BlitzMax from SVN, and builds all the modules. I can't get it to install the IDE because that's still only available from your user account page, but bmk is ready to work straight away once this script is done.

Download the script here

I had a go at making a .deb file but I couldn't work out how to control where it installs things.


slenkar(Posted 2008) [#36]
Ubuntu is based on debian isnt it?
Ill try your script out later


slenkar(Posted 2008) [#37]
d'oh!

I installed blitzmax using the script and got the same error


Warpy(Posted 2008) [#38]
what error?


slenkar(Posted 2008) [#39]
When I run a program with graphics it goes fine for about 20 seconds becomes unresponsive and then crashes with the generic 'message 11' error.
Then it highlights FLIP
Then when you drill down to see exactly where the error is, it occurs in

Method Flip( sync )
bbGLGraphicsFlip sync
End Method

I compiled the IDE and it runs fine (because it doesnt use openGL)


dawlane(Posted 2008) [#40]
For those of you out the that haven't already discovered. BlitzMax has problems running on the latest version of Ubuntu 8.10 (intrepid).

The main reason as far as I know is that gcc-3.3/g++-3.3 are no longer with us on this version of the OS (There is gcc-3.4 but no g++3.x)

But fear not there is a work around and this involves using the last version of gcc-3.3/g++-3.3 and a bit of command terminal work.
First we need the these files

cpp-3.3_3.3.6-15ubuntu2_i386.deb
g++-3.3_3.3.6-15ubuntu2_i386.deb
gcc-3.3-base_3.3.6-15ubuntu2_i386.deb
gcc-3.3_3.3.6-15ubuntu2_i386.deb
libstdc++5_3.3.6-15ubuntu2_i386.deb
libstdc++5-3.3-dev_3.3.6-15ubuntu2_i386.deb

from the Ubuntu archive server http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-3.3/

Just to make thing easier to read make a folder called gcc on your desktop and move these files into it.

Open a command terminal (Applications->Accessories->Terminal) and type
cd Desktop/gcc

then type ls or dir to list the contents.
Next we need to use the dpkg command to install the deb packages.

sudo dpkg -i --force-depends cpp-3.3_3.3.6-15ubuntu2_i386.deb
sudo dpkg -i --force-depends g++-3.3_3.3.6-15ubuntu2_i386.deb
sudo dpkg -i --force-depends gcc-3.3-base_3.3.6-15ubuntu2_i386.deb
sudo dpkg -i --force-depends gcc-3.3_3.3.6-15ubuntu2_i386.deb
sudo dpkg -i --force-depends libstdc++5_3.3.6-15ubuntu2_i386.deb
sudo dpkg -i --force-depends libstdc++5-3.3-dev_3.3.6-15ubuntu2_i386.deb


Note the --force-depends option is used here because...
1) I couldn't remember which package depends on what.
2) The g++ and libstdc++5.3.3-dev both need the other to be installed first.

I will also post the else where on the forum so MrTAToad can link to it and I can update it ;)

The link http://www.blitzbasic.com/Community/posts.php?topic=81247

UPDATE: It looks like skidracer has solved the problem of not having to use an earlier version of gcc checkout http://www.blitzbasic.com/Community/posts.php?topic=81261