Monthly Archives: January 2014

Build Node.js on Debian ARM

Update 2015-02-15: So far, I have failed building Nodejs v0.12.0 on ARMv5

I have a QNAP TS109 running Debian (port:armel, version:7), and of course I want to run node.js on it. I don’t think there are any binaries, so building from source is the way to go.

About my environment:

$ cat /etc/debian_version
7.2
$ gcc --version | head -n 1
gcc (Debian 4.6.3-14) 4.6.3
$ uname -a
Linux kvaser 3.2.0-4-orion5x #1 Debian 3.2.51-1 armv5tel GNU/Linux
$ cat /proc/cpuinfo
Processor       : Feroceon rev 0 (v5l)
BogoMIPS        : 331.77
Features        : swp half thumb fastmult edsp
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant     : 0x0
CPU part        : 0x926
CPU revision    : 0

Hardware        : QNAP TS-109/TS-209
Revision        : 0000
Serial          : 0000000000000000

I downloaded the latest version of node.js: node-v0.10.25, and this is how I ended up compiling it (first writing build.sh, then executing it as root):

$ cat build.sh
#!/bin/sh
export CFLAGS='-march=armv5t'
export CXXFLAGS='-march=armv5t'
./configure
make install
$ sudo ./build.sh

That takes almost four hours.

A few notes…

make install
Naturally, make install has to be run as root. When I do that, everything is built again, from scratch. This is not what I expect of make install, and to me this seems like a bug. This is why I put the build lines into a little shell script, and ran the entire script with sudo. Compiling as root does not make sense

-march=armv4 and -march=armv4t
Compiling with -march=armv4t (or no -march at all, defaulting to armv4 I believe) results in an error:

../deps/v8/src/arm/macro-assembler-arm.cc:65:3: error:
#error "For thumb inter-working we require an architecture which supports blx"

You can workaround this by above line 65 in the above file:

#define CAN_USE_THUMB_INSTRUCTIONS 1

as I mentioned in my old article about building Node.js on Debian ARM.

-march=armv5te
I first tried building with -march=armv5te (since that seemed closest to armv5tel which is what uname tells me I have). The build completed, but the node binary generated Segmentation fault (however node -h did work, so the binary was not completely broken).

I do not know if this problem is caused by my CPU not being compatible with/capable of armv5te, or, if there is something about armv5te that is not compatible with the way Debian and its libraries are built.

Living with Nokia N8 in 2014

I have a Nokia N8 that I am still quite happy with. More than a year ago I wrote a post Living with Nokia N8 Belle in Late 2012. So how is it going? Here follows my findings for 2014.

2014-01-20 Weather Widget stopped working
The Nokia weather widget stopped working. There are many Weather Apps, but I want a Weather Widget on my home screen. I found that AccuWeather.com WRT Widget does what I need, and is free. Install it from the Store.

Lets see if my N8 is still with me in 2015.

2014-03-13
I experience problems with my system partition having too little available space (got a warning message about it). The easiest and most important way to free space is to delete your Sent Mails. And the mails in your Inbox too. It is an incredibly stupid design that attachments are stored on the very limited system drive.

2014-04-01: N8 Xeon & N8 Delight custom firmware
I got a comment from a reader suggesting me to try the custom N8 Xeon firmware – so I did!

These customs firmware are unsupported, unofficial and use at your own risk – of course. That said, it is really nice that there is a little community working to make nice devices like the N8 relevant in 2014!

I first tried Xeon firmware (since that was what I was suggested). The webpage and download didn’t really feel completely reliable – a little bit too much warez-feeling about it. The firmware itself was nice – quite a bit hacker-feeling about it. However, I could not figure out how get a Swedish keyboard with Xeon (and perhaps this is just my fault). So in the end I got rid of Xeon.

I found another firmware called N8 Delight. The webpages, documentation and instructions around N8 Delight gave me confidence, and it was easy to find how to get different keyboards (just download one file, and replace it in the complete Delight firmware download before flashing). N8 Delight feels simple, light and professional when installed, and I have more than 100MB available on C: (I suppose getting N8 Delight immediately, without flashing Xeon first, would give the same effect). I currently have N8 Delight v6.4, and I intend to keep it.

A few comments:

  • I provide no links or instructions; use Google and read for yourself, I am not an expert
  • N8 Delight is stripped of several standard Nokia Appliations, particularly Social (the Facebook client), and I ended up using fMobi instead, which is ok, but I miss the widget from Social
  • Skype is no longer available from the Nokia Store (F***ing Micro$oft), but you can find downloads of the last official version if you use Google.
  • My music and pictures were not lost in the flashing process, but my messages, contacts and settings were lost. Some applications were lost, others remained.
  • I use Funambol to backup/sync my contacts across different devices.

I am happy with N8 Delight, and I have no plans to get back to the official version of Belle. I am not completely sure I would go through this process again, and if you have an N8 with official version of Belle, and it works just fine, I suggest you think twice before playing with custom firmwares.

If, on the other hand your N8 Belle is a mess and you think about getting a new phone, I would definitely recommend you to try N8 Delight – perhaps that will extend the life of your N8!

2014-04-16
Occationally I forget to charge my N8, and find it out of battery. It happened twice last week, which made me worry the battery is dying. I installed “Nokia Battery Monitor” from the Store. It is unfortunately not a widget. But it gives other useful information, especially the level of charging with more details than the litte standard icon in the top right corner. It is annoying that the standard icon appears fully charged down to at least 51%. I switched off the background clock (which is very nice though) and put a 3G-on/off widget on my start screen as well.

2014-06-18
Well, I finally decided to retire my N8. I was not satisfied with battery life and I was not very satisfied with the web browser and the Facebook app.

It was not that easy to find another phone that really felt like an upgrade in every way though. FM radio is the feature I use the most, so iPhone (and unfortunately!) Jolla was out of the question. After having lived with not having access to the same apps as everyone else for three years, I was not willing to buy another Nokia with Windows. Good camera, good battery life, and compact design were my key requirements.

Sony Xperia Z1 Compact
I ended up buying a Sony Xperia Z1 Compact. It took a few days go get used to Android – first I felt there was so much of everything everywhere. After all, transition from Symbian to Sony Android was very smooth.

For me, even the Compact is on the brink of too big. But it is ok. It came with no headset, and it can be charged in a special magnetic charger, which is also not included. And since the Z1 is waterproof there is a little door that needs to be opened to access the USB port in order to charge. I bought the magnetic charger for about Euro 20. It is a cheap piece of plastic that gets the job done.

The End
A thank you to Nokia and the N8/Symbian community. My (blue) N8 is in very fine condition, I can sell it for a good price if anyone is interested.

Pure 64-bit AMD/Intel x64 CPU? Ever?

The big CPU wars seem to be over. Itanium is sinking. Alpha is since long abandoned. Power is IBM only, PowerPC is barely a niche product. Sparc is never going to be what it was.

We are left with MIPS (the Chinese seem to believe in it, and it is a good architecture, so lets have some more patience before we consider it dead).

We are left with ARM – the lightest and most simple architecture of them all. And ARM is about to be 64 bit (but very likely, ARM will most of all remain relevant and dominant in devices where 32 bit is very much enough).

And we are left with x86 (32-bit) and amd64/x86-64 (AMDs original branding, and Intels branding of the same thing after they licensed it).

From an architectural perspective, x86 is the worst of all the CPUs, and for rational reasons it was thought by many to one day be defeated by RISC (PowerPC, MIPS) or Itanium. But x86 persisted because Intel (and AMD) were good at manufacturing fast units at a good price, driven by an enourmous demand for CPUs running Windows and Windows applications.

Now, finally, x86 is getting less relevant more than 25 years after its first 32-bit incarnation: the 386 in 1986 (followed by 486, Pentium, Pentium MMX, Pentium Pro, Pentium II, Pentium III, Pentium 4… and then it just gets too complicated. Of course AMD K5, K6 and Athlon deserves to be mentioned as well, and there was also Cyrix in the beginning, and later Via). x86 is now losing, but not to anything less than its own successor x86-64.

I read there are those who want to drop x86 support (in Linux distributions), and as I have written about elsewhere support for pure x86 is limited in Ubuntu (requiring PAE). I believe x86 is there to stay – indefinitely (well not really). There is always the legacy and embedded market, and there will be a need for it.

But is there really a need for amd64/x86-64 to retain 32-bit backwards compability (and 16 bit)? I hear Windows 9 is going to be 64-bit only.

Of course there are always legacy 32-bit applications to run on 64-bit Windows – those will be fewer and fewer, and those can be emulated. Perhaps not a good idea today – but in a few years. But I guess Intel will not repeat the mistake of Itanium (where x86 was only software supported).

Of course there will always be the need to run a few old 32-bit OS, but there can be x86-boards built and sold for that purpose.

My idea is of course that a Pure 64 bit Intel i7 or Xeon would be able to use its silicon more efficiently, than a CPU that also has 32-bit compability in hardware. However the first Pentium had a little more than 3M transistors, while todays i7 have more than 2G transistors. So, including an entire Pentium processor (scaled down to modern process size) in a modern CPU costs… virtually nothing. At least not when it comes to transistor count, but perhaps there is complexity/legacy cost?

BIOS is not needed to boot a PC anymore.

So, when will Apple (of course, Apple will do it first, if anyone ever will) ship the first Pure 64-bit Mac OS X machine, with no 32-bit or 16-bit CPU or hardware modes?

Well, I am not going to mourn all those lost architectures. I was mourning Alpha and PowerPC, but it is over now. And Itanium – the world could have seen the ITER fusion reactor being built for the money Intel and HP spent to replace the superiour Alpha – what a shame for mankind.

Disclaimer: I am not an expert, and I have just been writing down my thoughts here. Feel free to comment or to correct me – be careful using this post as a source of knowledge.

Install Citrix Receiver 13 on Ubuntu 13.10

In this post I will explain how I installed Citrix Receiver (version 13) on Ubuntu 13.10 (Xubuntu x64 and Lubuntu x86 – but keep reading for other Ubuntu variants too).

The quick summary
Go to Citrix Receiver for Linux Download Page. Pick the generic tar.gz-version under 32-bit (yes, do this for 64-bit Ubuntu).

Then:

$ cd ~/Downloads

(nasty habit of not including a folder in the tar file:)
$ mkdir citrixtmp
$ cd citrixtmp
$ tar -xzf ../linuxx86-13.0.0.256735.tar.gz

(install, not as root)
$ ./setupwfc
   (choose 1=install
    answer yes to all questions
    use all defaults
    finally, 3=exit installer)

Now, if you are on 64-bit Ubuntu there are some 32-bit dependencies to take care of:

$ sudo apt-get install libgtk2.0-0:i386
$ sudo apt-get install libxml2:i386
$ sudo apt-get install libstdc++6:i386

If, on the other hand, you are on 32-bit Ubuntu, you can instead install these packages:

$ sudo apt-get install libwebkitgtk-1.0.0
$ sudo apt-get install libxerces-c3.1

Now, (re)start your browser, log in to your Citrix Portal, open an application. Your browser should suggest you open it with wfica.sh (located in ~/ICAClient/linuxx86). Do it – it should work!

You should now be able to use your Citrix applications in a productive way from your Ubuntu computer!

If you are on 32-bit Ubuntu, you should also be able to use the GUI Self Service application (I have not figured out how to fix the webkit dependencies for 64-bit ubuntu).

Feel free to read on for more comments and details.

What is Citrix Receiver and how do I use it

Citrix is a technology that allows an organization (your employer) to package applications (typically Windows applications) and make them available over the intranet or the internet. This way, you can run the applications on a computer without the need to install those application on the computer itself.

I have two ways to access my Citrix Applications.

The first way is via a web based Citrix Portal. I open my web browser, enter the URL of the portal and log in. Now, in the web browser, I see all my applications as icons, and as I click the applications they start in separate windows via Citrix Receiver.

The second way is to launch the Citrix Receiver Self Service application, give the address of the citrix servers and then authenticate. This method can enable “desktop integration” (your Citrix Applications are available via your normal Start Menu or whatever you call it). This Self Service application is new to Citrix v13, and replaced something else in v12.

The Web-browser way is easier to make work. There are unresolved dependency issues with the Self Service program and my solution above.

My #1 priority is to get a working solution at all.

Why not use the .deb packages
The deb-packages are obviously not built for Ubuntu 13.10. I believe they are built for Debian, but this must be confirmed.

The purpose of deb-packages is to automatically resolve all dependencies. But the dependencies are wrong for Ubuntu, and you will need to “force” installation of the deb-packages. In the future, this can leave you with conflicts and confustion.

So, I prefer the generic tar.gz-installation (which also works fine without sudo/being root).

Why not use the 64-bit packages
Well, first there is no generic 64-bit package, so I would end up resolving the dependency problems with the deb-package.

Also, the 64-bit deb-package actually contains 32-bit binaries. It is just the dependencies that are configured against the 32-bit compability libraries in Debian (instead of the standard 64-bit libraries).

So, nothing fun with 64-bit until Citrix actually compiles a real 64-bit binary with no 32-bit dependencies.

Other versions of Ubuntu
I believe what I have written applies not only to Xubuntu, but also Lubuntu, Kubuntu (may require more gtk-installation as it is QT based) and standard Ubuntu, and more. Please comment below if you experience something else.

Other versions of Linux
If you are on Debian or a Debian-derived distribution (like Crunchbang) I guess you should go with the deb-packages.

You really need the Self Service
Consider installing 32-bit Ubuntu on your 64-bit PC. Depending on what computer you have and what you do with it this may be a quite ok idea, or a very poor idea. I can admit I have been running 32-bit Ubuntu on a 64-bit PC for years, at work, specifically because Citrix worked better that way (even the old Citrix Reciever 12 had this issue, even if the Self Service looked different then).

What is the difference between Receiver 12 and 13
If you use Citrix via your web browser, you will not notice much difference (if any).

The Self Service is much different, visually, from the old Receiver. The old one looked like something for SUN Solaris and the 80s (motif-based). The new one looks like some kind of mobile app. I dont know which is worst. Many components are still the same.

If you currently run Citrix 12 and you are happy with it, I suggest you dont upgrade to 13.

Problems installing Citrix Receiver 12
If you want to install the old Citrix Reciever 12, have a look at my old post.

Troubleshooting
Your browser should allow you to download the ICA file (instead of launching it). Do it – it should be saved to ~/Downloads/lauch.ica. Now try to start it manually with wfica.sh:

$ ~/ICAClient/linuxx86/wfica.sh ~/Downloads/launch.ica

If you are missing dependencies they should show up here.

Final words
I consider this post “work in progress”. I’d like to

  • make Self Service work
  • confirm extra features (audio, drive mapping, etc) that might not work properly with my install above

But I hope it can be helpful even in this state. Feel free to comment!