Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13375 closed defect (fixed)

OpenGL libs not located by 'configure' in debian testing

Reported by: dghart Owned by: vadz
Priority: normal Milestone: 3.0.0
Component: build Version: stable-latest
Keywords: configure debian wheezy multiarch Cc:
Blocked By: Blocking:
Patch: no

Description

In 64 bit debian testing (which will become 'wheezy'), libGL and libGLU are installed to /usr/lib/x86_64-linux-gnu/ instead of /usr/lib. As this dir is not in $SEARCH_LIB, ../configure --with-opengl fails with the misleading message:
configure: error: OpenGL libraries not available

This has happened before, when an extra search path was added. I suppose that could be done again but, looking at the contents of gl.cp and glu.pc, I wonder if a more resilient alternative would be to add the output of:
pkg-config --variable=libdir gl
which produces the correct path.

Attachments (3)

configure_in.diff download (12.6 KB) - added by dghart 7 years ago.
config.diff download (10.9 KB) - added by dghart 7 years ago.
config1.diff download (10.8 KB) - added by dghart 7 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 Changed 7 years ago by dghart

  • Patch set

I should have mentioned that there are two places that need the extra path. The attached patch does this the quick-fix way...

comment:2 Changed 7 years ago by vadz

  • Status changed from new to confirmed

Aren't all the other occurrences of WX_PATH_FIND_LIBRARIES similarly affected? I think we need to add these directories to SEARCH_LIB path instead. Could you please update the patch like this and, most importantly, retest it? TIA!

However avoiding the use of this macro completely and using PKG_CHECK_MODULES() instead (or maybe first and then only use manual search as a fall back for the systems without pkg-config) would definitely be still better.

comment:3 Changed 7 years ago by JGMiller

This issue is also present on 32 bit systems (and presumably all other architecture variations as well) -- see Ticket 13376, so the problem is not just for 64 bit systems as originally thought.

Changed 7 years ago by dghart

comment:4 Changed 7 years ago by dghart

  • Keywords 64bit removed
  • Summary changed from OpenGL 64 bit libs not located by 'configure' in debian testing to OpenGL libs not located by 'configure' in debian testing

This issue is also present on 32 bit systems (and presumably all other architecture variations as well)

Ah, it hadn't occurred to me to look. Thanks!

However avoiding the use of this macro completely and using PKG_CHECK_MODULES() instead (or maybe first and then only use manual search as a fall back for the systems without pkg-config) would definitely be still better.

Yes. In my first post, I hadn't appreciated that the issue wasn't making linking work (it already does), but convincing 'configure' that it would work.

I've now done as you suggest for the ones that I could test (the others are for motif and gpe). The updated patch works on debian lenny, squeeze and testing, plus the latest fedora and openSUSE.

comment:5 Changed 7 years ago by ojwb

In the patch, I noticed test with operator == is used, which is a bashism. It's better to use = instead as that's portable.

comment:6 Changed 7 years ago by vadz

  • Keywords multiarch added
  • Milestone changed from 2.9.3 to 3.0

I totally forgot about/overlooked this patch when I wrote my post about the same problem to wx-dev. As I wrote there, it seems like we could simply use AC_CHECK_LIB without even bothering with pkg-config. OTOH there is nothing wrong with using the latter neither, of course, but I'd really prefer to have some function which abstracts the process of checking for a library instead of duplicating all this code everywhere. I think ideal would be to use the following order:

  1. PKG_CHECK_MODULES (with support for setting LIBNAME_LIBS and LIBNAME_CFLAGS manually when running configure as it can be very useful under Windows with MinGW/MSYS).
  2. AC_CHECK_LIB just in case it's in the standard directory even though not supported by pkg-config (this would be the case for gl and glu for me under Debian).
  3. Search the custom libraries path manually if needed -- but I think it won't be.

What do you think?

BTW, the original problem reported by this ticket should be fixed by r69186, so I'm postponing the milestone but it would still be very nice to solve this problem better.

P.S. To answer comment:5, = should indeed be used instead of ==, thanks for noticing this.

Changed 7 years ago by dghart

comment:7 Changed 7 years ago by dghart

What do you think?

That sounds fine to me. The new patch, after correcting some trivial typos, creates a macro, WX_FIND_LIBRARIES, which calls PKG_CHECK_MODULES, AC_CHECK_LIB and finally WX_PATH_FIND_LIBRARIES. It's used in the places where the previous patch made PKG_CHECK_MODULES calls.

I've tested it, and its individual components, successfully against autoconf 2.61 (debian lenny), 2.67 (squeeze) and 2.68 (debian testing and ubuntu 11.10). BTW, if you check it on 2.68 you'll need to apply #13591 first.

The only drawback that I can see is a slight increase in verbosity when something is genuinely absent, so that all three tests fail. I tried unsuccessfully to silence AC_CHECK_LIB...

comment:8 Changed 7 years ago by Carsten

Btw., fyi, I just applied r69186 to my local copy of wxWidgets-2.9.2 on 64-bit Ubuntu 11.10 (oneiric ocelot), which also exhibits the problem described in this ticket, and can confirm that the problem is successfully solved by r69186. :-)

comment:9 Changed 7 years ago by vadz

  • Component changed from OpenGL to build
  • Owner set to vadz
  • Status changed from confirmed to accepted

Thanks David, this looks good to me so I'm going to apply it soon. I do wonder why do we need both $2 and $3 in the new macro as they seem to be always the same so I'm probably going to merge them. And I'd also like to rename the macro, while the current name is compatible with ac_find_libraries variable, I think it's misleading because it seems to indicate that this function can be used for more than one library at once when it can't and it's also a bit too long for such common test so I'd like to use WX_FIND_LIB instead. Please let me know if you have any objections to either of these changes and thanks again!

Changed 7 years ago by dghart

comment:10 Changed 7 years ago by dghart

I do wonder why do we need both $2 and $3 in the new macro as they seem to be always the same

$2 is the lib name, and is essential for all 3 methods (tolowered for PKG_CHECK_MODULES). $3 is used only as a prefix for PKG_CHECK_MODULES, and can be any reasonably-unique string.

I agree that it's not useful atm. I left it in case of future situations where the lib name was inappropriate, but I have no problem with its removal (or with WX_FIND_LIB). I've attached an updated patch.

comment:11 Changed 7 years ago by vadz

Oops, sorry for not being more precise, I actually already changed the path locally, I should have been more clear about it to avoid you the unnecessary work, I just wanted to ask for your opinion before committing.

Anyhow, I'll check it in now, thanks again!

P.S. Another possible improvement I see is getting rid of passing SEARCH_LIB path to all these functions, IMHO it should just be used by them by default (and possibly they should take some additional path to append -- or maybe prepend? -- to it), this would simplify the code even further and I'd be glad to apply a patch doing this.

comment:12 Changed 7 years ago by VZ

(In [69555]) No changes, just fix some typos in acinclude.m4 comments.

See #13375.

comment:13 Changed 7 years ago by VZ

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [69556]) Add WX_FIND_LIB() function to simplify testing for libraries in configure.

No real changes in behaviour but the new WX_FIND_LIB() function can now be
used to test for any library.

Closes #13375.

comment:14 Changed 7 years ago by bmorel

  • Patch unset

I have an issue which is in some way similar. I don't really know about configure and makefile 's magic, so I can not really give many info in this message. If you ask me more, I will give more.

debian x86_64 testing with some experimental packages
make version 3.81-8.1
wxWidgets 2.9.4 (the daily build of 05/04/2012)
freeglut-dev 2.6.0-1.1
g++ 4.7.0-1

_
configure command line:

configure --disable-compat28 --enable-std_iostreams --enable-std_string --enable-std_string_conv_in_wxstring --enable-stl --enable-std_containers --with-opengl --enable-debug --enable-debug_info --enable-debug_gdb


parts of configure log:
[...]
checking for OpenGL headers... found in /usr/include
checking for GL/gl.h... yes
checking for GL/glu.h... yes
checking for GL... yes
checking for GLU... yes
[...]
checking for OpenGL library... -lGL
[...]
checking for OpenGL Utility library... -lGLU
checking for GLUT library... no
[...]

Support for external codecs:

ZLIB support: yes
Pixar log-format algorithm: yes
JPEG support: yes
Old JPEG support: no

C++ support: yes

OpenGL support: no

PS: I didn't reopened it because I am not sure the problem is not just PEBCAK

comment:15 Changed 7 years ago by vadz

Actually you don't have any problem, see the first two messages of this thread.

Note: See TracTickets for help on using tickets.