Support for #defined(__aarch64__)

Issue #39 resolved
Frank Motta created an issue

Hi, I efforts to get ODE working on my OpenSim build for ThunderX (AARCH64), I downloaded and built up-to 'make install' with my needing to hack the emitted makefiles.

I hacked in some changes that are likely incorrect; just to get linkage on AARCH64.

It appears there is a lot of code that presumes sizeof(unsigned int) == sizeof(void *)

I forced some -fpermissive into the emitted makefiles and it linked/installed and - well ode-config ran (I have no other test cases yet)

screenlog.0 for make as well as config.log are attached for the build of code straight from the repo.

Thanks

Example error: make[4]: Entering directory '/stacks/stores/opensim/ode/x/ode/ode/src/joints' /bin/bash ../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../ode/src -I../../../include -I../../../include -I../../../ode/src -D__ODE__ -I../../../ou/include -g -O2 -MT joint.lo -MD -MP -MF .deps/joint.Tpo -c -o joint.lo joint.cpp libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../../ode/src -I../../../include -I../../../include -I../../../ode/src -D__ODE__ -I../../../ou/include -g -O2 -MT joint.lo -MD -MP -MF .deps/joint.Tpo -c joint.cpp -o joint.o In file included from joint.h:28:0, from joint.cpp:37: ../common.h: In member function ‘void dxAlignedAllocation::allocAligned(size_t, unsigned int)’: ../common.h:66:68: error: cast from ‘void’ to ‘uintptr {aka unsigned int}’ loses precision [-fpermissive] #define dALIGN_PTR(buf_ptr, alignment) ((void *)(((uintptr)(buf_ptr) + ((alignment) - 1)) & (int)(~(alignment - 1)))) // Casting the mask ^

Comments (6)

  1. Oleh Derevenko Account Deactivated

    Please try applying the following patch and see if it works for you.

    diff -r ce3ea1d5acc7 include/ode/odeconfig.h
    --- a/include/ode/odeconfig.h   Fri May 12 01:39:31 2017 +0300
    +++ b/include/ode/odeconfig.h   Wed May 17 00:55:15 2017 +0300
    @@ -81,7 +81,23 @@
    
    
     /* Well-defined common data types...need to define for 64 bit systems */
    -#if defined(_M_IA64) || defined(__ia64__) || defined(_M_AMD64) || defined(__x86_64__)
    +#if defined(__aarch64__)
    +    #include <stdint.h>
    +    typedef int64_t         dint64;
    +    typedef uint64_t        duint64;
    +    typedef int32_t         dint32;
    +    typedef uint32_t        duint32;
    +    typedef int16_t         dint16;
    +    typedef uint16_t        duint16;
    +    typedef int8_t          dint8;
    +    typedef uint8_t         duint8;
    +
    +    typedef intptr_t        dintptr;
    +    typedef uintptr_t       duintptr;
    +    typedef ptrdiff_t       ddiffint;
    +    typedef size_t          dsizeint;
    +
    +#elif defined(_M_IA64) || defined(__ia64__) || defined(_M_AMD64) || defined(__x86_64__)
       #define X86_64_SYSTEM   1
     #if defined(_MSC_VER)
       typedef __int64         dint64;
    
  2. Frank Motta reporter

    Thanks,

    That built with no errors and warnings.

    By the way, any pointers on what is needed for building ODE for OpenSimulator I can use to finish this? I have OpenSimulator running all but physics.

    Thanks for your help!

  3. Oleh Derevenko Account Deactivated

    I do not have any information regarding what configuration of ODE is used with OpenSimulator. If it builds for you I assume you can use whatever feature set you configure as the public API generally does not depend on that. Or do you mean anything else?

  4. Frank Motta reporter

    Thanks again. There is a library built and used by Opensimulator: ./OpenSim.Region.PhysicsModule.Ode.dll ./addin-db-002/addin-data/3/OpenSim.Region.PhysicsModule.ODE,0.8.2.1.maddin ./addin-db-002/addin-data/4/OpenSim.Region.PhysicsModule.ODE,0.8.2.1.maddin ./addin-db-002/addin-data/2/OpenSim.Region.PhysicsModule.ODE,0.8.2.1.maddin ./addin-db-002/addin-data/1/OpenSim.Region.PhysicsModule.ODE,0.8.2.1.maddin ./Ode.NET.dll.config ./lib64/libode-x86_64.so ./lib64/libode.dylib ./lib64/ode.dll ./Ode.NET.dll ./lib32/ode.dll ./lib32/libode.so

    I can find no make flow to create these.

  5. Oleh Derevenko Account Deactivated

    There have to exist some OpenSim support/development resources you should ask in.

  6. Log in to comment