Trouble building sc source Mac m2

I dl’ed QT5 , Xcode 15.4, cmake, gcc, and all the files the Mac page listed via terminal/ home-brew
here is a link to the whole Terminal read out ;

I almost Built it but got this error, My user name is ss,

**** BUILD FAILED ****

The following build commands failed:

CompileC /Users/ss/SuperCollider/build/build/boost_regex_lib.build/RelWithDebInfo/Objects-normal/arm64/wide_posix_api.o /Users/ss/SuperCollider/external_libraries/boost/libs/regex/src/wide_posix_api.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target ‘boost_regex_lib’ from project ‘SuperCollider’)

(1 failure)

I believe this problem is cause by XCode 15’s clang, which recently removed the (looooong deprecated) std::unary_function causing build problems with boost. Basically everyone’s builds blew up when XCode 15 was released :slight_smile: - this is the compiler change that made everyone on the planet do a boost update whether they wanted to or not.

I’ve seen some people work around this with this:

  # std::unary_function was removed since clang 15
  # The macro has already been defined in boost/config/stdlib/dinkumware.hpp(258,1),
  # so no need to define it again to avoid 'macro redefinition' error.
  if(CMAKE_COMPILER_IS_CLANG)
      add_definitions(-DBOOST_NO_CXX98_FUNCTION_BASE)
  endif()

Try adding this to the root-level CMakeLists.txt, somewhere inside the if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG) section, and see if it resolves? Please report back because this error has been trouble and it would be good to know if this fixes.

Another option is to build with a slightly older compiler - you can try XCode 14 (https://xcodereleases.com/) . You could also install an older version of llvm (e.g. brew install llvm@16) - though this probably requires that you use VSCode or a similar more flexible IDE, so it just depends on how tied to XCode as your IDE.

Added it ; got

**** BUILD FAILED ****

The following build commands failed:

CompileC /Users/ss/SuperCollider/build/build/boost_thread_lib.build/RelWithDebInfo/Objects-normal/arm64/thread.o /Users/ss/SuperCollider/external_libraries/boost/libs/thread/src/pthread/thread.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target ‘boost_thread_lib’ from project ‘SuperCollider’)

(1 failure)
ill try Xcode 14

Dl’ed latest Xcode 14. Had to open it by going into the app folder.
Build succeeded

You were right.

But I get this error everytime I quit SC.

Anyway to get rid of it?

It’s massive sorry

We had success getting around boost problems with this (M1, XCode 15.3, Sonoma 14.4.1), although the error wasn’t related to regex… but could help your situation as well?

1 Like

Build succeeded with that help , thanks. Still get an error pop up when I quit, Its annoying. oh well. I used the new Xcode 15.4