Wednesday, February 2, 2011

Freeciv Example

For homework I followed the directions here to install the Freeciv code in Chapter 5. I especially liked the advice of Google being your friend, which I found out the hard way in my early experiments with Ubuntu. I checked out the Freeciv code with subversion and updated it, and then opened the INSTALL file for further directions. I didn't seem to have nearly as many dependency issues as the author describes, but I also have a bad habit of tinkering with my system much too frequently and probably had already installed some of these packages along the way, or else Ubuntu just likes making things easy. My biggest problem actually was that I tried to build the code on a FAT32 partition instead of my ext4 home and libtoolize continually failed to create symbolic links until I remembered that partition never plays nice with those. Moving the freeciv folder to a normal Linux filesystem immediately resolved the problem.
The autogen file went right on into configuring everything, but then failed when looking for a libcurl dependency, so I installed libcurl3-dev, and had no more issues with that either. I mindlessly ran "make" afterwards because that's what the end of the configuration told me to do, but then saw in the chapter they wanted us to output the logs to files. I felt no need to rerun make with the logging because I believe the author's commands to do as they say, though the "1" (standard output) and "2" (errors) indicators were new to me. I did enjoy the author's supposedly "serious business" link to the always-nerdy xkcd comics.

From what I could make of the whole experiment is that the autotools program generates the configure file for the project, which eventually leads to a successful compilation of code according to the diagram at the end.
In relation to the class, I guess it would be a good thing for us to know what's going on inside the autogen script so as to build better code all around.

My main concern though is why is this presented so late in the game? Hopefully we all, whether on our own time or for a class, have compiled code from source before. And if not, why isn't this stuff taught in lower level classes? Of course, introducing these issues in Programming 101 might scare people away, but learning how to program inside a single secluded environment isn't helping anyone when it comes to the importance of a code's interactions and distribution among people and other machines.

No comments:

Post a Comment