Archive for the ‘Linux’ Category

April 29th, 2009

OK, so with today’s release of Maple version 13, this blog post is a little late but I started so I’ll finish! My original install of Maple was 12.01 on Ubuntu Linux and a little while ago an update was released to take this to version 12.02.

Installation

In theory I should be able to install this automagically by clicking on Tools->Check for Updates inside Maple. However, when I did this I was told that ‘no updates were currently available‘ so I had to download the update manually from here. I was very pleased to note that this update was offered free of charge to all Maple 12 users. This is exactly as it should be and other software vendors should take note here – users don’t like paying for bug-fix updates! Well done to Maplesoft for doing it right. Once I had downloaded the 12.02 update installer, the installation itself was pretty straightforward. The following incantations did the trick for me

chmod +x ./Maple1202Linux32Upgrade.bin
sudo ./Maple1202Linux32Upgrade.bin

A graphical installer fired up and all I had to do was click Next a couple of times and point it to my Maple 12.01 installation. A few seconds later it was all over.  It’s a shame that the automatic checker didn’t work but all in all this was a very painless experience!

Now since this update only increments the version number by 0.01 you shouldn’t be expecting any marvellous new features.  What you should be expecting is some tidying up and bug fixing and that is exactly what you get.  Maplesoft’s own description of the bug-fixes weren’t detailed enough for my tastes and so I appealed to my informants at Maplesoft for something more explicit.

Happily, they delivered and most of what follows is from them.  Thanks Maplesoft :)

Since 12.02 was released along with the launch of MapleSim, many of the updates were geared towards symbolic manipulation and simplification, which is always beneficial for any advanced computations, but very important for MapleSim. As such, the best examples to illustrate the updates are in MapleSim, and are not easily shown with a Maple example alone. More specifically though, there were other enhancements and fixes that were added to Maple 12.02 to help improve it, which are not tied directly to MapleSim:

Updates to dsolve

There were two significant issues present in Maple 12.01 and earlier that are not present in Maple 12.02. One of these deals with a certain class of singularities that are transparent to explicit rk-pair based numerical solvers.

As the simplest example in this class, the differential system:

dsys := {diff(x(t),t)=x(t)/(1-t),x(0)=1};

having the exact solution:

dsolve(dsys);

has a singularity at t=1, and exactly ‘0’ error according to explicit rk-pair error estimation.

This, and other related singularities (such as jump discontinuities) are now detected to provide an accurate numerical solution. Compare this output from 12.01

dsn := dsolve(dsys, numeric);
 dsn := proc(x_rkf45)  ...  end proc
dsn(0.999);
[t = .999, x(t) = -48.3295522342053872]
dsn(1.001);
[t = 1.001, x(t) = -48.4646844943701609]

with the improved output from 12.02

dsn := dsolve(dsys, numeric);
 dsn := proc(x_rkf45)  ...  end proc
dsn(0.999);
 [t = 0.999, x(t) = 1000.00023834227034]
dsn(1.001);
Error, (in dsn) cannot evaluate the solution further right of
.99999999, probably a singularity

The second fix deals with error control on index-1 (non-differential) variables in the problem. This can be seen if you take a trivial problem coupled with a non-trivial index-1 variable. For example: In Maple 12.01:

dsys := {diff(x(t),t)=1, y(t)=sin(t), x(0)=0}:
 dsn := dsolve(dsys, numeric):
 dsn(Pi);

[t = 3.14159265358979, x(t) = 3.14159265358978956,
     y(t) = -0.00206731654642018647]

dsn(2*Pi);

[t = 6.28318530717958, x(t) = 6.28318530717958357,
     y(t) = -0.0623375491269087187]

The ‘y’ value should have been zero. In Maple 12.02:

dsys := {diff(x(t),t)=1, y(t)=sin(t), x(0)=0}:
 dsn := dsolve(dsys, numeric):
 dsn(Pi);

[t = 3.14159265358979, x(t) = 3.14159265358978956,
     y(t) = -0.117631599366556372 10^-6  ]

dsn(2*Pi);

[t = 6.28318530717958, x(t) = 6.28318530717958090,
     y(t) = -0.130170125786817359 10^-6  ]

which is zero within the default error tolerances.

Plot Annotations bug fix

In 12.01, some plot annotations were not appearing as expected. When a text box was entered on a 2D plot, the text would not appear until focus was taken away from the text box itself. For example, if you were to create a plot of sin(x) plot(sin(x)) and then click on the plot, select drawing from the toolbar and then select ‘T’ to enter a text field, you could begin typing, but would not receive visual feedback of what you entered until you clicked outside of the textbox. Obviously, this was a bug, and it was fixed in 12.02.

Improvements to embedded components

Prior to 12.02, some installations of Linux displayed some issues with redrawing of various embedded components, which slowed down scrolling in a Maple document. In 12.02, Maplesoft added a few fixes to the way that they handle embedded components, especially for 32-bit systems, which took care of this issue for most Linux installations. Also, since they were in the area, they took the opportunity to tweak response times for embedded components when creating them and executing the code that dictates their behavior in a document. This is not *very* noticeable when you have just a few components in a document, but it becomes very visible with Maplesoft’s interactive ebooks and with user applications that rely on a large number of components in a single application.

Excel Link improvements

In Maple, there is a built-in link to Microsoft Excel, so that you can perform Maple computations within an Excel spreadsheet. Maplesoft started supporting Excel 2007 in Maple 12, but with a service pack release to Windows released shortly thereafter and some security enhancements added to Maple, the link did not perform as expected in 12.01. Certain values were being interpreted incorrectly, as such, Maplesoft felt that they needed to address these inconsistencies as soon as possible. So for 12.02, they fixed the link for Excel 2007 to ensure that values were faithfully being passed from Microsoft Excel to Maple, in order to maintain the connection and computation accuracy.

April 23rd, 2009

When I bought my Dell XPS M1330 it had Ubuntu Hardy Heron (8.04) installed and I quickly upgraded to Intrepid Ibex (8.10) using the update manager with only minor problems. Well, after today’s release of version 9.04 of Ubuntu, otherwise known as Jaunty Jackalope, I decided to jump on the bandwagaon and upgrade yet again.

It never ceases to amaze me how easy it is to go from one version of Ubuntu to another.  I just typed the following in the terminal and followed the instructions

sudo update-manager -d

A couple of hours or so later and I had a shiny new operating system up and running.  Lot’s of people have written about the new stuff in this latest version of Ubuntu so I won’t repeat any of that but what I will do is report on how the upgrade affected (or otherwise) some of my favourite mathematical programs.

  • Mathematica 7.0 seems to have been unaffected and works just fine.
  • MATLAB 2009a seems to be just fine too.
  • Maple 12.01 is working perfectly.

How very dull!  Nothing to fix at all with these three.

Youtube sound problems

For some reason there is no sound on Youtube videos.  The following fix is touted by some but it didn’t work for me as I already had the package installed

sudo apt-get install flashplugin-nonfree-extrasound

So far I haven’t managed to find a fix for this issue but will update this page if that changes.

Sound is too quiet (FIXED)

The sound output on the M1330 has always been on the quiet side but as of this update it is so quiet that I can barely hear a thing (and before you ask – yes I have checked that the volume is set to maximum.  Hopefully I’ll find a fix for this too.

Update:OK so it turns out that I didn’t have ALL the volume sliders turned up to maximum.  The path to success lay in installing and running gnome-alsamixer.

sudo apt-get install gnome-alsamixer
gnome-alsamixer

and then ensure that all of the sliders are turned up to maximum.  MUCH better!

I’ll update this page as I find out more info.

January 23rd, 2009

I’ve just installed the Intel C++ compiler on a Ubuntu 8.04 system and when I try to compile something I get the error message

Catastrophic error: could not set locale “” to allow processing of multibyte characters

I fixed this by adding the following to my .bashrc file

export LANG=C

Maybe this will help someone out there.

January 15th, 2009

From time to time I find it necessary to connect to my University’s VPN network and I have to use the Cisco VPN client in order to do it.  Ever since updating my machine from Ubuntu 8.04 to 8.10, running the VPN client causes it to crash in the most horrible way.  It locks up completely and various lights such as Caps Lock flash on and off repeatedly. The only way to recover from this is to switch my machine off, reboot it and never run the Cisco VPN under any circumstances.

Well, thanks to a user forum I found recently, I have a solution (sort of).  The problem stems from the lack of multi-core support in the Cisco VPN client so one workaround  is to turn off multicore support on your machine.  I did this via the bios in my Del XPS 1330 laptop and when I rebooted the VPN client worked perfectly.  Of course this means that I am only using half of the full potential of my processor but since I don’t use the VPN client all that much I figure that this solution is good enough for now. Once I have finished using VPN I just reboot and turn multicore back on.

January 9th, 2009

Say you have a file called alpha.txt that contains

a
b
c

and another file called numbers.txt that contains

1
2
3

and you want to concatenate them together such that the resulting file reads

a 1
b 2
c 3

Of course this is a fairly trivial thing to do in any number of programming languages but I believe in not programming anything if I can possibly get away with it. With that in mind here is a standard Linux command (included in Ubuntu at least but probably in most other versions of Linux as well) that will do this for you.

paste alpha.txt nums.txt > joined.txt

By default, the paste command separates fields by tabs but you can easily change this with the -d switch. For example

paste alpha.txt num.txt -d , > joined.txt

results in a comma separated value (CSV) file

a,1
b,2
c,3

December 18th, 2008

After realising that my shiny new Dell XPS M1330 could make use of CUDA I had a bash at installing it on Intrepid.  The notes at the following link were very useful but I did not follow them to the letter.  I can’t remember what changes I made but it was all minor stuff.

lifeofaprogrammergeek.blogspot.com/2008/05/cuda-development-in-ubuntu.html

When I tried to compile the examples that are included in the SDK I got many many errors – some of which included

In file included from src/cmd_arg_reader.cpp:33:
./../common/inc/cmd_arg_reader.h: In member function ‘const T* CmdArgReader::getArgHelper(const std::string&)’:
./../common/inc/cmd_arg_reader.h:416: error: must #include before using typeid
./../common/inc/cmd_arg_reader.h:432: error: must #include before using typeid
src/cmd_arg_reader.cpp: In destructor ‘CmdArgReader::~CmdArgReader()’:
src/cmd_arg_reader.cpp:101: error: must #include before using typeid

A bit of googling helped me determine that these errors were caused by the fact that 8.10 of Ubuntu uses a version of gcc that is currently unsupported by CUDA. The following commands fixed that by changing the default compiler to gcc-4.1

sudo apt-get install build-essential libglut3-dev gcc-4.1 g++-4.1
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.1 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.1

Some other things I did may have helped but it was the two lines above that fixed the problem for me

December 11th, 2008

Those of you who know me personally will know that it takes a lot to stun me into silence but the story in the following link did just that.  I’d say more about it but am too stunned for words….

http://linuxlock.blogspot.com/2008/12/linux-stop-holding-our-kids-back.html

November 13th, 2008

If you double click on a MATLAB .m file on a Windows machine then it will open the file in the MATLAB editor by default.  So how do you get similar behaviour in Linux you might ask?  This question was recently posed on the MATLAB users group and since no one gave an answer I thought I would have a go and see what I could come up with.  After all, how hard could it be?

I’ll cut a long story short and just tell you the solution.  To be specific the following tip works on Ubuntu 8.10 running GNOME 2.24.1 but I imagine that a similar procedure would work for some other setups as well.

  • Right click on any .m file you like and, in the menu, click on Open With->Open With Other Application
  • Click on the arrow to the left of Use a custom command
  • In the resulting dialogue box type


matlab -desktop -r "edit %f"

  • Click on Open

MATLAB will start up and then the editor will open your file. In future you will not need to type the above command because GNOME will have added an extra item to the Open With menu – namely Open with “matlab”

Hope this helps someone out there and, as always, comments are welcome.

If you enjoyed this article, feel free to click here to subscribe to my RSS Feed.

November 2nd, 2008

Last night I started the upgrade from Ubuntu 8.04 (Hardy Heron) to Ubuntu 8.10 (Intrepid Ibex) on my new Dell XPS M1330 laptop. I prefer to do a dist-upgrade rather than a clean install and I am pleased to say that it all went quite smoothly.

The only minor problem I have come across so far is that I lost sound on Youtube videos. The fix was straightforward:

sudo apt-get install flashplugin-nonfree-extrasound

Many people have written about the new features in Ubuntu 8.10 so I won’t re-cover that old ground but I will say that nothing in the upgrade broke my installs of Mathematica 6.0.3 and MATLAB 2008b – everything seems to just work and this latest version of Ubuntu feels great.

October 7th, 2008

So..I finally get hold of a standalone copy of MATLAB 2008a and set about installing it on my Ubuntu laptop. I have installed MATLAB literally hundreds (if not thousands) of times so this is going to be easy. Right? Wrong!

I am using the installation DVD which is mounted at /media/cdrom0 so I type the following into the bash command prompt:

/media/cdrom0/install

bash: /media/cdrom0/install: /bin/sh: bad interpreter: Permission denied

gah! OK, no problem – I’ve seen this before so I type

sh /media/cdrom0/install

-------------------------------------------------------------------

    An error status was returned by the program 'xsetup',
    the X Window System version of 'install'. The following
    messages were written to standard error:

        /media/cdrom0/update/install/main.sh: 178:
                 /media/cdrom0/update/bin/glnx86/xsetup: Permission denied

    Attempt to fix the problem and try again. If X is not available
    or 'xsetup' cannot be made to work then try the terminal
    version of 'install' using the command:

            install* -t    or    INSTALL* -t

-------------------------------------------------------------------

    Sorry! Setup aborted . . .

Permission denied? Ahh, I should have used sudo – silly me. After all, if I don’t then I am going to run into trouble eventually. So I try

sudo sh /media/cdrom0/install

Same result as before it seems. Let’s try the suggestion given by the install script and run the text only installer:

sudo sh /media/cdrom0/install* -t

I get asked if I want to agree to the license agreement before getting this error:

/media/cdrom0/update/install/main.sh: 582: /media/cdrom0/update/bin/glnx86/xsetup: Permission denied

Before I rolled my sleeves up and got my hands really dirty I did some googling. This link offers some advice – unmount and remount the DVD as follows:

sudo umount /media/cdrom0
sudo mount -o exec,suid /dev/scd0 /media/cdrom0

then run the installer again:

sudo sh /media/cdrom0/install

Success! Hope it worked for you too :)