Saturday, June 23, 2007

Status Update

Hello everyone. It has been a while since I've posted an update to this. Since my last post the focus of the installer has shifted from Linux/OSX to that of Windows. According to Paul, around 85% of the implementers will be using Windows, so that needs to be the immediate focus. So, my current focus is learning the tools of the Windows trade, and then getting a basic installer going that I can build off of. I hope to have a lot of this work knocked out by the end of the weekend.

As for the Linux/OSX installer, I should have no problems stepping away from it and then revisiting it later. The script is in a relatively stable and mature existence right now, and the main issues left to be addressed with the Linux/OSX installer involve design choices (how to distribute packages, how many different downloads to have, etc...). I've been having in-depth discussions with a lot of people trying to resolve all of these design issues, so I'm not at all worried that the final product will be great.

I'll have an update by the end of the weekend detailing some of the struggles I encountered while trying to "port" my Linux/OSX script over to Windows, the technologies I used to achieve the task, and my outlook on the future. Good luck on your projects, have a safe weekend!

Tuesday, June 12, 2007

Linux / OSX Dependency Checking Script

Hello all. Today, I spent the better part of 10 hours writing a BASH script that aims to identify dependency issues for OpenMRS. The script seems to work on most any Linux distro as well as OSX. But please, test it out, and let me know what you find. If something doesn't work, chances are parts of your system are out of date. Before running the script, please ensure that you have an updated version of BASH. I'm running version 3.2.17(1)-release.

$ bash --version
GNU bash, version 3.2.17(1)-release

The script depends on AWK as well, but the version shouldn't matter and most systems have this by default anyways. The script will notify you if you are missing needed dependencies, or if the versions you have are out of date. If you receive syntax errors, that's what I need to know about. Also, if you are absolutely positive that the script is providing wrong information (i.e you have the latest version of XXX app, and it says you either don't have it, or it's too old) tell me that as well.

You can download the script here: http://discosoup.net:8080/~agent/depend-check.sh
(Make sure you open that in a new tab)

Just do a chmod +x depend-check.sh and then:

bash ./depend-check.sh


and you should be set.

Thanks goes out to Matthew Harrison "[omegentoox]" for helping me test the code out on a few different platforms, as well as for the hosting of the script.

Monday, June 4, 2007

Development Environment

Well, the weekend didn't go entirely as hoped in terms of getting a stable development environment setup in Windows. The reason for this is the current state of the installer that I'll soon be taking over. The issue is with how it handles systems that already have some of the dependencies installed. However, I can outline some basic things that I require to develop software on a Windows platform (aside from patience, alcohol, and a very, very, very good reason...)

1. Netbeans / Eclipse

Some people don't like Netbeans; I do. I use it exclusively on Linux for all of my development. We could get into the IDE war, but I see no reason. People should use the tool that works best for them, and for me, Netbeans hits the mark. It is a bit slow on start up, depending on your system specs, but my machine is a beast, so no issues there. I prefer to use Netbeans for all of my file needs under Windows. (Wordpad / Notepad leave miles to be desired...) Netbeans has also recently released a C/C++ addon pack that offers all of the goodies for those languages - code completion, standard library reference, syntax highlighting, header files, makefiles, etc. My original draw to any sort of IDE was simply syntax highlighting and automatic indention; I never used it to complete code for me or anything like that. In fact, I always felt hindered by code completion because I felt I had to actually do MORE thinking to get something done rather than just knocking it out by hand. As time has progressed, I have found it useful having a reference to my own classes that I've created so I don't have to switch back and forth to see the variable names I used and whatnot.

2. Mingw32

I was recently turned on to this UNIX emulation environment because I wanted to have access to gcc/g++ under Windows. There is a one-click binary installer floating around on the net somewhere that gets you up and compiling with gcc/g++ in a matter of minutes. You also get some other basic UNIX tools and utilities, like vi, make, etc...

3. Command aliases

Good habits are pointless to break, so I make sure to alias all common file system navigation commands in Windows to those in UNIX. For example, ls, rm, cp, mv, etc... This just involves making various .bat files with the UNIX command as their name, and having them execute the Windows version of that command using the "%" to signify the command arguments. Really basic and simple. Of course, with Mingw32, you don't have to do this.

4. Path Variables

I always fight with path variables in Windows, so I have to go in and make sure all of my java commands are in my path, as well as the above-mentioned alias commands. It may be a good idea to make your own folder for the aliased commands and add that to your path, as opposed to dumping all of those .bat files into system32.

That's about it, really. As long as I can type commands I'm familiar with, edit files easily, and have them compile easily, I'm happy. Essentially, it can be summed up into about 2 downloads depending on how you do it. Via the Java website, you can get Netbeans bundled with the Java SDK, and then you're set with Java. Then, Mingw32 is one download and you're set with all of the UNIX tools, including gcc/g++. The other things are just basic configurations.

I hope this has been helpful for those of you that develop primarily on a UNIX based system, as I do. I honestly feel I get stupider when sitting in front of a Windows computer. I've got 2 Windows certifications and I've been involved in administration and tech support (hardware and software) for about 7 years now, but I'm always more productive and comfortable (and happy) sitting in front of anything with a BASH prompt.