g2o icon indicating copy to clipboard operation
g2o copied to clipboard

Cross compile for rpi3 64 bits

Open Minipada opened this issue 6 years ago • 3 comments

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

Minipada avatar Dec 30 '17 15:12 Minipada

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?

jumonatr avatar Jan 02 '18 18:01 jumonatr

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.

vyi avatar Dec 07 '20 07:12 vyi

Same here... On X86_64. Any solutions?

jiapei100 avatar Dec 31 '21 08:12 jiapei100