64-bit machine

Discuss any Chipmunk bugs here.
Post Reply
Blue Prawn
Posts: 22
Joined: Thu Jan 03, 2008 1:36 pm
Contact:

64-bit machine

Post by Blue Prawn »

Hi,
Someone have tryed to build the ocaml wrapper on a 64-bit machine, and has reported this error:

Code: Select all

ocamlc -c -cc "gcc -static  -O3 -std=gnu99 -ffast-math -o wrap_chipmunk.o"  wrap_chipmunk.c

ocamlmklib  \
            -L/usr/local/    -L/usr/local/lib  \
            -o  _chipmunk_stubs   wrap_chipmunk.o  \
            -ccopt -O3   -ccopt -std=gnu99   -ccopt -ffast-math  \
            -lchipmunk  -lchipmunk_static

/usr/bin/ld: wrap_chipmunk.o: relocation R_X86_64_32 against `a local symbol' 
can not be used when making a shared object; recompile with -fPIC
wrap_chipmunk.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [dll_chipmunk_stubs.so] Error 2
Does someone know how to manage these kind of problems ?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: 64-bit machine

Post by slembcke »

Never seen an error like that. Does Chipmunk itself compile fine on their machine?
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Blue Prawn
Posts: 22
Joined: Thu Jan 03, 2008 1:36 pm
Contact:

Re: 64-bit machine

Post by Blue Prawn »

Well, I suppose that if he had problems with chipmunk itself he would have given the related errors...
so I suppose it is a problem related to the wrapper, but I'm not very experienced with C, and moreover not with those 64-bit machines :)
utgarda
Posts: 2
Joined: Sun May 10, 2009 6:25 pm
Contact:

Re: 64-bit machine

Post by utgarda »

Just met some problems compiling ruby extensions for rev.144 on Ubuntu Linux x64 ( see output below ).
Adding -fPIC complier flag does the trick :
./CMakeLists.txt:set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -fPIC") # allways use gnu99
though either way I get tons of warnings like
/home/tsvigun/devenv/chipmunk/errdemo/trunk/src/cpCollision.c: In function ‘findVerts’:
/home/tsvigun/devenv/chipmunk/errdemo/trunk/src/cpCollision.c:174: warning: cast from pointer to integer of different size
/home/tsvigun/devenv/chipmunk/errdemo/trunk/src/cpCollision.c:180: warning: cast from pointer to integer of different size
Do I miss something? Not that it is a real problem, binding library built this way works ok, just a bit worried.
$ svn checkout http://chipmunk-physics.googlecode.com/svn/trunk/
...
A trunk/docsrc/makedocs.rb
U trunk
Checked out revision 144.
...
$ cd ./trunk/
$ cmake -D BUILD_RUBY_EXT=ON -DRUBY_INCLUDE_PATH=/usr/include/ruby-1.9.0 .
...
-- Build files have been written to: /home/tsvigun/devenv/chipmunk/errdemo/trunk
$ make
...
Linking C shared module chipmunk.so
/usr/bin/ld: ../src/libchipmunk.a(chipmunk.c.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
../src/libchipmunk.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [ruby/chipmunk.so] Error 1
make[1]: *** [ruby/CMakeFiles/ruby_ext.dir/all] Error 2
make: *** [all] Error 2
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests