[MINC-users] Register's configure test for GLUT

Alex Zijdenbos alex at bic.mni.mcgill.ca
Sun Aug 17 20:18:48 EDT 2008


Hello all,

Is there anybody familiar enough with autoconf/make to fix Register's
(and probably Display's) configure setup? I just spent a somewhat
frustrating amount of time trying to figure out why I couldn't get
register to link on a ubuntu hardy box. As it turns out, the configure
phase of the register package runs some tests to determine whether the
GLUT library is available; but when these tests fail, it happily
continues, resulting an a bunch of awfully confusing linking errors at
the end, of this nature:

   Graphics/libbicgl.a(glut_windows.o): In function `WS_add_idle_function':
   Register-1.3.6/Graphics/GLUT_windows/glut_windows.c:1151: undefined
reference to `glutIdleFunc'
   Graphics/libbicgl.a(glut_windows.o): In function `flip_screen_y':
   Register-1.3.6/Graphics/GLUT_windows/glut_windows.c:919: undefined
reference to `glutGet'

(and about 500 lines of same)

Now through all of this, I had libglut (and all other prerequisites I
thought) installed. Tracing things back, the error starts in the
configure phase:

   checking for GLUT library... no

But configure carries on, now leaving -lglut off the list of libraries
to link in. From config.log, it turns out that configure not actually
fails on a missing libglut, but on a missing libXmu and libXi.
However, these don't actually appear to be required at all; forcefully
adding -lglut to the linking stage produces a working executable.

In summary:

- the configure stage for Register-1.3.6 tests for libglut, but does
not throw an error when that test fails;
- the existing test for libglut depends on libXmu and libXi, but these
are not required at all

I think the solution is to modify the test for libglut such that it
does not depend on libXmu and libXi, and also to make it required that
the configure passes that test. I'm afraid I am not familiar enough
with this to make the change myself though - any takers? Googling I
see that I am not the first one to be stumped by this :)

Lastly, I should say that a bandaid (but working) solution on Ubuntu is to

  apt-get install libxmu-dev libxi-dev

But really, that is just installing some libraries just to convince a
broken configure script to do the right thing :)

-- Alex



So it seems like the check for the GLUT library is somewhat broken. I
would say it should either test for libXmu and libXi explicitly (if
these are actually needed!)


More information about the MINC-users mailing list