RainerKuemmerle / g2o

g2o: A General Framework for Graph Optimization
3.04k stars 1.1k forks source link

Cross compile for rpi3 64 bits #248

Open Minipada opened 6 years ago

Minipada commented 6 years ago

I am currently trying to cross compile the software for a rpi3 in 64 bits (aarch64) with GCC/GXX 5.4

I am have managed to set the configuration flags but I'm coming across this issue:

error: cannot convert 'ptrdiff_t* {aka long int*}' to 'int*' in assignment

This seems to be due to architecture. Do you know if there is a flag to enable to handle it?

Thanks

jumonatr commented 6 years ago

It's probably just a case where the code is assigning to the wrong type, but it happens to be the right one when building for x86. What line is this occurring on?

vyi commented 3 years ago

Hi Guys,

I came across this same issue while building g2o for arm64-v8a (on Android) using CMake based ndk-toolchain. For me this issue was coming while compiling the csparse solver.

I tried to manually cast ptrdiff_t to int * but there are too many places where this is needed (in files linear_csparse_solver, csparse_extension, core/marginal_covariance_cholesky ..) and I'm afraid this might break other things !!!

I found that rk had used the following define in the included csparse lib (file EXTERNAL/csparse/cs.h):

// rk: We define csi to be int to be backward compatible with older CSparse releases.
//     At some point we might adapt the internal structures of g2o to use the same type
//     as the one given is this header file.
#define csi int

This was helping with the build. However it was throwing compile time error when using the library for a arm64-v8a platform.

Now what is the correct way to fix this issue?

Using the following branch : 20200410_git

@RainerKuemmerle I have also tried to build with separately built csparse library from here v4.0.2 This same version was used by 20200410_git branch and after using that the build was not going throught and I asked the following question on SO.

jiapei100 commented 2 years ago

Same here... On X86_64. Any solutions?