[USRP-users] Build problems with UHD_INLINE

David lists at edeca.net
Fri Dec 19 15:33:59 EST 2014


I'm having trouble building uhd, the below error occurs on both 3.8.0
and 3.8.1 (I never used an earlier version).

The compiler complains with the following message:

In file included from
/var/tmp/portage/net-wireless/uhd-3.8.1/work/uhd-release_003_008_001/host/include/uhd/utils/byteswap.hpp:54:0,
                 from
/var/tmp/portage/net-wireless/uhd-3.8.1/work/uhd-release_003_008_001/host/lib/usrp/common/async_packet_handler.hpp:24,
                 from
/var/tmp/portage/net-wireless/uhd-3.8.1/work/uhd-release_003_008_001/host/lib/usrp/common/fifo_ctrl_excelsior.cpp:19:
/var/tmp/portage/net-wireless/uhd-3.8.1/work/uhd-release_003_008_001/host/include/uhd/utils/byteswap.ipp:
In member function 'void fifo_ctrl_excelsior_impl::handle_msg1()':
/var/tmp/portage/net-wireless/uhd-3.8.1/work/uhd-release_003_008_001/host/include/uhd/utils/byteswap.ipp:120:35:
error: inlining failed in call to always_inline 'T uhd::wtohx(T) [with T
= unsigned int]': indirect function call with a yet undetermined callee
 template<typename T> UHD_INLINE T uhd::wtohx(T num){

Removing UHD_INLINE from the four related functions in byteswap.ipp
makes it compile and it seems to work fine.  I have attached the patch
that makes it compile, included to demonstrate the workaround rather
than as a suggested fix.

I'm using gcc-4.8.3 and glibc-2.19-r1.

David
-------------- next part --------------
--- byteswap.ipp.orig	2014-12-19 20:19:29.918043894 +0000
+++ byteswap.ipp	2014-12-19 20:19:57.708518118 +0000
@@ -101,7 +101,7 @@
  **********************************************************************/
 #include <boost/detail/endian.hpp>
 
-template<typename T> UHD_INLINE T uhd::ntohx(T num){
+template<typename T> T uhd::ntohx(T num){
     #ifdef BOOST_BIG_ENDIAN
         return num;
     #else
@@ -109,7 +109,7 @@
     #endif
 }
 
-template<typename T> UHD_INLINE T uhd::htonx(T num){
+template<typename T> T uhd::htonx(T num){
     #ifdef BOOST_BIG_ENDIAN
         return num;
     #else
@@ -117,7 +117,7 @@
     #endif
 }
 
-template<typename T> UHD_INLINE T uhd::wtohx(T num){
+template<typename T> T uhd::wtohx(T num){
     #ifdef BOOST_BIG_ENDIAN
         return uhd::byteswap(num);
     #else
@@ -125,7 +125,7 @@
     #endif
 }
 
-template<typename T> UHD_INLINE T uhd::htowx(T num){
+template<typename T> T uhd::htowx(T num){
     #ifdef BOOST_BIG_ENDIAN
         return uhd::byteswap(num);
     #else
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build-log.zip
Type: application/x-zip-compressed
Size: 9050 bytes
Desc: not available
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20141219/7fe5bb4c/attachment.zip>


More information about the USRP-users mailing list