[ODE] Building on MacOSX (and now Linux)
Samuli Riihonen
samuli at riihonen.net
Sat May 6 05:18:25 MST 2006
Hi all,
Just sent Rodrigo a fixed version of osx.cpp that compiles also using
gcc-3.3 (at least on my system: OS X 10.4.6 Tiger).
All of ode now compiles just fine with both gcc 3.3 and 4.0.1 after
renaming test_chain1.c to .cpp and adding LINK=$(CXXLINK) to
Makefile.am in ode/src.
Googling for isnanf, I found the following:
http://lists.apple.com/archives/Unix-porting/2004/Aug/msg00066.html
Could someone who is having the problem just try to change the call
from isnanf to isnan and see if that fixes the problem?
- Samuli
On 6.5.2006, at 0.46, James Stallings II wrote:
> All goes well up until I type make.
>
> This is all on an OSX Panther system.
>
> Opticon:~/badlandsvr/opende twitch$ make
> Making all in include
> Making all in ode
> make all-am
> make[2]: Nothing to be done for `all-am'.
> Making all in drawstuff
> Making all in src
> if g++ -DHAVE_CONFIG_H -I. -I. -I../../include/ode -g
> -I../../include -I../../include -g -MT libdrawstuff_a-osx.o -MD -MP
> -MF ".deps/libdrawstuff_a-osx.Tpo" -c -o libdrawstuff_a-osx.o `test -f
> 'osx.cpp' || echo './'`osx.cpp; \
> then mv -f ".deps/libdrawstuff_a-osx.Tpo"
> ".deps/libdrawstuff_a-osx.Po"; else rm -f
> ".deps/libdrawstuff_a-osx.Tpo"; exit 1; fi
> osx.cpp: In function `OSStatus osxKeyEventHandler
> (OpaqueEventHandlerCallRef*,
> OpaqueEventRef*, void*)':
> osx.cpp:229: warning: jump to case label
> osx.cpp:183: error: crosses initialization of `char uppercase'
> osx.cpp:182: error: crosses initialization of `char charCode'
> osx.cpp:181: error: crosses initialization of `const void*KCHR'
> make[2]: *** [libdrawstuff_a-osx.o] Error 1
> make[1]: *** [all-recursive] Error 1
> make: *** [all-recursive] Error 1
> Opticon:~/badlandsvr/opende twitch$
>
>
> On 5/5/06, Rodrigo Hernandez <kwizatz at aeongames.com> wrote:
>> Samuli Riihonen wrote:
>>
>>> I have no problems with isnanf.
>>> test_basket compiles (and runs) fine, so it's not a general problem
>>> with gcc or PPC.
>>>
>> I think it has to do with the gcc version, it compiles fine on Linux
>> Fedora Core 5 with Gcc 4.1.0,
>> but like I said, on Windows, MinGW Gcc 3.4.5 it fails.
>>
>>> As to the linking problem on osx, test_chain1.c will compile if
>>> it is
>>> renamed to cpp.
>>> Linking libode.dylib will also work if the LINK -command in the
>>> Makefile is changed to CXXLINK.
>>>
>> I'll take a look at test_chain1.c, if it has C++ Constructs, it
>> should
>> be renamed to .cpp
>>
>>> I tried to understand the automake system to find out where it
>>> decides which linking-method to use for the said dylib, but failed
>>> miserably :)
>>>
>> You can just add
>>
>> LINK=$(CXXLINK)
>>
>> to the top of the Makefile.am in the ode/src directory and see if
>> that
>> helps.
>>
>>> - Samuli
>>>
>>> On 4.5.2006, at 23.41, Rodrigo Hernandez wrote:
>>>
>>>>
>>>> I am getting the same isnanf error on MinGW, the funny thing is
>>>> that
>>>> configure does find the function,
>>>> aparently, this has to do with gcc vs g++ (configure uses gcc
>>>> for it's
>>>> tests), it seems rather odd that gcc has
>>>> a function and g++ doesn't, but it seems to be so, this feels
>>>> more like
>>>> a GCC bug than anything else.
>>>>
>>>> Nguyen Binh wrote:
>>>>
>>>>> You can write your own IEEE's compatible isNan().
>>>>>
>>>>> On 5/4/06, *Wesley Smith* <wesley.hoke at gmail.com
>>>>> <mailto:wesley.hoke at gmail.com>> wrote:
>>>>>
>>>>> I've had trouble with isnan on OSX before as well (in other
>>>>> libraries). It's available on Linux and some other OSes, but
>>>>> the OSX
>>>>> stdc++ doesn't have it.
>>>>>
>>>>> wes
>>>>>
>>>>>
>>>>>
>>>>> On 5/4/06, Ryan Gardner < ryebrye at gmail.com
>>>>> <mailto:ryebrye at gmail.com>> wrote:
>>>>>
>>>>>>
>>>>>> It's pretty darn close to just building and running on OS X out
>>>>>
>>>>> of the box
>>>>>
>>>>>> from a clean SVN checkout...
>>>>>>
>>>>>> With a little bit of tinkering, I got past my above problem...
>>>>>
>>>>> although I
>>>>>
>>>>>> don't know if it's the best workaround or not. The link error on
>>>>>
>>>>> the ODE
>>>>>
>>>>>> library was easy to get past. I just navigated to the
>>>>>
>>>>> trunk/ode/src and ran
>>>>>
>>>>>> make - then copied the gcc build command it was using - pasted
>>>>>
>>>>> it in bbedit
>>>>>
>>>>>> - changed the gcc to g++ and pasted it back into the terminal...
>>>>>
>>>>> then it
>>>>>
>>>>>> linked fine with g++ (no undefined symbol error)
>>>>>>
>>>>>> The same fix worked for the chaintest1.c file that was giving
>>>>>
>>>>> link errors.
>>>>>
>>>>>>
>>>>>> After getting past both of those minor bumps - the next obstacle
>>>>>
>>>>> I encounter
>>>>>
>>>>>> is in compiling test_basket.cpp:
>>>>>>
>>>>>> test_basket.cpp: In function 'void nearCallback(void*, dxGeom*,
>>>>>
>>>>> dxGeom*)':
>>>>>
>>>>>> test_basket.cpp:86: error: 'isnanf' was not declared in this
>>>>>> scope
>>>>>> test_basket.cpp:87: error: 'isnanf' was not declared in this
>>>>>> scope
>>>>>> test_basket.cpp:88: error: 'isnanf' was not declared in this
>>>>>> scope
>>>>>> test_basket.cpp: In function 'void simLoop(int)':
>>>>>> test_basket.cpp:179: error: 'isnanf' was not declared in this
>>>>>> scope
>>>>>> test_basket.cpp:183: error: 'isnanf' was not declared in this
>>>>>> scope
>>>>>>
>>>>>> I think that isnanf is not implemented on PPC processors - but I
>>>>>
>>>>> may be
>>>>>
>>>>>> wrong.
>>>>>>
>>>>>> To avoid the error, I commented out those lines (they were
>>>>>
>>>>> assertions...)
>>>>>
>>>>>>
>>>>>> After that - the entire make process would run fine. (Although
>>>>>
>>>>> If I made
>>>>>
>>>>>> clean and then tried to make - I would have to manually re-link
>>>>>
>>>>> it with g++
>>>>>
>>>>>> at each of the sticking points, because I didn't edit any of the
>>>>>
>>>>> makefiles)
>>>>>
>>>>>>
>>>>>> The tests don't find the DYlibs if the odelib isn't installed...
>>>>>>
>>>>>> To get the tests to run correctly - I did 'sudo make install'...
>>>>>
>>>>> After that
>>>>>
>>>>>> - the tests run and the thing builds correctly.
>>>>>>
>>>>>> I'm not playing around with the buggy... Yipee!
>>>>>>
>>>>>> Ryan
>>>>>>
>>>>>>
>>>>>> ----------
>>>>>>
>>>>>> "You tried your best and you failed miserably. The lesson is
>>>>>
>>>>> 'never try'."
>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Homer Simpson
>>>>>>
>>>>>> On May 4, 2006, at 12:06 AM, Samuli Riihonen wrote:
>>>>>>
>>>>>> Hello...
>>>>>> One glitch.
>>>>>> Would you please change ifdef in drawstuff/src/drawstuff.cpp
>>>>>> to be:
>>>>>>
>>>>>> #ifdef HAVE_APPLE_OPENGL_FRAMEWORK
>>>>>> #include <OpenGL/gl.h>
>>>>>> #include <OpenGL/glu.h>
>>>>>> #else
>>>>>>
>>>>>> At the moment it checks against #ifdef MAC_OS_X which is not
>>>>>> defined
>>>>>> (although it was before... probably too little sleep for me).
>>>>>> Otherwise the addition now compiles and works for me (OS X
>>>>>> 10.4.6,
>>>>>> powerbook G4) with a fresh checkout + autogen.sh + configure +
>>>>>> make
>>>>>>
>>>>>> - Samuli
>>>>>>
>>>>>> _______________________________________________
>>>>>> ODE mailing list
>>>>>> ODE at q12.org <mailto:ODE at q12.org>
>>>>>> http://q12.org/mailman/listinfo/ode
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> ODE mailing list
>>>>> ODE at q12.org <mailto:ODE at q12.org>
>>>>> http://q12.org/mailman/listinfo/ode
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> --------------------------------------------------
>>>>> Binh Nguyen
>>>>> Computer Science Department
>>>>> Rensselaer Polytechnic Institute
>>>>> Troy, NY, 12180
>>>>> --------------------------------------------------
>>>>>
>>>>> ------------------------------------------------------------------
>>>>> ---
>>>>> ---
>>>>>
>>>>> _______________________________________________
>>>>> ODE mailing list
>>>>> ODE at q12.org
>>>>> http://q12.org/mailman/listinfo/ode
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> ODE mailing list
>>>> ODE at q12.org
>>>> http://q12.org/mailman/listinfo/ode
>>>
>>>
>>>
>>
>> _______________________________________________
>> ODE mailing list
>> ODE at q12.org
>> http://q12.org/mailman/listinfo/ode
>>
>
>
> --
> ===================================
> Woulds't thou so blame
> the fragrant blos'ms wilting
> as never to've had her bloom?
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
More information about the ODE
mailing list