Closed barracuda156 closed 1 year ago
Related: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105707 Notice, this is not a bug in GCC.
This is a boost bug. It is not present in the included boost (i.e., do not set LSL_BUNDLED_BOOST=OFF
and leave it the default ON), it is not present in boost 1.74, it IS present in 1.76, and it was fixed in this commit for 1.77.
Nothing to be done in liblsl.
@cboulay Thank you for the detailed info! We won’t use bundled Boost, but we can set another Boost version to be used by the port. I will discuss this with the port maintainer.
@cboulay With Boost 171 it fails here:
In file included from /opt/local/libexec/boost/1.71/include/boost/endian/detail/endian_reverse.hpp:13,
from /opt/local/libexec/boost/1.71/include/boost/endian/conversion.hpp:11,
from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_liblsl/liblsl/work/liblsl-1.16.1/src/util/endian.hpp:3,
from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_liblsl/liblsl/work/liblsl-1.16.1/src/sample.h:6,
from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_liblsl/liblsl/work/liblsl-1.16.1/src/sample.cpp:2:
/opt/local/libexec/boost/1.71/include/boost/endian/detail/endian_reverse.hpp: In instantiation of 'T boost::endian::endian_reverse(T) [with T = double]':
/opt/local/libexec/boost/1.71/include/boost/endian/detail/endian_reverse.hpp:97:23: required from 'void boost::endian::endian_reverse_inplace(EndianReversible&) [with EndianReversible = double]'
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_liblsl/liblsl/work/liblsl-1.16.1/src/sample.cpp:185:65: required from 'void save_value(std::streambuf&, T, bool) [with T = double; std::streambuf = std::basic_streambuf<char>]'
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_liblsl/liblsl/work/liblsl-1.16.1/src/sample.cpp:196:13: required from here
/opt/local/libexec/boost/1.71/include/boost/endian/detail/endian_reverse.hpp:87:5: error: static assertion failed: is_integral<T>::value && !is_same<T, bool>::value
87 | BOOST_STATIC_ASSERT( is_integral<T>::value && !is_same<T, bool>::value );
| ^~~~~~~~~~~~~~~~~~~
/opt/local/libexec/boost/1.71/include/boost/endian/detail/endian_reverse.hpp:87:5: note: 'boost::integral_constant<bool, false>::value' evaluates to false
make[2]: *** [CMakeFiles/lslobj.dir/src/sample.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_liblsl/liblsl/work/build'
make[1]: *** [CMakeFiles/lslobj.dir/all] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_liblsl/liblsl/work/build'
make: *** [all] Error 2
Boost 181 works fine.
However, there are two more errors. One pthread-related, we have a patch for it:
--- thirdparty/loguru/loguru.cpp
+++ thirdparty/loguru/loguru.cpp
@@ -1084,7 +1084,17 @@ namespace loguru
#ifdef __APPLE__
uint64_t thread_id;
- pthread_threadid_np(pthread_self(), &thread_id);
+ #if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 || defined __POWERPC__
+ thread_id = pthread_mach_thread_np(pthread_self());
+ #elif MAC_OS_X_VERSION_MIN_REQUIRED < 1060
+ if (&pthread_threadid_np) {
+ pthread_threadid_np(pthread_self(), &thread_id);
+ } else {
+ thread_id = pthread_mach_thread_np(pthread_self());
+ }
+ #else
+ pthread_threadid_np(pthread_self(), &thread_id);
+ #endif
#elif defined(__FreeBSD__)
long thread_id;
(void)thr_self(&thread_id);
Another this one:
[ 96%] Building C object CMakeFiles/lslver.dir/testing/lslver.c.o
/opt/local/bin/gcc-mp-12 -DLIBLSL_EXPORTS -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_liblsl/liblsl/work/liblsl-1.16.1/include -pipe -Os -DNDEBUG -I/opt/local/libexec/boost/1.81/include -I/opt/local/include -flto=auto -fno-fat-lto-objects -arch ppc -mmacosx-version-min=10.6 -fPIE -MD -MT CMakeFiles/lslver.dir/testing/lslver.c.o -MF CMakeFiles/lslver.dir/testing/lslver.c.o.d -o CMakeFiles/lslver.dir/testing/lslver.c.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_liblsl/liblsl/work/liblsl-1.16.1/testing/lslver.c
cc1: error: '-fno-fat-lto-objects' are supported only with linker plugin
make[2]: *** [CMakeFiles/lslver.dir/testing/lslver.c.o] Error 1
Not too sure where this -fno-fat-lto-objects
gets pulled from.
FWIW the bundled boost version is set here: https://github.com/sccn/liblsl/blob/master/update_lslboost.sh#L4