Tag Archives: compile

This post is half aide-mémoire and half public service announcement! I use nmon at work to gather performance data, and I use customised version of nmon2web to graph it. nmon2web relies on rrdtool, and I do a lot of my UNIX stuff these days using Cygwin. Rather than use the Windows rrdtool binaries, I wanted to compile the latest version to run directly under Cygwin.

I’ve done this a few times now, with different Cygwin installs on both Windows XP and Windows 7, and every time I have to fight against various compilation issues. I’ll cut to the chase, I hack at options and compiler settings and configure flags until it works, and I turn off most of the additional stuff to get it in. But, it does work.

Get the Pre-requisites

All of the libraries and pre-requisites you need can be installed directly within Cygwin. You’ll obviously need the regular development stuff (gcc, make, etc.) and you’ll also need the various libraries used by rrdtool. Rather than worry about what you do and don’t need, I just whack on everything. This is what I’ve got installed for each of the pre-reqs.

and as I said, you need to prevent any undefined symbols in the libraries,

export LDFLAGS=-no-undefined

and then I basically turn off all the additional modules (perl, tcl, python, ruby) as well as mmap which doesn’t seem to work well under Cygwin anyway. –prefix here is optional, it defaults to /opt, but I prefer everything under /usr/local.

*** Warning: linker path does not have real file for library -lstdc++.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libstdc++ and none of the candidates passed a file format test
*** using a file magic. Last file checked: /usr/lib/libpthread.a

because of the -no-undefined flag. But again, doesn’t seem to break anything.

On Windows 7 (can’t remember if I got this on Windows XP) you’ll also get,

Finished!

So, know a better way? Know why some bits still don’t work? Know a sure fire way of fixing the warnings (if necessary), or getting rrdupdate to work, or being able to compile the additional modules? Let me know!

In real life, unlike in Shakespeare, the sweetness of the rose depends upon the name it bears. Things are not only what they are. They are, in very important respects, what they seem to be. - Hubert H. Humphrey.