catid / siamese

Siamese : Infinite-Window Streaming Erasure Code (HARQ)
BSD 3-Clause "New" or "Revised" License
48 stars 5 forks source link

Building for Linux ARM #1

Closed fmiceli24 closed 5 years ago

fmiceli24 commented 5 years ago

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.

fmiceli24 commented 5 years ago

This is my g++ version:

g++ (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516
catid commented 5 years ago

I haven't tried to do that yet. Will give it a try now..

On Wed, May 1, 2019, 1:27 PM Franco Miceli notifications@github.com wrote:

This is my g++ version:

g++ (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/catid/siamese/issues/1#issuecomment-488408472, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB5SIKTWMFI6DCVOZFAX4DPTH4LRANCNFSM4HJXP6ZA .

fmiceli24 commented 5 years ago

Thanks Chris!

If I can do something on my end please let me know.

Cheers.

El mié., 1 may. 2019 a las 17:39, Chris Taylor (notifications@github.com) escribió:

I haven't tried to do that yet. Will give it a try now..

On Wed, May 1, 2019, 1:27 PM Franco Miceli notifications@github.com wrote:

This is my g++ version:

g++ (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/catid/siamese/issues/1#issuecomment-488408472, or mute the thread < https://github.com/notifications/unsubscribe-auth/AAB5SIKTWMFI6DCVOZFAX4DPTH4LRANCNFSM4HJXP6ZA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/catid/siamese/issues/1#issuecomment-488414135, or mute the thread https://github.com/notifications/unsubscribe-auth/AEFSMGY4X6VN4NQDBN2JOBDPTH5WXANCNFSM4HJXP6ZA .

catid commented 5 years ago

Doesn't look like I added a CMakeLists file for this project. It seems to work fine if I add pktalloc:: in front of the symbol that is missing.

On Wed, May 1, 2019, 2:06 PM Franco Miceli notifications@github.com wrote:

Thanks Chris!

If I can do something on my end please let me know.

Cheers.

El mié., 1 may. 2019 a las 17:39, Chris Taylor (<notifications@github.com

) escribió:

I haven't tried to do that yet. Will give it a try now..

On Wed, May 1, 2019, 1:27 PM Franco Miceli notifications@github.com wrote:

This is my g++ version:

g++ (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/catid/siamese/issues/1#issuecomment-488408472, or mute the thread <

https://github.com/notifications/unsubscribe-auth/AAB5SIKTWMFI6DCVOZFAX4DPTH4LRANCNFSM4HJXP6ZA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/catid/siamese/issues/1#issuecomment-488414135, or mute the thread < https://github.com/notifications/unsubscribe-auth/AEFSMGY4X6VN4NQDBN2JOBDPTH5WXANCNFSM4HJXP6ZA

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/catid/siamese/issues/1#issuecomment-488427047, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB5SIOFJMHNVAX5CS7MWE3PTIA4PANCNFSM4HJXP6ZA .

fmiceli24 commented 5 years ago

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?

catid commented 5 years ago

I changed the one in SiameseDecoder.h to get it working

On Wed, May 1, 2019, 3:33 PM Franco Miceli notifications@github.com wrote:

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?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/catid/siamese/issues/1#issuecomment-488464402, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB5SIO5FHD6GLQU7VQ5NLDPTILDFANCNFSM4HJXP6ZA .

fmiceli24 commented 5 years ago

Excellent. Will try that tomorrow.

Thanks!

catid commented 5 years ago

Pushed a CMakeLists and that code change

fmiceli24 commented 5 years ago

Excellent.

Got it built using your changes.

Thanks!!