Dec. 16th, 2004

maradydd: (Default)
A while back, I mentioned Klein, the network topologiser I wrote. I haven't added any new functionality to it yet, but now it's all packaged up and ready to be used by other people, courtesy the GNU autotools, which I've been fighting with off and on for the last couple of weeks. Last night, I discovered why my configure script couldn't find one of the libraries the program depends on -- it turns out that the AC_CHECK_LIBS macro in autoconf can't handle looking for C++ library functions that are in namespaces, or which don't have C linkages (i.e., aren't in extern "C" { ... } blocks). Tonight, I figured out a hack around it, which I reproduce here for anyone who might need it:
First, grep through the header for your C++ library to find a function with an extern "C" declaration (alternately, use nm and look for a function whose name isn't mangled). Look for a function that takes no parameters, otherwise your configure script will choke on it later. If you can't find one, look through the includes that your C++ library uses and see if you can find a C library that your C++ library links to statically. (I'll be honest: your guess is as good as mine on how to do this. I got lucky.) Pick any parameterless function from that library. Whichever you pick (a parameterless C-linked function from the problem library, or a function from some C library your problem library depends on), use that as the argument to AC_CHECK_LIBS. You may also need to use -lstdc++ as the OTHER-LIBRARIES argument in order to resolve linker errors, which would make the entire macro look like
AC_CHECK_LIBS(foo, bar_not_in_foo, , , [-lstdc++])
This dodges the problem by checking for a function that autoconf can deal with in a library that autoconf normally couldn't, whether that function really belongs to the library or not.

If you'd like to give Klein a spin, you can download it here. You'll need to have libpqxx (edit: um, and the Boost graph library, right, I meant to include that in the source tree) installed in order to compile it, and you'll need to have or make a PostgreSQL database with two columns that you want to use as the sources and targets of edges if you want to use it.

I'd like to make sure that I did this right, so if you're willing to download and build it, I'd appreciate a heads-up on whether it worked!
maradydd: (Default)
In other news, Debian continues to be annoying in my sight. I have a marked dislike for distributions which think they know how to package software better than the people who wrote it in the first place <coughFedoracough>, which is one of the things I appreciate about Gentoo: emerge manages dependencies, potential stability problems, and installation locations, and generally speaking, that's about it. What, I ask you, is the purpose behind providing a library and not providing its header file? Yes, yes, I know I get the attendant header from the -dev package for the app in question, but that's not the point.

Infidels. They will be the first against the wall when the revolution comes.

This is probably not the attitude the department wants me grading final exams with, but I have to keep myself amused somehow.
maradydd: (Default)
It's been one of those "When they love you, they really love you" kinds of days.

More later.
maradydd: (Default)
All right, you pervy fuckos, here's what happened today.

Late last night, I got an email from my adviser reminding me that we really needed to get some use cases ready for the grant proposal he's writing. I'd planned on coming in to work today anyway, so I left my boss a voicemail letting him know that we needed to get that done.

After grading till about 4 am, I got up around noon and checked my mail; there was a terribly excited email from Andy saying "absolutely, yes, let's do that this morning if at all possible." Ack. I replied saying "right, I'll be in around one," dropped off the exams with Dr. Atkinson, and went to work. Andy was in a meeting, so I started reading some papers for the database research I'm working on, and eventually decided that I really ought to reply to Lucy's email about the project she wants an intern for this summer, so I got busy on that.

Suddenly, [livejournal.com profile] martian_bob IMed to suggest that I could turn Klein into a paper for ACL '05, and threw me a paper on link prediction in social networks. Ack again. Printed it out, printed out the paper Lucy had sent me so that I could comment on that, and when I went to the printer I noticed that Andy was in his office. He filled me in on an Exciting New Business Development That I'm Not At Liberty To Describe which my db research will be ridiculously useful for, which is Good because it means IDT has even more reason to let me do research at work. Right - even more reason to get that grant proposal ready, then! "Give me fifteen minutes to finish up this email," I said, banged it out, started reading the link prediction paper while waiting for Andy to finish the discussion he'd gotten into, and off we went to Panera (neither of us had had lunch, and it has free wifi). In one of those amazingly lucid frenzies that happen so rarely during time crunches, we came up with about five different use cases and a sensible format to present them in, fired off an example to my adviser, got back an "OK, looks good, we can talk about it more at the department party tonight," sat back and said, "Wow, we got all that done in an hour?"

What I forgot to mention is that I've been sucking down double-strength coffee ever since I got to work, and spent the Panera meeting mainlining Dr Pepper. I've had so much caffeine that I can see through time.

Profile

maradydd: (Default)
maradydd

September 2010

S M T W T F S
   1234
567891011
12131415 161718
19202122232425
26 27282930  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags