Depth of Knowledge

Thoughts from a tech consultant.

Intel C Compiler, GTK and OpenBSD on Windows

I am currently working on the windows port of the Volume Management application that has consumed my waking moments for the past several months.

I wrote the application using GTK+ for a number reasons:
  • Wanted to learn GTK
  • Portabilty (Although a LOT of this is on my shoulders)
  • I wanted to learn to apply the Gnome HIG
  • I wanted to
  • I don’t want to write it in
  • Because I can
This is all well and good while running on my linux desktop, however, as I knew from the beginning, I would need to port the application over to Microsoft Windows. Since I imagine that nearly ALL the target audience of this application uses Windows, this is REALLY important.

To make this happen, I have written a decent initial implementation of the application for my linux desktop, copied it to the Windows partition and opened it up inside of Visual Studio (with nice project files and all). Now comes the really quite hard part.

GTK is not native to Windows. So looking at the the GTK site, it is moderately evident that one is expected to build their Windows apps from within a linux(y) environment via some sort of cross-compiler voodoo.

Hmm, what to do.

I happen to own a rather expensive license to Visual Studio 2005 Professional. Shall I just leave it and head back to linux or, shall I try to get my program built against the mish-mash of binaries available from gtk.org or should I go for broke and setup a complete build system for all of GTK and its dependencies?

Hmm….

A number of years ago I tried to do the whole dependency tree thing in an attempt to get FreeOrion built in Visual Studio. A great deal of time later and I was never able to get a binary which would actually start. Then again idea of compiling windows software in linux seems a bit silly, kind of in the realm of “just because you can does not mean you should”. And this has me wondering about the quality of the binaries available at gtk.org, they are probably fine except I have no real auditing trail for their construction.

So after an hour or so of deliberation, I have concluded that come hell or high water, I shall make my application run from the ground up building all the necessary binaries from scratch along the way. Visual Studio really shines here with built-in dependency management. If I change a dependency, it triggers a rebuild of all the dependent components right the way up the tree.

Next problem though is the compiler. While the C++ compiler in Visual Studio is getting markedly better with each release, the C compiler is rather out of date and is likely going to remain this way for ever and ever. Also the C runtime is currently missing a lot of the new goodness available these days. For instance asprintf (which gets rid of a lot of head aches, especially when customizing SQL calls).

The C runtime is something relatively easy to work with, as I can just create my own DLL of any missing functionality. OpenBSD provides what I consider to be the most desirable implementations for this kind of stuff, so I have pulled strlcpy, strlcat, asprintf and others into what is now bsdc.dll

And lastly is the compiler. I thought about this long and hard, and finally concluded that I really want to be able to use the latest innovations in C, so I bit the bullet and bought a license to the Intel C compiler. The installation is easy and switching compilers is straightforward from inside the IDE.

Assembling the project is nearly 50% complete at the time of this writing, and I will post with an update as to how it all goes together when I get my app finally running.

Also I will publish the build environment when it is ready as well in case there is anyone else out there who wants to do the same thing (inkscape? pidgin? evince? gedit?). It would really be nice to have a serious development environment available for this kind of thing.

Hamster and Further Topics

I am thoroughly disappointed in the Gnome folks for posting a pic of the new time tracker applet in 2.28 with the title “Hamster”. Why should a project with that name be allowed into gnome proper. That said I do quite like the applet. I think.

Anyways, the much anticipated Gnome 2.28 was released a while ago. I have been running the development version of OpenSUSE for the past while, which has been more or less tracking the development of Gnome so by this point, all I have to say on the matter is, meh.

It’s a desktop environment, and for somethings it meets my needs, and for others, I couldn’t care less.

In unrelated news, I have recently filed a shwack of bugs against opensuse factory in an attempt to stabilize the desktop for myself. I have not been terribly happy with the overall stability of the development versions of opensuse, and am constantly running into stability problems an a variety of quirks.

That said, I am strongly considering moving to OpenBSD for precisely this reason. While I like to be on the bleeding edge of things, I have had quite of enough actual bleeding thank you very much.

So, in conclusion, hamsters should be shot, instability = bad, and my laptop is burning my tummy.

Posting to Blog From Links

Well, here is the first time that I have done anything like this. The latest milestone from OpenSUSE is broken. Apparently they patched HAL with a crummy patch or something and now when you boot the OS hal crashes and you cannot access your mouse or keyboard while X is running….

Not the slickest thing that I have ever seen.

Anyways, I booted to the commandline rather than start X and am posting this comment from the links browser.

I couldn’t tell you if I like the experience, but it is definitely a first for me.

Anyways, this is not meant to be a profound or indeed informative post, I just wanted to see if I could actually do it from the commandline line in text mode, and it turns out that I can.

Now I am going to go to bed just because it is that time of day.

So long.

Ted

Accuracy of a GPS in a Car

So I have been having fun the past two days driving around Canyon Meadows (here in Calgary Alberta) with my GPS collecting information to post to Open Street Map. Although I have used the GPS for most of the summer as I scooted across the country with my bike, I have not done much with it in terms of actual mapping.

Now that I am officially back in town, I figure that a little bit of mapping would be fun to do, after all there is hordes of information missing even from the community within which I live. So last night, one of my boarders and I hopped in the car and drove the alleys of NW Canyon Meadows. I was slightly disappointed to discover that when I plugged the data in JOSM, the track was jagged and in areas, clearly wrong. What could be the problem? I have used this before to map the town of Empress Alberta without much difficulty.

It occurred to me while lying in bed that maybe the problem had to do with where the GPS was stationed in the car. On our midnight saunter, the gps was held in my passengers hand somewhere around or below his lap. Could this cause the problem? Maybe the unit needs better line of site to the satellites, and even the moderate amount of flesh and metal in the way was interfering with this.

Perhaps this is bang on because I just got back from another little jaunt where I had the GPS sitting on the dash. The result is considerably better and dramatically smoother. So the moral of the story is that the best place for your GPS while in a car is somewhere near the dash or somewhere with more or less clear access to a large chunk of sky. I suppose the more sky, the better.

As a side note, the unit was reporting on average +- 3 m the second time around.

Open Office Needs Document Themes

I just spent a few minutes looking over the latest OpenOffice.org pile of poop included with opensuse 11.2 M6. My goodness, this is a poorly thought out user interface design. The application I am talking about particularly is writer.

So I want to make a nice looking document with a decent title page and some nicely coloured headings all laid out with matching font choices. I do not want to spend more than a minute or two thinking about these things either. Please just make this the default. I have to say I deeply prefer using the latest microsoft office compared to openoffice. Document themes is a brilliant feature of office 2007 and it takes away the vast majority of mucking around that I have done with open office.

To make a document in open office look pretty this the primary styles dialogue that you are given to work with:



Like seriously, what the hell is this. What the hell am I supposed to do here? Why am I shown this window, I can’t do a freaking thing with it?

So I double click on the the first thing that jumps at me in the list, nothing happens… hmmm ok, so I right click on it and I am presented with a deeply useful menu saying two things


  • new…

  • modify…



I can figure out the “modify…” item, it probably modifies what ever the default is, but what the hell does new… mean? Why are there trailing dots? If I click new… does it make a new default?

Anyways, I don’t want new things, I just want a pretty document, so I click modify with the hopes of encountering a switch somewhere which says enable pretty document. No such luck. I am presented with a second almost utterly useless window.



Now seriously, what the hell am I looking at here? Look at all those damn tabs up there!

Moral of the story is I really don’t like to use open office, it is effectively a poor clone of an older microsoft office in the ui realm. Am I a microsoft guy? No. Have I hunted for things in their new ribbon layout thing? yes. Their office suite does what I need of it and makes an honest attempt to get out of my way.