Can't find libGLEW.so on a 64 bits linux OS

elLolo
Posts: 14
Joined: Thu Dec 11, 2008 2:18 pm

Can't find libGLEW.so on a 64 bits linux OS

Post by elLolo »

Hi!

CMake can't find the file libGLEW.so for ParticlesOpenCL in /usr/lib because it is located in /usr/lib64 on 64 bits OS (like my Fedora 13 for example). If I set CMAK_GLEW_LIBRARY to /usr/lib64/libGLEW.so, everything work. BTW, is CMAK_GLEW_LIBRARY a typo?

I don't know how to properly detect 64 bits on linux with CMake, maybe with CMAKE_SIZEOF_VOID_P?
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Re: Can't find libGLEW.so on a 64 bits linux OS

Post by Dragonlord »

There is no normed way under Linux to detect 64-bit or 32-bit systems. Your code should compile on both systems without having to detect the bit-iness. Otherwise you've got a bigger problem going.

EDIT: I should be a bit more accurate. There is no direct way to test it. While compiling __WORDSIZE is set to 32 or 64 by the compiler though.
elLolo
Posts: 14
Joined: Thu Dec 11, 2008 2:18 pm

Re: Can't find libGLEW.so on a 64 bits linux OS

Post by elLolo »

Dragonlord wrote:There is no normed way under Linux to detect 64-bit or 32-bit systems. Your code should compile on both systems without having to detect the bit-iness. Otherwise you've got a bigger problem going.

EDIT: I should be a bit more accurate. There is no direct way to test it. While compiling __WORDSIZE is set to 32 or 64 by the compiler though.
Actually, the problem is in a Bullet Demo, not with my code ;-)
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Can't find libGLEW.so on a 64 bits linux OS

Post by Erwin Coumans »

We used to avoid those errors like this in previous Bullet version, we might have to consider to put this back again:

if (CMAKE_SIZEOF_VOID_P MATCHES "8")
SUBDIRS( BulletSoftBody BulletCollision BulletDynamics LinearMath )
else (CMAKE_SIZEOF_VOID_P MATCHES "8")
SUBDIRS( BulletMultiThreaded BulletSoftBody BulletCollision BulletDynamics LinearMath )
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")

Let's continue the discussion and fixes in this issue: http://code.google.com/p/bullet/issues/detail?id=421
Thanks,
Erwin