shogun-toolbox / shogun

Shōgun
http://shogun-toolbox.org
BSD 3-Clause "New" or "Revised" License
3.03k stars 1.04k forks source link

Trouble with make on Raspberry Pi 4 #5170

Closed wstutt2000 closed 3 years ago

wstutt2000 commented 3 years ago

I am trying to build shogun on a Raspberry Pi 4 B so I can run it from Python 3.7.3. I installed it with Add/Remove Software but that only installed it for Python 2.7.

Here is the output fromcat /proc/cpuinfo:

processor   : 0
model name  : ARMv7 Processor rev 3 (v7l)
BogoMIPS    : 108.00
Features    : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xd08
CPU revision    : 3

processor   : 1
model name  : ARMv7 Processor rev 3 (v7l)
BogoMIPS    : 108.00
Features    : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xd08
CPU revision    : 3

processor   : 2
model name  : ARMv7 Processor rev 3 (v7l)
BogoMIPS    : 108.00
Features    : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xd08
CPU revision    : 3

processor   : 3
model name  : ARMv7 Processor rev 3 (v7l)
BogoMIPS    : 108.00
Features    : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xd08
CPU revision    : 3

Hardware    : BCM2711
Revision    : c03112
Serial      : 10000000443aa194
Model       : Raspberry Pi 4 Model B Rev 1.2

Here is the output from uname -a: Linux raspberrypi 5.10.17-v7l+ #1403 SMP Mon Feb 22 11:33:35 GMT 2021 armv7l GNU/Linux

I used ccmake to generate the make file.

I had problems that my settings for theCMAKE_CXX_FLAGS andCMAKE_C_FLAGS options were being ignored so I resorted to inserting the flags I needed in to theC_FLAGS andCXX_FLAGS settings in thesrc/shogun/CMakeFiles/libshogun.dir file. The flags that I inserted were-march=armv7-a -mfpu=vfpv3-d16

Here is the end of the make output:

[ 17%] Building CXX object src/shogun/CMakeFiles/libshogun.dir/io/serialization/BitseryDeserializer.cpp.o
In file included from /home/pi/shogun/build/bitsery/src/bitsery/include/bitsery/serializer.h:28,
                 from /home/pi/shogun/build/bitsery/src/bitsery/include/bitsery/bitsery.h:40,
                 from /home/pi/shogun/src/shogun/io/serialization/BitseryDeserializer.cpp:13:
/home/pi/shogun/build/bitsery/src/bitsery/include/bitsery/adapter_writer.h: In lambda function:
/home/pi/shogun/build/bitsery/src/bitsery/include/bitsery/adapter_writer.h:183:68: warning: declaration of 'const T& v' shadows a parameter [-Wshadow]
             std::for_each(v, std::next(v, count), [this](const T &v) {
                                                                    ^
/home/pi/shogun/build/bitsery/src/bitsery/include/bitsery/adapter_writer.h:182:43: note: shadowed declaration is here
         void _directWriteSwapTag(const T *v, size_t count, std::true_type) {
                                  ~~~~~~~~~^
In file included from /home/pi/shogun/build/bitsery/src/bitsery/include/bitsery/deserializer.h:28,
                 from /home/pi/shogun/build/bitsery/src/bitsery/include/bitsery/bitsery.h:41,
                 from /home/pi/shogun/src/shogun/io/serialization/BitseryDeserializer.cpp:13:
/home/pi/shogun/build/bitsery/src/bitsery/include/bitsery/adapter_reader.h: In instantiation of 'void bitsery::AdapterReader<InputAdapter, Config>::readBytes(T&) [with unsigned int SIZE = 8; T = unsigned int; InputAdapter = InputStreamAdapter; Config = bitsery::DefaultConfig]':
/home/pi/shogun/build/bitsery/src/bitsery/include/bitsery/deserializer.h:112:13:   required from 'void bitsery::BasicDeserializer<TAdapterReader, TContext>::value(T&) [with unsigned int VSIZE = 8; T = unsigned int; typename std::enable_if<bitsery::details::IsFundamentalType<T>::value>::type* <anonymous> = 0; TAdapterReader = bitsery::AdapterReader<InputStreamAdapter, bitsery::DefaultConfig>; TContext = void]'
/home/pi/shogun/build/bitsery/src/bitsery/include/bitsery/deserializer.h:276:39:   required from 'void bitsery::BasicDeserializer<TAdapterReader, TContext>::value8b(T&&) [with T = unsigned int&; TAdapterReader = bitsery::AdapterReader<InputStreamAdapter, bitsery::DefaultConfig>; TContext = void]'
/home/pi/shogun/src/shogun/io/serialization/BitseryDeserializer.cpp:121:2:   required from 'std::shared_ptr<shogun::SGObject> object_reader(Reader&, BitseryReaderVisitor<Reader>*, const std::shared_ptr<shogun::SGObject>&) [with Reader = bitsery::BasicDeserializer<bitsery::AdapterReader<InputStreamAdapter, bitsery::DefaultConfig> >]'
/home/pi/shogun/src/shogun/io/serialization/BitseryDeserializer.cpp:184:55:   required from here
/home/pi/shogun/build/bitsery/src/bitsery/include/bitsery/adapter_reader.h:66:37: error: static assertion failed
             static_assert(sizeof(T) == SIZE, "");
                           ~~~~~~~~~~^~~~~~~
/home/pi/shogun/src/shogun/io/serialization/BitseryDeserializer.cpp: In instantiation of 'void BitseryReaderVisitor<S>::on_floatmax(S&, floatmax_t*) [with S = bitsery::BasicDeserializer<bitsery::AdapterReader<InputStreamAdapter, bitsery::DefaultConfig> >; floatmax_t = long double]':
/home/pi/shogun/src/shogun/io/serialization/BitseryVisitor.h:87:6:   required from 'void shogun::io::detail::BitseryVisitor<S, T>::on(floatmax_t*) [with S = bitsery::BasicDeserializer<bitsery::AdapterReader<InputStreamAdapter, bitsery::DefaultConfig> >; T = BitseryReaderVisitor<bitsery::BasicDeserializer<bitsery::AdapterReader<InputStreamAdapter, bitsery::DefaultConfig> > >; floatmax_t = long double]'
/home/pi/shogun/src/shogun/io/serialization/BitseryVisitor.h:85:10:   required from here
/home/pi/shogun/src/shogun/io/serialization/BitseryDeserializer.cpp:48:8: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   *v = *reinterpret_cast<floatmax_t*>(array);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/shogun/src/shogun/io/serialization/BitseryDeserializer.cpp: In instantiation of 'void BitseryReaderVisitor<S>::on_enter_auto_value(S&, bool*) [with S = bitsery::BasicDeserializer<bitsery::AdapterReader<InputStreamAdapter, bitsery::DefaultConfig> >]':
/home/pi/shogun/src/shogun/io/serialization/BitseryVisitor.h:103:6:   required from 'void shogun::io::detail::BitseryVisitor<S, T>::enter_auto_value(bool*) [with S = bitsery::BasicDeserializer<bitsery::AdapterReader<InputStreamAdapter, bitsery::DefaultConfig> >; T = BitseryReaderVisitor<bitsery::BasicDeserializer<bitsery::AdapterReader<InputStreamAdapter, bitsery::DefaultConfig> > >]'
/home/pi/shogun/src/shogun/io/serialization/BitseryVisitor.h:101:10:   required from here
/home/pi/shogun/src/shogun/io/serialization/BitseryDeserializer.cpp:71:19: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    m_auto_value = *reinterpret_cast<float64_t*>(&obj_magic);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [src/shogun/CMakeFiles/libshogun.dir/build.make:3505: src/shogun/CMakeFiles/libshogun.dir/io/serialization/BitseryDeserializer.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:778: src/shogun/CMakeFiles/libshogun.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
pi@raspberrypi:~/shogun/build $ 

It appears that the line static_assert(sizeof(T) == SIZE, ""); caused the problem. It was printed in orange.

Can anyone help me with this?

Thanks!

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 years ago

This issue is now being closed due to a lack of activity. Feel free to reopen it.