Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include of boost have to be the first #704

Merged
merged 1 commit into from
Aug 26, 2021
Merged

Conversation

razerraz
Copy link

Building python extension on ARM fails. Moving include of boost library on top of the file solve the issue :

gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O3 -pipe -fno-plt -fno-semantic-interposition -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O3 -pipe -fno-plt -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O3 -pipe -fno-plt -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector-strong -fno-plt -marm -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -L/usr/lib -I/usr/include -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.9 -c pyRF24.cpp -o build/temp.linux-armv7l-3.9/pyRF24.o
In file included from /usr/include/boost/python/detail/def_helper.hpp:16,
                 from /usr/include/boost/python/class.hpp:29,
                 from /usr/include/boost/python.hpp:18,
                 from pyRF24.cpp:2:
/usr/include/boost/tuple/tuple.hpp:87:70: error: template argument 1 is invalid
   87 | template<class H, class T> class tuple_size< boost::tuples::cons<H, T> >:
      |                                                                      ^
/usr/include/boost/tuple/tuple.hpp:87:72: error: template argument 1 is invalid
   87 | template<class H, class T> class tuple_size< boost::tuples::cons<H, T> >:
      |                                                                        ^
/usr/include/boost/tuple/tuple.hpp:88:59: error: template argument 1 is invalid
   88 |     public boost::tuples::length< boost::tuples::cons<H, T> >
      |                                                           ^
/usr/include/boost/tuple/tuple.hpp:88:61: error: template argument 1 is invalid
   88 |     public boost::tuples::length< boost::tuples::cons<H, T> >
      |                                                             ^
/usr/include/boost/tuple/tuple.hpp:105:91: error: template argument 1 is invalid
  105 | template<std::size_t I, class H, class T> class tuple_element< I, boost::tuples::cons<H, T> >:
      |                                                                                           ^
/usr/include/boost/tuple/tuple.hpp:105:93: error: template argument 2 is invalid
  105 | template<std::size_t I, class H, class T> class tuple_element< I, boost::tuples::cons<H, T> >:
      |                                                                                             ^
/usr/include/boost/tuple/tuple.hpp:106:63: error: template argument 1 is invalid
  106 |     public boost::tuples::element< I, boost::tuples::cons<H, T> >
      |                                                               ^
/usr/include/boost/tuple/tuple.hpp:106:65: error: template argument 2 is invalid
  106 |     public boost::tuples::element< I, boost::tuples::cons<H, T> >
      |                                                                 ^
In file included from /usr/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22,
                 from /usr/include/boost/smart_ptr/detail/yield_k.hpp:23,
                 from /usr/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:14,
                 from /usr/include/boost/smart_ptr/detail/spinlock.hpp:42,
                 from /usr/include/boost/smart_ptr/detail/spinlock_pool.hpp:25,
                 from /usr/include/boost/smart_ptr/shared_ptr.hpp:29,
                 from /usr/include/boost/shared_ptr.hpp:17,
                 from /usr/include/boost/python/converter/shared_ptr_to_python.hpp:12,
                 from /usr/include/boost/python/converter/arg_to_python.hpp:15,
                 from /usr/include/boost/python/call.hpp:15,
                 from /usr/include/boost/python/object_core.hpp:14,
                 from /usr/include/boost/python/args.hpp:22,
                 from /usr/include/boost/python.hpp:11,
                 from pyRF24.cpp:2:

Archlinux on Raspberry pi 3 - python 3.9 - gcc 10.2.0 - boost 1.75

@2bndy5 2bndy5 requested a review from Avamander December 24, 2020 17:24
@2bndy5
Copy link
Member

2bndy5 commented Dec 24, 2020

FYI

Currently the Linux CI action reports using

gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 
Python 3.6.9

IIRC, last I checked Raspbian (now Rasbperry Pi OS) installs libboost v1.69. Also, libboost v1.70+ dropped python 2 support.

I don't know what version of gcc will be installed by apt-get when GitHub actions switch to using Ubuntu 20.04 as ubuntu-latest

@razerraz
Copy link
Author

Well, I don't know the code enough to be sure this can't lead to regressions.
Anyway archlinux AUR package has been patched by myself and builds fine now, there is no hurry then.

@2bndy5
Copy link
Member

2bndy5 commented Jun 13, 2021

Anyway archlinux AUR package has been patched by myself and builds fine now

@razerraz does that mean that this is still needed on our end? It feels like this change isn't really necessary here. Nothing in the RF24 C++ source depends on boost.python (only the pyRF24.cpp file in question).

@2bndy5 2bndy5 closed this Aug 7, 2021
@razerraz
Copy link
Author

@razerraz does that mean that this is still needed on our end?

Yes it's still needed for building 1.4.1

@2bndy5 2bndy5 reopened this Aug 26, 2021
Copy link
Member

@2bndy5 2bndy5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recently found this solved building with pybind11 also

@2bndy5 2bndy5 merged commit e22a8be into nRF24:master Aug 26, 2021
@razerraz
Copy link
Author

Thanks a lot, life is easier without one patch to maintain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants