Boost – fail to compile on macOS 14.1.1

try ing to build sc with:

cmake  -DCMAKE_PREFIX_PATH=`brew --prefix qt5`  ..
cmake --build . --target install --config RelWithDebInfo

I get this error with boost:

<…>/supercollider/external_libraries/boost/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
#   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
                                              ^
15 warnings and 1 error generated.
make[2]: *** [external_libraries/CMakeFiles/boost_thread_lib.dir/boost/libs/thread/src/pthread/thread.cpp.o] Error 1
make[1]: *** [external_libraries/CMakeFiles/boost_thread_lib.dir/all] Error 2

I found a reference to a similar error here: Compilation errors with clang 16 · Issue #119 · CauldronDevelopmentLLC/cbang · GitHub

Any clue what could be wrong?

Does anyone else have this problem? @scztt @muellmusik ?
I’d really like to be able to compile again …

Could you post the full error? It seems like some context is missing from the snippet you posted.

I opened a PR which updates the macOS build pipeline to macOS 14 - there are some little things that are making trouble (see here or here, but I haven’t come across the specific error mentioned above).

I think fixing the pipeline issues will guarantee a proper build on a fresh machine, but right now it fails. Lets see how we can fix this.

edit: upgrading boost isn’t such a walk in a park either :confused: This seems to be a labor intensive endeavor

3 Likes

Yes, you are right, there is more to it. Here is the full trace:

$ cmake --build . --target install --config RelWithDebInfo
[  1%] Built target hidapi
[  1%] Built target hidapi_parser
[  3%] Built target ML_UGens
[  4%] Built target boost_system_lib
[  4%] Building CXX object external_libraries/CMakeFiles/boost_thread_lib.dir/boost/libs/thread/src/pthread/thread.cpp.o
In file included from supercollider/external_libraries/boost/libs/thread/src/pthread/thread.cpp:11:
In file included from supercollider/external_libraries/boost/boost/thread/thread_only.hpp:17:
In file included from supercollider/external_libraries/boost/boost/thread/pthread/thread_data.hpp:11:
In file included from supercollider/external_libraries/boost/boost/thread/lock_guard.hpp:12:
In file included from supercollider/external_libraries/boost/boost/thread/detail/move.hpp:25:
In file included from supercollider/external_libraries/boost/boost/move/utility.hpp:30:
In file included from supercollider/external_libraries/boost/boost/move/traits.hpp:31:
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:805:30: warning: builtin __has_trivial_destructor is deprecated; use __is_trivially_destructible instead [-Wdeprecated-builtins]
{  static const bool value = BOOST_MOVE_IS_TRIVIALLY_DESTRUCTIBLE(T); };
                             ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:272:54: note: expanded from macro 'BOOST_MOVE_IS_TRIVIALLY_DESTRUCTIBLE'
   #define BOOST_MOVE_IS_TRIVIALLY_DESTRUCTIBLE(T)   BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR(T)
                                                     ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:128:51: note: expanded from macro 'BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR'
#     define BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
                                                  ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:812:30: warning: builtin __has_trivial_constructor is deprecated; use __is_trivially_constructible instead [-Wdeprecated-builtins]
{  static const bool value = BOOST_MOVE_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE(T); };
                             ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:246:62: note: expanded from macro 'BOOST_MOVE_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE'
   #define BOOST_MOVE_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE(T)  BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR(T)
                                                             ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:119:52: note: expanded from macro 'BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR'
#     define BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
                                                   ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:822:30: warning: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Wdeprecated-builtins]
   static const bool value = BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T);
                             ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:240:60: note: expanded from macro 'BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE'
                                                           BOOST_MOVE_HAS_TRIVIAL_COPY(T))
                                                           ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:122:45: note: expanded from macro 'BOOST_MOVE_HAS_TRIVIAL_COPY'
#     define BOOST_MOVE_HAS_TRIVIAL_COPY(T) __has_trivial_copy(T)
                                            ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:840:30: warning: builtin __has_trivial_assign is deprecated; use __is_trivially_assignable instead [-Wdeprecated-builtins]
   static const bool value = BOOST_MOVE_IS_TRIVIALLY_COPY_ASSIGNABLE(T);
                             ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:260:58: note: expanded from macro 'BOOST_MOVE_IS_TRIVIALLY_COPY_ASSIGNABLE'
                                                         BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T))
                                                         ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:125:48: note: expanded from macro 'BOOST_MOVE_HAS_TRIVIAL_ASSIGN'
#     define BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) )
                                               ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:856:30: warning: builtin __has_nothrow_constructor is deprecated; use __is_nothrow_constructible instead [-Wdeprecated-builtins]
{  static const bool value = BOOST_MOVE_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE(T);  };
                             ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:278:60: note: expanded from macro 'BOOST_MOVE_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE'
   #define BOOST_MOVE_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE(T)  BOOST_MOVE_HAS_NOTHROW_CONSTRUCTOR(T)
                                                           ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:131:52: note: expanded from macro 'BOOST_MOVE_HAS_NOTHROW_CONSTRUCTOR'
#     define BOOST_MOVE_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
                                                   ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:863:30: warning: builtin __has_nothrow_copy is deprecated; use __is_nothrow_constructible instead [-Wdeprecated-builtins]
{  static const bool value = BOOST_MOVE_IS_NOTHROW_COPY_CONSTRUCTIBLE(T);  };
                             ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:284:58: note: expanded from macro 'BOOST_MOVE_IS_NOTHROW_COPY_CONSTRUCTIBLE'
   #define BOOST_MOVE_IS_NOTHROW_COPY_CONSTRUCTIBLE(T)   BOOST_MOVE_HAS_NOTHROW_COPY(T)
                                                         ^
supercollider/external_libraries/boost/boost/move/detail/type_traits.hpp:134:46: note: expanded from macro 'BOOST_MOVE_HAS_NOTHROW_COPY'
#     define BOOST_MOVE_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T))
                                             ^
In file included from supercollider/external_libraries/boost/libs/thread/src/pthread/thread.cpp:11:
In file included from supercollider/external_libraries/boost/boost/thread/thread_only.hpp:22:
In file included from supercollider/external_libraries/boost/boost/thread/detail/thread.hpp:41:
In file included from supercollider/external_libraries/boost/boost/functional/hash.hpp:6:
supercollider/external_libraries/boost/boost/container_hash/hash.hpp:131:33: error: no template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
        struct hash_base : std::unary_function<T, std::size_t> {};
                           ~~~~~^~~~~~~~~~~~~~
                                __unary_function
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/c++/v1/__functional/unary_function.h:46:1: note: '__unary_function' declared here
using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;
^
In file included from supercollider/external_libraries/boost/libs/thread/src/pthread/thread.cpp:19:
In file included from supercollider/external_libraries/boost/boost/thread/future.hpp:51:
In file included from supercollider/external_libraries/boost/boost/optional.hpp:15:
In file included from supercollider/external_libraries/boost/boost/optional/optional.hpp:38:
supercollider/external_libraries/boost/boost/type_traits/has_nothrow_constructor.hpp:27:84: warning: builtin __has_nothrow_constructor is deprecated; use __is_nothrow_constructible instead [-Wdeprecated-builtins]
template <class T> struct has_nothrow_constructor : public integral_constant<bool, BOOST_HAS_NOTHROW_CONSTRUCTOR(T)>{};
                                                                                   ^
supercollider/external_libraries/boost/boost/type_traits/intrinsics.hpp:199:48: note: expanded from macro 'BOOST_HAS_NOTHROW_CONSTRUCTOR'
#     define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible<T>::value)
                                               ^
In file included from supercollider/external_libraries/boost/libs/thread/src/pthread/thread.cpp:19:
In file included from supercollider/external_libraries/boost/boost/thread/future.hpp:51:
In file included from supercollider/external_libraries/boost/boost/optional.hpp:15:
In file included from supercollider/external_libraries/boost/boost/optional/optional.hpp:47:
In file included from supercollider/external_libraries/boost/boost/type_traits/is_nothrow_move_assignable.hpp:16:
supercollider/external_libraries/boost/boost/type_traits/has_nothrow_assign.hpp:65:7: warning: builtin __has_nothrow_assign is deprecated; use __is_nothrow_assignable instead [-Wdeprecated-builtins]
      BOOST_HAS_NOTHROW_ASSIGN(T)
      ^
supercollider/external_libraries/boost/boost/type_traits/intrinsics.hpp:205:43: note: expanded from macro 'BOOST_HAS_NOTHROW_ASSIGN'
#     define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value && is_assignable<T&, const T&>::value)
                                          ^
In file included from supercollider/external_libraries/boost/libs/thread/src/pthread/thread.cpp:19:
In file included from supercollider/external_libraries/boost/boost/thread/future.hpp:65:
In file included from supercollider/external_libraries/boost/boost/function.hpp:30:
In file included from supercollider/external_libraries/boost/boost/function/detail/prologue.hpp:17:
In file included from supercollider/external_libraries/boost/boost/function/function_base.hpp:22:
supercollider/external_libraries/boost/boost/type_traits/has_trivial_copy.hpp:34:4: warning: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Wdeprecated-builtins]
   BOOST_HAS_TRIVIAL_COPY(T) BOOST_TT_TRIVIAL_CONSTRUCT_FIX
   ^
supercollider/external_libraries/boost/boost/type_traits/intrinsics.hpp:190:41: note: expanded from macro 'BOOST_HAS_TRIVIAL_COPY'
#     define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value)
                                        ^
In file included from supercollider/external_libraries/boost/libs/thread/src/pthread/thread.cpp:19:
In file included from supercollider/external_libraries/boost/boost/thread/future.hpp:65:
In file included from supercollider/external_libraries/boost/boost/function.hpp:30:
In file included from supercollider/external_libraries/boost/boost/function/detail/prologue.hpp:17:
In file included from supercollider/external_libraries/boost/boost/function/function_base.hpp:23:
supercollider/external_libraries/boost/boost/type_traits/has_trivial_destructor.hpp:30:86: warning: builtin __has_trivial_destructor is deprecated; use __is_trivially_destructible instead [-Wdeprecated-builtins]
template <typename T> struct has_trivial_destructor : public integral_constant<bool, BOOST_HAS_TRIVIAL_DESTRUCTOR(T)>{};
                                                                                     ^
supercollider/external_libraries/boost/boost/type_traits/intrinsics.hpp:196:47: note: expanded from macro 'BOOST_HAS_TRIVIAL_DESTRUCTOR'
#     define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T)  && is_destructible<T>::value)
                                              ^
In file included from supercollider/external_libraries/boost/libs/thread/src/pthread/thread.cpp:38:
In file included from supercollider/external_libraries/boost/boost/lexical_cast.hpp:32:
In file included from supercollider/external_libraries/boost/boost/lexical_cast/try_lexical_convert.hpp:44:
In file included from supercollider/external_libraries/boost/boost/lexical_cast/detail/converter_lexical.hpp:54:
supercollider/external_libraries/boost/boost/lexical_cast/detail/converter_lexical_streams.hpp:285:21: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
                    sprintf(begin, 
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
In file included from supercollider/external_libraries/boost/libs/thread/src/pthread/thread.cpp:38:
In file included from supercollider/external_libraries/boost/boost/lexical_cast.hpp:32:
In file included from supercollider/external_libraries/boost/boost/lexical_cast/try_lexical_convert.hpp:44:
In file included from supercollider/external_libraries/boost/boost/lexical_cast/detail/converter_lexical.hpp:54:
supercollider/external_libraries/boost/boost/lexical_cast/detail/converter_lexical_streams.hpp:297:21: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
                    sprintf(begin, 
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
In file included from supercollider/external_libraries/boost/libs/thread/src/pthread/thread.cpp:38:
In file included from supercollider/external_libraries/boost/boost/lexical_cast.hpp:32:
In file included from supercollider/external_libraries/boost/boost/lexical_cast/try_lexical_convert.hpp:44:
In file included from supercollider/external_libraries/boost/boost/lexical_cast/detail/converter_lexical.hpp:54:
supercollider/external_libraries/boost/boost/lexical_cast/detail/converter_lexical_streams.hpp:310:21: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
                    sprintf(begin, 
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
In file included from supercollider/external_libraries/boost/libs/thread/src/pthread/thread.cpp:11:
In file included from supercollider/external_libraries/boost/boost/thread/thread_only.hpp:17:
In file included from supercollider/external_libraries/boost/boost/thread/pthread/thread_data.hpp:12:
In file included from supercollider/external_libraries/boost/boost/thread/lock_types.hpp:18:
In file included from supercollider/external_libraries/boost/boost/thread/thread_time.hpp:11:
In file included from supercollider/external_libraries/boost/boost/date_time/posix_time/posix_time_types.hpp:16:
In file included from supercollider/external_libraries/boost/boost/date_time/posix_time/posix_time_duration.hpp:15:
In file included from supercollider/external_libraries/boost/boost/numeric/conversion/cast.hpp:33:
In file included from supercollider/external_libraries/boost/boost/numeric/conversion/converter.hpp:13:
In file included from supercollider/external_libraries/boost/boost/numeric/conversion/conversion_traits.hpp:13:
In file included from supercollider/external_libraries/boost/boost/numeric/conversion/detail/conversion_traits.hpp:18:
In file included from supercollider/external_libraries/boost/boost/numeric/conversion/detail/int_float_mixture.hpp:19:
In file included from supercollider/external_libraries/boost/boost/mpl/integral_c.hpp:32:
supercollider/external_libraries/boost/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion]
    typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
                              ^
supercollider/external_libraries/boost/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
#   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
                                              ^
In file included from supercollider/external_libraries/boost/libs/thread/src/pthread/thread.cpp:11:
In file included from supercollider/external_libraries/boost/boost/thread/thread_only.hpp:17:
In file included from supercollider/external_libraries/boost/boost/thread/pthread/thread_data.hpp:12:
In file included from supercollider/external_libraries/boost/boost/thread/lock_types.hpp:18:
In file included from supercollider/external_libraries/boost/boost/thread/thread_time.hpp:11:
In file included from supercollider/external_libraries/boost/boost/date_time/posix_time/posix_time_types.hpp:16:
In file included from supercollider/external_libraries/boost/boost/date_time/posix_time/posix_time_duration.hpp:15:
In file included from supercollider/external_libraries/boost/boost/numeric/conversion/cast.hpp:33:
In file included from supercollider/external_libraries/boost/boost/numeric/conversion/converter.hpp:13:
In file included from supercollider/external_libraries/boost/boost/numeric/conversion/conversion_traits.hpp:13:
In file included from supercollider/external_libraries/boost/boost/numeric/conversion/detail/conversion_traits.hpp:18:
In file included from supercollider/external_libraries/boost/boost/numeric/conversion/detail/int_float_mixture.hpp:19:
In file included from supercollider/external_libraries/boost/boost/mpl/integral_c.hpp:32:
supercollider/external_libraries/boost/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion]
supercollider/external_libraries/boost/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
#   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
                                              ^
13 warnings and 3 errors generated.
make[2]: *** [external_libraries/CMakeFiles/boost_thread_lib.dir/boost/libs/thread/src/pthread/thread.cpp.o] Error 1
make[1]: *** [external_libraries/CMakeFiles/boost_thread_lib.dir/all] Error 2
make: *** [all] Error 2

Maybe that’s the deprecation of std::unary_function with C++17? (solution would be use force c++14 std or upgrade boost)

(I use system boost lib (in fedora 39 is 1.81) with no problems, clang17 and gcc 13.2.1

I went through the trouble in Topic/upgrade boost 1.80.0 unpatched by shimpe · Pull Request #5924 · supercollider/supercollider · GitHub
However, for some reason it has not been accepted yet and activity on github appears to have halted?

Not seen this one, no.

This is the real issue. It seems the ship has no captain right now.

Sam

There hasn’t been a captain on this ship for many years, and this may in fact be a very good thing. A nonexistent captain can’t suddenly leave.

But we need the awareness by each of us for a bit of responsibility for parts of the ship!

1 Like

Since your PR, 1.81.0 has been released. I’ve been running with no problem here. (other releases as well, but this one I’ve been testing with no issue)

We don’t have “official” maintainers, but in practice there have always been 1 or 2 “captains”.

I guess we should organize a dev meeting to discuss the current state of development. AFAICT, there hasn’t been a meeting since mid of December.

1 Like

I also had this problem, which I papered over by accepting the suggested fix in XCode. I’ve now updated XCode (and and dev tools) again and get more errors related to boost, and the fix is not a straightforward. (the same errors in @julian’s post)