Home > GNU/Linux, Programming, Tools > Always check config.log!

Always check config.log!

I was having some trouble today with Autoconf: the m4 macro
AC_CHECK_LIB wasn’t finding my haploid genetics library even though the function I specified was definitely there. I read about how this test works and was still dumbfounded. I read a whole bunch of blog posts with people complaining and talking about switching to CMake and SCons because the autotools are just so old-fashioned (like, they’ve been around since the late nineties!).

But only five minutes after sending a message to the autoconf mailing list, I got a reply from a RedHat employee with the very simple message: look in config.log! He was nice about it, and very helpful, but he had every right to act like an elitist jerk: I looked in config.log and what I found was that I hadn’t properly linked my library with libgomp (OpenMP). Duh!

I added the following check to configure.ac in both the library and application directories:

AC_CHECK_LIB([gomp], [omp_get_num_threads])

and added

#include "omp.h"

in the proper places. Everything works now. Another coup duh etat for GNU Tools.

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: