Compile error

strana
Posts: 2
Joined: Wed Jan 30, 2008 8:15 pm
Location: Czech Republic

Compile error

Post by strana »

Hello,
I've tried compiling Bullet and I get this error:

/home/strana/tmp/bullet-2.67-alpha1/Extras/BulletMultiThreaded/SpuSampleTaskProcess.cpp: In member function ‘void SpuSampleTaskProcess::issueTask(void*, int)’:
/home/strana/tmp/bullet-2.67-alpha1/Extras/BulletMultiThreaded/SpuSampleTaskProcess.cpp:132: error: cast from ‘SpuSampleTaskDesc*’ to ‘uint32_t’ loses precision
make[2]: *** [Extras/BulletMultiThreaded/CMakeFiles/LibBulletMultiThreaded.dir/SpuSampleTaskProcess.o] Error 1
make[1]: *** [Extras/BulletMultiThreaded/CMakeFiles/LibBulletMultiThreaded.dir/all] Error 2
make: *** [all] Error 2

This happens in both 2.66 and 2.67-alpha1.

I hope I've done everything right, since 87% of compilation went OK.

Regards,
Ji?í Stránský

EDIT:
My OS is Linux 64 bit. I believe that '64 bitness' might be the cause of losing precision in this cast.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Compile error

Post by Erwin Coumans »

Which build system did you use exactly?

Extras/BulletMultiThreaded is an optional component, which is not 64-bit safe. It is best to disable it.

Are there ways to identify 64-bit (linux) systems, so the build system can automatically exclude those parts?
Thanks,
Erwin
strana
Posts: 2
Joined: Wed Jan 30, 2008 8:15 pm
Location: Czech Republic

Re: Compile error

Post by strana »

I used cmake which generated standard unix makefiles.

There is a linux program called uname, which allows you to determine something about the computer.

strana@scorpio:~$ uname --all
Linux scorpio 2.6.22-14-generic #1 SMP Tue Dec 18 05:28:27 UTC 2007 x86_64 GNU/Linux


When used with the -m parameter, it returns this:

strana@scorpio:~$ uname -m
x86_64

I'm not sure if this is the best way to determine 64 bit platform, but it's the only one I know :)

Thanks for your reply.

JS

EDIT: Just to clarify, the uname program is in Single UNIX Specification, so it should be on every linux/unix machine.
Tudhalyas
Posts: 1
Joined: Mon Jul 07, 2008 1:46 pm

Re: Compile error

Post by Tudhalyas »

I have the same error here. I'm using Ubuntu Hardy 64 bit on an Intel Core 2 Duo machine.
How can I disable the compilation of libbulletmultithreaded.a?

Thanks in advance!

PS: I'm using the latest Bullet release, 2.69.
chunky
Posts: 145
Joined: Tue Oct 30, 2007 9:23 pm

Re: Compile error

Post by chunky »

Are there ways to identify 64-bit (linux) systems

Code: Select all

chunky@mills:~$ uname -m
x86_64
chunky@mills:~$ cat > test64.c
#include <stdio.h>

int main(void) {
  printf("sizeof(int *) = %i\n", sizeof(int *));
  return 0;
} 
chunky@mills:~$ gcc -o test64 test64.c && ./test64
sizeof(int *) = 8
chunky@mills:~$ 
Depends on what level you wanted it at. Beware also, that some versions of GCC don't support sizeof() in a compiler macro [specifically the one included in XCode2.5 that runs on ppc, and presumably previous versions].

Gary (-;