How To: Dependencies Ubuntu/Debian/Mint Apr 2015

BlitzMax Forums/BlitzMax Programming/How To: Dependencies Ubuntu/Debian/Mint Apr 2015

dawlane(Posted 2013) [#1]
--


dawlane(Posted 2013) [#2]
Covers: 32/64bit as of May 2016

For other distributions see:
How To: Dependencies OpenSUSE 13.x, Leap 42.x
How to: Dependencies Fedora 22/23

Experimental BlitzMax dependency install script with GTK+2 option.
Experimental BlitzMax NG istall script.

Ubuntu 12.04+
Debian 7.x (BlitzMax 1.50 needs the bmk, makedocs, docmods and the MaxIDE rebuilding with BlitzMax 1.48)
Debian 8.x
Linux Mint 13+
Should work on any distribution that's based on the above.

Greetings to all.

As Debian, Ubuntu and Linux Mint are closely related I rewrote a script that I wrote that installed the dependencies to build BlitzMax applications. And as there is very little difference between those three distribution I decide that I will update this topic by month and year (I cannot squeeze all the distribution name plus release version in the topic title) rather than reposting this script over and over again. If there is any difference between earlier versions they will be added as comments in the main script that you can edit yourself.

I found out is that the archiver gui tool in ubuntu may not extract the compressed BlitzMax archive. So you if this is a problem you can do it from the command line.

From Ubuntu 13.10 in regards to Blitz Max on a 64bit operating system is that the ia32-libs-multiarch package is no longer in the repositories and you now have to install any 32bit package manually (e.g. apt-get install package:i386).

As some people have had problems following instructions. I've written two scripts; one installs the 32bit dependencies for building Blitz Max applications and the other is a patch file for getting Blitz Max version 1.48/1.50 to work correctly on the newer Linux operating systems. The scripts should work on any Ubuntu based distribution from 12.04 onwards and any Debian based distribution from release 7 onwards.

First extract BlitzMax from the archive. If you have problems with the GUI archive tool, then in a command line terminal, use the cd command to change directory to where the archive is and execute the command below.
Note: Change the 148 to the version you are using.
tar -xf BlitzMax148_linuxx86.tar.gz
You should read the 'man page' on tar for full details on it's use (type man tar in a terminal).

IMPORTANT UPDATES:
For some reason Ubuntu 16.04+ and later distributions of Debian 8.x have trouble creating release builds with BlitzMax. This may just be a 64 bit issue, but normal debug buils still work.

Debian 7.x uses GLIBC 2.13, so you will you get an error such as version `GLIBC_2.15' not found when you run the IDE or command line tools from a terminal.
So for Debian users, use BlitzMax version 1.48 (recommended) and try to rebuild the tools bmk, makedocs, docmods (remember to disable GUI and debug) using the newer version source code. Copy/Move these new applications to the new install bin directory and rebuild the modules, then rebuild the IDE and bmk, makedocs and docmods again.
If you have upgraded to Debian 8 then there should be no problems.
If you wish for your applications to be able to work across as many distribution a possible. The you should build against Debian using either a Virtual Machine or a chroot.
--------------------------------------
NOTES: FOR DEBAIN BASED OS
To see what architectures that have been added use..
dpkg --print-architecture
dpkg --print-foreign-architectures
Those commands will work on any version of dpkg 1.16.2 onwards and are not just a Debian thing.
--------------------------------------

Before running any script make sure that your system is up to date, the script only updates the package data base. Use either the GUI update tool or the commands below. You may need to do this a few times and restart your system. Not doing this will cause you problems if your distribution is one of the Long Term Support types.
sudo apt-get update && sudo apt-get upgrade
Or for Debian
su -c 'apt-get update && apt-get upgrade'

Now open a text editor and copy and paste the script code below into it. Edit the script to suite your system. When you have done this save it as bmax.sh


Next create a new text file in the text editor and copy and paste the script code below into it. When you have done this save it as patch.sh to where you have extracted the BlitzMax directory.
NOTE: The patch file only works on a clean extracted version of BlitzMax (tested of 1.48 and 1.50 only) and may break a modified version, so this will be no good for the master version found on github. It will also set the default audio driver to pulse audio. To change the audio driver you will need to edit /mod/brl.mod/freeaudioaudio.mod/freeaudioaudio.bmx and /mod/pub.modfreeaudio.mod/freeaudio.bmx.
NOTE: If you get an error such as
"Assertion 's' failed at pulse/simple.c:255, function pa_simple_free(). Aborting."
Then check that the distribution has the full pulseaudio sound server installed installed and maybe installing libasound2-plugins (both the 32bit and 64bit version if using a 64bit distribution) if there are still problems. On some distribution you have to jump through hoops to get pulse audio working.


I will assume that all of the files and the BlitzMax directory are in your home directory. If not then alter the path to where they are located.

Now the two script files need to have there execute permissions set. You can do this through the native gui file explorer by right clicking the file and selecting properties, then switch to the permissions tab or open a command line terminal and if necessary change the directory using the cd command to where the files are and then run the commands below. Here I will assume that you placed the files in your home directory.
chmod +x ~/bmax.sh
chmod +x ~/patch.sh

NOTE: If the BlitzMax IDE or bmk will not run after the dependencies have been installed then check the execute permissions. Quick set use chmod -R +x ~/BlitzMax.

Now to install the dependencies open a terminal and execute one of the commands below. You will be prompted for a 'root' password.

Debian based
su -c './bmax.sh'
Alternate bash or sh
su -c 'bash ~/bmax.sh'

Ubuntu based
sudo ./bmax.sh
Alternate bash or sh
sudo bash ~/bmax.sh

To execute the patch file make sure that the file is in the same directory as the BlitzMax directory (not inside the BlitzMax directory) and in a terminal execute the command below.
./patch.sh
Alternate bash or sh
bash ~/patch.sh


NOTE FOR 64 BIT SYSTEMS USING UBUNTU AND DEBIAN
With the later version of the freetype development libraries, there is an issue where you may see it complain about no such file of directory.
You will need to create a system link with:
sudo ln -s /usr/include/x86_64-linux-gnu/freetype2 /usr/include/i386-linux-gnu/freetype2


Before building any BlitzMax applications execute bmk from the command line to rebuild all the modules.
~/BlitzMax/bin/bmk makemods -a
If you rebuild the modules from within the IDE and there is an error in the C++ code it can crash the IDE.

Oh and here are the list of libraries needed to deploy BlitzMax applications for a 64bit version of ubuntu/debian/Mint. You don't need to create any links to these libraries and you can omit the i386 for 32bit deployment.
Note that the distribution has to have Multi-Arch enabled

GL
libglu1:i386 < should install libgl1-mesa libraries if you get a missing gl/glu error but shouldn't be needed if using a propriety drive with 32bit enabled.

Core
libstdc++6:i386 libx11-6:i386 libxxf86vm1:i386 libfreetype6:i386 libxpm4:i386

Audio
libpulse0:i386
libasound2:i386
libasound2-plugins:i386 A must if the system uses PulseAudio, JACK as a sound server.
libopenal1:i386

NOTE:One pitfall that you may come across is a GLIBC error (usually version issues). The only solution would be to recompile that application on the offending distribution.

Now Go and write some code.


Derron(Posted 2013) [#3]
Just want to be the first one saying thanks for your work.

Shame that this is needed but good that one takes care of it.


PS: didnt check the unpacking process in prior versions (just used the lib-setup and manually patched things as I checked if I changed some already) but "tar" should satisfy all common distributions (it's there since decades :D).


bye
Ron


pcjohn(Posted 2013) [#4]
Has anyone tried this on Lubuntu 13.10 ?

Looks like the pulse audio drivers are broken yet again. The scripts work perfectly on
12.04 and 12.10, however on 13.10 it's back to the dreaded audio error on
anything that uses sound:

"Assertion 's' failed at pulse/simple.c:255, function pa_simple_free(). Aborting."

I can get sound using OpenAL, but only by completely removing PulseAudio from the system.

JD


dawlane(Posted 2013) [#5]
@pcjohn: Never used Lubuntu until to day (using 64bit).
The default distribution audio driver is set for ALSA and the pulse audio driver isn't even installed by default. Use synaptic to search and install pulseaudio (and if it still has problems use a terminal to install libasound2-plugins or libasound2-plugins:i386).


dawlane(Posted 2013) [#6]
Is it me or is Ubuntu getting worse with each new release?
Finally got round to trying Ubuntu 13.10 on real hardware and the spent the last two hours trying to get propriety nvidia drivers from the repository to work with my dual monitor rig. What a complete waste of time that was. It crashes the system with a xorg.conf file. At first I thought it mite have had something to do with the new mir rendering system but apparently that was dropped. Maybe when I get the time I will have another crack at it.


pcjohn(Posted 2013) [#7]
Yes, I'd say the releases are getting worse. I'm having Nvidia driver problems
with my home machine as well.

The power manager is broken AGAIN as well.

And still no Pulseaudio with Blitz.

JD


Derron(Posted 2013) [#8]
Glad 13.04 is working

$ lsb_release -d
Description:	Linux Mint 15 Olivia

$ uname -a
Linux RonnyPC 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux



in 13.10 the "pulseaudio"-libs got an upgrade to 4.0
Mabye a look into the file " /etc/pulse/default.pa"
can change things if you experience sound problems within the desktop environment itself.

As you have an assertion error - have a look at that file and see what makes that error happen.

Relying on OpenAL (had problems with it) or Alsa (starting your app with sound stops all other sound sources from playing -- eg. music player / radio) is a no-go and PulseAudio is - albeit not polished yet - the best current bet for linux.


bye
Ron


dawlane(Posted 2013) [#9]
I ditched Ubuntu not long after Unity became the default desktop manager and synaptic was dropped as the default GUI package tool and all graphic problems started with that.
It first started with application windows, that when moved near the edges couldn't be accessed unless you changed to another virtual desktop. The release after that; installing the repository drivers became unreliable and they don't even clearly mark out the version number of the driver.

And as I am using a dual monitor set up which is OK as long as I'm not
1) using the nouveau drivers and trying to run and BlitzMax application in full screen
2) using propriety drivers with twin view. I have to set it up as separate screens with Xinerama and configure xorg.conf so that the main monitor is set to the larger of the two.

Current (26-10/2013) statistics on distro watch show Linux Mint and Debian leading Ubuntu.

And still no Pulseaudio with Blitz.
Got it working with a clean install of Lubuntu 13.10 64bit on real hardware in under 10 minutes using my scripts and the instructions with them (I didn't alter anything in the scripts).

Using oldskool2 for testing I got the same error. So I check in synaptic to see what pulse audio stuff was installed, saw that libasound2-plugins+libasound2-plugins:i386 was needed, then tried oldskool2 with no joy. After I saw that the mixer was using the basic console alsamixer tool I realised that the pulse audio sound server wasn't installed so I installed the default 64bit version and tried oldskool2 again with success.

EDIT: Ok figured out why the x server was crashing. Completely forgot that Unity use composite rendering which isn't supported with Xinerama enabled. This means for the time being that the method I will not work until I can figure out away to solve it.


Derron(Posted 2013) [#10]
Just disable composite rendering (think you mean "ffects") at all .. they drop your FPS by almost 50% (for me this happened with amd llano igp and an nvidia card).
So when trying to increase graphical performance of your app - disable compiz, metacity,... . This is also the official hint for wine-apps/games.


bye
Ron


dawlane(Posted 2013) [#11]
Well not sure what exactly the hell I did to solve it but I managed to get it working as it should work without disabling compiz or having to write and xorg,conf file. There was some weirdness with displays and running a Blitz Max made application when run in full screen mode, as exiting didn't reset the display back to it's original resolution. I did a bit of messing around with the GUI resolution tool and now every thing seems fine.
I will have to re-install Ubuntu 13.10 and see if I can recreate it.

@Derron: Tried disabling compiz but doing that screws up Unity not the kind of thing I was looking. Compiz and Xinerama will not work together and any kind of composite rendering has to be disable in the xorg.conf file for Xinerama to work.


Derron(Posted 2013) [#12]
Did you try everything without setting up an xorg.conf - newer distributions should not have a xorg.conf anylonger.

The only PC having and needing some odd configuration settings is my htpc to get rid of overscan on my old sony LCD-TV.

Wrong settings in the xorg may also be the reason of some troubles you experience.


bye
Ron

PS: maybe unity screws up because it misses correct fallbacks for certain things it wants from the compositor. Shuttleworth should be ashamed as 3D-power also uses power on mobile computers and therefor decreases runtime.


dawlane(Posted 2013) [#13]
Did you try everything without setting up an xorg.conf - newer distributions should not have a xorg.conf any longer.
Yep. Installed the driver had problems with it playing nice with the monitors and Blitz Max and a application.
Wrote the xorg.conf to the same spec as what I used for Linux Mint, forgot that Xinerama and compiz (and any non nvidia composite manager) hate each other.
Disabled Xinerama to get GUI back.
Removed all traces of the nvidia driver and xorg.conf.
Installed the nouveau driver and rebooted.
Installed nvidia-current and rebooted.
Ran a full screen BlitzMax sample, this time it played nice and didn't switch the display into mirror. Exited BlitzMax. Opps didn't restore to previous resolution.
Messed with GUI display tool to get the correct resolution back.
Reran BlitzMax sample again and this time it returned every thing back as it should.

maybe unity screws up because it misses correct fallbacks for certain things it wants from the compositor
More than likely it's because it's a load of bo**ocks. Ill conceived and poorly implemented. Just like Shuttleworth's idea to drop Wayland and go with their own version which by the sounds of got shot down by Intel.

EDIT:
Well after a few hours of testing both the 32bit and 64bit version of Ubuntu 13.10. I can honestly say that I have had less crashes using a ZX81 with ram pack wobble. Can't wait to see what a disaster 14.04 LTS is going to be.
Looks like the driver problem had some thing to do with using jocky installing nvidia-319-updates. This time I used apt-get to install nvidia-319.


Derron(Posted 2013) [#14]
Hehe, I had some disturbed graphics using the amd-**-updates (the boot and shutdown-animation was kind of scanline-displaced - every second pixel line was x-displaced by about 75 pixels). chaning back to amd-** this problem was gone.

Seems both candidates did something unwanted with their binary blobs :D


Although flaming against shuttleworth's ideas... he or his team _has_ ideas, whether one has to force them the way they do (eat or die) is another story.


bye
Ron


dawlane(Posted 2013) [#15]
Just to let every one know got my hands on Linux Mint 16 rc Mate. Tested the scripts above with the 64bit version and they works flawlessly.
There's a new animated login screen... (Sarcastic WOW) let's see if it crash x-server like that stupid HTML5 cloud theme (what's wrong with the one in Mint 13 for Christ's sake).
One thing that should have been fix is that hasn't is synaptic which crashed at random.


JoshK(Posted 2013) [#16]
This guy makes the case that once things are working, developers get bored and start changing things just for the sake of it:
http://www.youtube.com/watch?v=Sh-cnaJoGCw


Grisu(Posted 2014) [#17]
I tested the scripts yesterday evening on a fresh, fully patched KUbuntu 13.10, 32 Bit. They ran smoothly.

- I can't compile any bmx examples that use audio. What packages do I need to install?

- Also I need to get Brucey's LibCurl.mod to work, but I seem to miss stuff there as well:
/home/grisu/BlitzMax/mod/bah.mod/libcurl.mod/src/lib/url.c:59:18: fatal error: idna.h: File or folder not found.
#include <idna.h>


- It would be great if you could include the GTK packages in the script as well. I'd love to test if Brucey's module leads to better results.

Thanks in advance.

@Josh: I like your video. It is so true from my user perspective.


Derron(Posted 2014) [#18]
you will have to install libdna-dev (sudo apt-get install libdna-dev) to compile the source code of the libcurl.mod.

If you spread around your binary, that users wont need to install that dev-library, it is just used for compilation.


@Mint16:
Totally disappointed from Mint16. flgrx_dri.so is crashing randomly when surfing with chrome - does not matter if using fglrx or fglrx-updates. A sudoed graphics-app using bah.serial is crashing the desktop so every app is closed and you are prompted to the mdm-login-greeter. Removing the graphics part (just cls + drawtext("connected",10,10), flip) did not crash at all.
Also they now have a non-deleteable shortcut for SUPER (the windows key) ... I had a SUPER+E to launch nemo (better smb-integration and svn-tortoisesvn-like-integration-support). Another thing is that nemo now launches its own desktop (black desktop, not configurable) which hides the default one - so you have to run "nemo --nodesktop" now.
All it all I really should punish myself for upgrading that fast instead of skipping "Petra" with XFCE (Mint16 XFCE).

Ahh I forgot: using the open source ati driver I now get random "scanlines" (half width'd) all over my desktop. Think in a bored hour I will backup everything and return to Mint15 (which I really like).


bye
Ron


dawlane(Posted 2014) [#19]
I can't compile any bmx examples that use audio. What packages do I need to install?
Did you patch the BlitzMax? And what is the default audio system (not BlitzMax) driver set to use Pulse or Alsa as some distributions do not use PULSE as default? Try and change BlitzMax the driver in freeaudio.bmx to use Alsa, or go for the safe bet and use OpenAL.

@Derron: With out checking I think the library is either libidn11-dev or libidn2.0-dev. Installing one of the following libcurl development packages should install that package as well. libcurl-ocaml-dev, libcurl4-gnutls-dev, libcurl4-nss-dev, libcurl4-openssl-dev.

Currently using Cinnamon for a change as I get the impression that Mate has acquired more bugs and and no fixes from when I tested the pre-release. So far every thing is very smooth. ATI (now AMD) have never been the most reliable drivers for me, either in Windows or Linux and I'm not even going to think about the open source drivers. Ok I know the last part of that statement is a bit of an oxymoron.


Derron(Posted 2014) [#20]
for me it looked like a small "L" (having new glasses the font rendering did not get better :D) ... so you are right - it is in the "IDN"-library. Blame it to the bold-font-rendering-quality.
PS: the anti-alias is done by Chrome not by the OS itself.

-----IMG-----

-----IMG-----


@cinnamon:
I am with XFCE, does what I want (thunar is faster for me in most situations, just using RapidSVN for SVN-purposes now instead of rabbidsvn [tortoisesvn like for linux]).
Meanwhile I still have hopes that some libs (or the binary blob) get updates the next days - so that crashes will be gone.


dawlane(Posted 2014) [#21]
Meanwhile I still have hopes that some libs (or the binary blob) get updates the next days - so that crashes will be gone.
I think that depends on how much forum chatter is on the subject.


Grisu(Posted 2014) [#22]
I used this old script I found on the forums which installed the missing ldna-libraries. Would be great if you could include these in your first script.



As I'm using Fmod which works fine, I will skip the issues with the buggy bmx audio drivers.

For the ice of the cake. The simple "Drawimage" command now causes a core dumb error. AWESOME! Has to be my Nvidia card, at least it worked on ATI cards.


dawlane(Posted 2014) [#23]
The simple "Drawimage" command now causes a core dumb error. AWESOME! Has to be my Nvidia card, at least it worked on ATI cards.
With out knowing what your hardware it is no one will not be able to try and point you in the right direction. If it's an old card, proprietary drivers may no longer be supported so you will be stuck with the open source version that may not include 3D hardware acceleration. If it's new, then try to install one of the nvidia packages using sudo apt-get install (nvidia-173, nvidia-304, nvidia-319). Do not install any of the packages with -updates appended to the package name. The very last resort is to download the nvidia drivers from the nvidia website and attempt to install it. I should point out that even experienced Linux users have trouble installing proprietary drivers directly from the chip vendors sites.


Grisu(Posted 2014) [#24]
Its a 780 GTX. "nvidia-319" did the job. Again, thanks a lot!


dawlane(Posted 2014) [#25]
As the patch script in the first post is for BlitzMax version 1.48. I have posted here another version that should work on both 1.48 and 1.50.


Edited: Small fix as replacing some commands didn't add a new line sequence.


Brucey(Posted 2014) [#26]
Wouldn't you be better with a "proper" patch file?

I realise everyone likes to re-invent the wheel with everything BlitzMax related, but sometimes it's just better to use the tools that are available...


Derron(Posted 2014) [#27]
While it surely is possible to :
diff -u oldFile newFile > patchedFile.diff

and then on the other system
patch vanillaInstalledFile < patchedFile.diff


But the "simplyness" of the patch-script is that it should be a selfcontained file (and only one).


bye
Ron


dawlane(Posted 2014) [#28]
Wouldn't you be better with a "proper" patch file?
That was what the first attempt was. But unfortunately I discovered that copy and paste from these here pages doesn't work very well with tools like patch or using
cat <<EOF >mynewfile.txt
the content
of this new file
is just placed
between the eofs
EOF

That's why the pulsedevice.cpp is created with echo "text" >> textfile.text

But the "simplyness" of the patch-script is that it should be a selfcontained file (and only one).
I think that I may try an experiment where I echo a patch file and then execute patch. I may work then with copy and paste from this site.

Edit: Scratch that idea. diff generates too big a patch file for some simple insertions.


dawlane(Posted 2014) [#29]
OK updated the script and fixed a few issue (hopefully).
Nothing much has changed between ubuntu 13.10 and ubuntu 14.04 LTS beta, apart from now needing libfontconfig.so.1 linking.

One thing to note is that the BlitzMax 1.50 binaries will not work with Debian 7. This I can guess is that the 1.50 binaries were built on a newer version of Ubuntu. If you want use the 1.50, then you will have to copy the modules from 1.50 and use the 1.48 binaries to rebuild the modules and the 1.50 version tools.


dawlane(Posted 2014) [#30]
I thought I would share a little something that I have been messing around with on and off for that last month. It's a small tool that creates a tar.gz archive, with the option of creating a self extracting archive. It will also generate an install script, that with any luck, should be able to to detect the distribution and with the right function script created for the distribution; install the necessary packages.

It was created with Monkey-X in mind, but you can adapt the packages for any application.
Note that this is a basic check and install script. There is no package management involved.
I've added detection for Ubuntu, Debian, Linux Mint, Fedora, OpenSUSE and Mageia.

You should read the README first. And test out the installation script of created archives in a virtual machine in case something goes wrong.

https://www.dropbox.com/s/76km3asojrhyqh7/builder-0.9.tar.gz


Socratous(Posted 2014) [#31]
Thank you dawlane!!! Amazing work! I could marry you (if you were a girl and hot)!


dawlane(Posted 2014) [#32]
Well finally got round to testing the scripts with both Ubuntu 14.04 and Ubuntu 14.10.

The verdict
Ubuntu 14.04 32bit and 64bit works.
Ubuntu 14.10 only the 32bit works as it looks like there have been some changes to some of the development packages. Re-building the modules fails with a 64bit distribution when trying to compile anything with truetype. Truetype config is trying to find header files in the i386-linux-gnu directory that do not exist. I did try to install the 32bit version of this development library, but ended breaking the packages.

I may look into this later when the next version of Linux Mint arrives on the scene.


Wiebo(Posted 2015) [#33]
I used this on Mint 17.2, 64 bit and it all seems to be working quite well.

I have a question about your final remark in the 1st post: deployment. Do I need to provide those libs with my distribution or is it something that the user needs to install??


dawlane(Posted 2015) [#34]
The use user must have the required libraries installed. In general you would create a package that contains the necessary instructions to install these for the end user. But if you distribute that program as a archive then you have to inform the end user of the additional dependencies or supply a script.

See post 30 for a tool for that I knock up to create a multi distribution, self extracting archive.
It require some understanding of how dpkg/rpm works and the .deb/.rpm format to make a proper package.


JaviCervera(Posted 2015) [#35]
I am trying to make it work on a virtual machine but it is failing. My system info is:

- Host: MacBook Air 2013 11" with OS X El Capitan installed.
- Guest: Xubuntu 12.04 32 bits with all updates installed.
- VirtualBox version 5.0.6
- BlitzMax 1.50

I have successfully ran bmax.sh and patch.sh, but when doing the "bmk makemods -a" part, it gives me this:

Compiling:blitz_app.c
Compiling:blitz_types.c
Compiling:blitz_cclib.c
Compiling:blitz_memory.c
Compiling:blitz_module.c
Compiling:blitz_object.c
Compiling:blitz_string.c
Compiling:blitz_array.c
Compiling:blitz_handle.c
Compiling:blitz_debug.c
Compiling:blitz_incbin.c
Compiling:blitz_thread.c
Compiling:blitz_ex.c
Compiling:blitz_gc.c
Compiling:blitz_gc_rc.c
Compiling:blitz_ex.linux.x86.s
flat assembler  version 1.68  (0 kilobytes memory)
Segmentation fault (core dumped)
Build Error: Failed to assemble /home/javi/Apps/BlitzMax/mod/brl.mod/blitz.mod/blitz_ex.linux.x86.s


That "Segmentation fault (core dumped)" when running fasm also happens if I open MaxIDE (which opens without problems) and try to build any sample.

EDIT: Seems to work fine with BlitzMax 1.48.


dawlane(Posted 2015) [#36]
At first thought I would have suspected that there was a problem with bcc or fasm being compiled with a different version of libc. But my money would be on the combination of Virtualbox and El Capitan (the latter which is giving a few developers head aches).

BlitzMax 1.50 (non opensource) works as it should using a Linux host, using Xubuntu 12.04 32/64bit guest on Virtual Box 5.0.2.


Henri(Posted 2016) [#37]
Hi dawline,

I used your script in newest Ubuntu 16.04 and it does the job nicely. As a complete Linux noob it really made things more easy.
Do you use default 1.50 BMX ?

-Henri


dawlane(Posted 2016) [#38]
You can use 148/150 and the stuff on git-hub.
There is one or two caveats.... Using Brucey's GTK stuff (and other modules) can be problematic on a 64 bit distribution due to dependency issues relating to gtk themes and webkit.

My advice now would be to move away from BlitzMax as a cross platform development tool, as it will get more and more broken with each new release of a Linux distribution. Brucey has done a good job of trying to keep things going, but in the end; even he's not going to be able to find time to keep fixing things. I myself could have gone to town on it, but I hate fixing other peoples code knowing that at a later date there would be an update and have to fix it all again. At that time the license wouldn't have allowed me to do so and by the time that changed I had moved on to something else.

BlitzMax for Linux on the support front was always an after thought (the same as 64 bit support for Windows and Linux). BRL should not have been selling BlitzMax as a cross platform tool if they were not fully committed to supporting all three target platforms. If I had known that at the time, I would never had purchased a license in the first place.

If you read BlitzMax games on LINUX SteamOS, especially posts 15 and 18.

All BlitzMax now to me is just a toy language for doing a quick prototype.


Henri(Posted 2016) [#39]
Thanks for the reply. Is the fundamental problem dependency management and if so would https://insights.ubuntu.com/2016/04/13/snaps-for-classic-ubuntu/ this be the answer ?

-Henri


dawlane(Posted 2016) [#40]
Is the fundamental problem dependency management and if so would https://insights.ubuntu.com/2016/04/13/snaps-for-classic-ubuntu/ this be the answer ?
No. The fundamental problem is package maintainers not making their packages multi-arch aware. Adding another package format (snaps) which is basically a Canonical thing, wouldn't solve the problem.


dawlane(Posted 2016) [#41]
This script is a work-in-progress and should work as before, but now gives you the option to install gtk+2 for development on both 32 bit and 64 bit distributions. This is more for using BlitzMax NG than vanilla BlitzMax.

It will only become the main install script for BlitzMax if I get reports back that it's installing the dependencies correctly. Note that on a 64 bit distribution gtk 32 bit will complain about various bits, but the compiled binaries should work as normal when run on a 32 bit distribution.
To install gtk+2. Just pass gtk as a parameter. e.g.
./bmx-deps-install.sh gtk




Endive(Posted 2016) [#42]
I'm floored that this still works at all on modern linux. I fought it for hours to no avail, then days after giving up I tried the MaxIDE binary and it ran just fine. Only difference I can think of is that I hadn't done an apt-get upgrade.

Since it runs on Ubuntu (Wily at least) that should keep us going for another couple of years I would think. Thanks for your hard work Dawlane.


zymoesh(Posted 2016) [#43]
I have an issue where it segfaults when I try to run a program compiled in release mode. But not on debug. I have used the bmax.sh and patch.sh from here and they install/patch everything OK. I don't know what else to do.

I'm on Ubuntu 16.04.1 LTS. Using Blitzmax 1.50.


RustyKristi(Posted 2016) [#44]
64bit? I think I'm having the same problem before.


dawlane(Posted 2016) [#45]
I've seen this issue with Debian, but never with Ubuntu.
To get some information of where the segfault is occurring, you will need to make a few alterations to the bmk executable.

Proceed as follows:
1) Open the files bmk.bmx and bmk_util.bmx located in the BlitzMax/src/bmk directory. Select the open bmk.bmx via the tab and use Lock the build File from the Program menu to set it as the default build file.

2) Select the bmk_utils.bmx tab in the editor and locate this line:
cmd:+" -m32 -s -Os -pthread"
it should be line 331 within the ?Linux compiler directive section. Remove the -s options and save the file. The option -s will strip the debug symbols that we need to see where it goes wrong. This makes the resulting executable larger, so bmk will either have to be modified again or use a back up of the original, or use strip to remove the symbols.

3) As building a release version of the bmk compiler will give you the same problem, you should build it as a debug version. You will need to back up your original bmk located in the BlitzMax/bin directory by renaming it. You can then move the bmk.debug file from the BlitzMax/src/bmk into the BlitzMax/bin directory and rename it to just bmk. You must then rebuild all the modules to include debug symbols.

4) The project that is failing should have the build binaries and the hidden .bmk directory deleted. You can then open the projects main file and build a release version with debug symbols.

5) To use the debug symbols you will need to instal gdb and ulimit; the latter should already be installed. When these are installed, open a terminal and change directory to the projects directory. Then you need to generate what is known as a core dumb file. To do this type:
ulimit -c unlimited
and then execute the project binary, then wait until it crashes and creates a file called core

6) Now you can run gdb with
gdb ./<your-project-binary-name> core
replace <your-project-binary-name> with the name of your projects executable. It will stop where the crash is happening with the last function call of where the problem lies. If you type bt or backtrace it will give you a back-trace of the function calls that lead up to the crash. The problem could be in any one of those fuction calls.

To quit gdb, just type quit

The crash dump that I get with a Debian 8 release builds is:
Core was generated by `./oldskool2'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x080c6cb3 in bbMemExtend ()
(gdb) backtrace
#0  0x080c6cb3 in bbMemExtend ()
#1  0x080c2b14 in bbGCFree ()
#2  0x080c2ef1 in bbGCAllocObject ()
#3  0x080c5cd7 in bbStringNew.part.0 ()
#4  0x080c637b in bbStringFromShorts.part.4 ()
#5  0x080c650f in bbStringFromUTF8String ()
#6  0x080c75c6 in bbStartup ()
#7  0x0805058c in main ()

Edit: In this case the problem appears to be in the function bbStringFromUTF8String located in BlitzMax/mod/brl.mod/blitz.mod/blitz_string.c.

You would also need a bit of g++ and gcc information as it could be a problem with how the compiler was built as well as hardware and installed driver information.

The chances of getting anything fixed are very slim as BlitzMax is basically abandoned and Linux was always the runt when it came to updates, so if anything you generally would have to fix it yourself. You could try contacting Mark Sibly to see if he can help. But if you don't want to go into it; then I would suggest that you look at brucey's BlitzMax NG. But be warned, there are some coding things that will work in the Vanilla BlitzMax that will not work in Blitz NG, plus BlitzMax NG requires a bit of work to build.


skidracer(Posted 2016) [#46]
I am hoping to get to the bottom of this issue shortly as I just ran face first into it today.


Brucey(Posted 2016) [#47]
See https://github.com/maxmods/brl.mod/commit/a206dfe827f2796f6c3805eb2a880fd229b03fcd


Derron(Posted 2016) [#48]
As a side note:
There are some commits to maxmods/brl.mod and pub.mod which might be worthy to get "back"ported ("made official") to brl/brl.mod and pub.mod.


bye
Ron


dawlane(Posted February) [#49]
It sounds like 32 bit support for Debian, Ubuntu will be phased out next year for the newer releases. So it looks like vanilla BlitzMax would have to be package as a SNAP as would anything being created with it.


Brucey(Posted February) [#50]
And what about all the 32-bit dev tools and libraries required to build stuff?


dawlane(Posted February) [#51]
Hard to say at the moment. A lot of the news is from around June last year and maybe just hogwash as they said something like this before if I recall. But from what I remember, Google and a few others stopped 32 bit builds of their apps in 2015, so it wouldn't surprise me one bit. This is what's being proposed on the mailing list for Ubuntu
https://lists.ubuntu.com/archives/ubuntu-devel-discuss/2016-June/016661.html
I haven't seen anything concrete for Debian.

Edit: Just had a look a Debian 9 and looks like 32 bit will still be in, but support for old CPUs are being dropped. The base line for a 32 bit compatible CPU will be i686.