Building for Linux ARM
Closed this issue · 9 comments
Hi.
I am trying to build a test program with siamese on a raspberry pi using the following g++ command:
g++ -D LINUX_ARM -Wall -o Siamese_test -I../../Common/Siamese/include -L/usr/lib -L/usr/local/lib Siamese_test.cpp ../../Common/Siamese/include/PacketAllocator.cpp ../../Common/Siamese/include/SiameseCommon.cpp ../../Common/Siamese/include/SiameseTools.cpp ../../Common/Siamese/include/SiameseEncoder.cpp ../../Common/Siamese/include/SiameseDecoder.cpp ../../Common/Siamese/include/gf256.cpp ../../Common/Siamese/include/siamese.cpp ../../Common/Siamese/include/Logger.cpp -lstdc++ --std=c++11 -w -fpermissive
I had to define LINUX_ARM for it to detect the OS and architecture. Still the compiler gives the following error:
../../Common/Siamese/include/SiameseDecoder.h:510:62: error: ‘NextAlignedOffset’ was not declared in this scope
unsigned unalignedEnd = NextAlignedOffset(columnStart);
^
../../Common/Siamese/include/SiameseDecoder.h:510:62: note: suggested alternative:
In file included from ../../Common/Siamese/include/SiameseCommon.h:44:0,
from ../../Common/Siamese/include/SiameseDecoder.h:101,
from ../../Common/Siamese/include/SiameseDecoder.cpp:30:
../../Common/Siamese/include/PacketAllocator.h:136:32: note: ‘pktalloc::NextAlignedOffset’
PKTALLOC_FORCE_INLINE unsigned NextAlignedOffset(unsigned offset)
^~~~~~~~~~~~~~~~~
In file included from ../../Common/Siamese/include/siamese.cpp:33:0:
../../Common/Siamese/include/SiameseDecoder.h: In member function ‘void siamese::RecoveryMatrixState::MulAddRows(const uint8_t*, uint8_t*, unsigned int, unsigned int, uint8_t)’:
../../Common/Siamese/include/SiameseDecoder.h:510:62: error: ‘NextAlignedOffset’ was not declared in this scope
unsigned unalignedEnd = NextAlignedOffset(columnStart);
^
../../Common/Siamese/include/SiameseDecoder.h:510:62: note: suggested alternative:
In file included from ../../Common/Siamese/include/SiameseCommon.h:44:0,
from ../../Common/Siamese/include/SiameseEncoder.h:40,
from ../../Common/Siamese/include/siamese.cpp:32:
../../Common/Siamese/include/PacketAllocator.h:136:32: note: ‘pktalloc::NextAlignedOffset’
PKTALLOC_FORCE_INLINE unsigned NextAlignedOffset(unsigned offset)
^~~~~~~~~~~~~~~~~
The problem seems to be with NextAlignedOffset. I have checked but cannot find why. The function is used in SiameseDecoder.h and this file includes PacketAllocator.h.
The test program builds correctly osx with clang++.
Is there a recommended way to build Siamese on linux ARM?
Thanks.
This is my g++ version:
g++ (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516
So I should change, in PacketAllocator.h:
PKTALLOC_FORCE_INLINE unsigned NextAlignedOffset(unsigned offset)
for
PKTALLOC_FORCE_INLINE unsigned pktalloc::NextAlignedOffset(unsigned offset)
Or in the invocation in SiameseDecoder.h?
Excellent. Will try that tomorrow.
Thanks!
Pushed a CMakeLists and that code change
Excellent.
Got it built using your changes.
Thanks!!