Skip to content

Boost 1.79.0 errors using Xcode 15.3: upgrade to 1.84.0+ #5229

@jmarrec

Description

@jmarrec

Issue overview

Current Behavior

Every new compiler version out there removes deprecated stuff from C++ STD lib, and this is especially true on Xcode / clang.

We're having to define some macros when building via conan -c tools.build:cxxflags="['-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']" and some more inside our cmake.

OpenStudio/CMakeLists.txt

Lines 377 to 385 in ba1b94b

if(APPLE)
# Without this, cmake will give "Module" libraries the ".so" extension on Apple
# This appears to be a legacy choice by the cmake developers, and seems out of place,
# so the OpenStudio project will use the library suffix ".dylib"
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
# TODO: remove when bumping Boost to 1.81+, cf https://github.com/NREL/OpenStudio/issues/4978
add_definitions(-DBOOST_NO_CXX98_FUNCTION_BASE)
add_definitions(-D_HAS_AUTO_PTR_ETC=0)
endif()

Expected Behavior

Steps to Reproduce

Update to xcode 15.3 or 15.4

 In file included from ./boost/unordered/detail/implementation.hpp:48:
./boost/unordered/detail/fwd.hpp:53:16: error: no member named 'piecewise_construct' in namespace 'std'; did you mean 'piecewise_construct_t'?
    using std::piecewise_construct;
          ~~~~~^~~~~~~~~~~~~~~~~~~
               piecewise_construct_t
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__utility/piecewise_construct.h:20:29: note: 'piecewise_construct_t' declared here
struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { explicit piecewise_construct_t() = default; };

https://github.com/openstudiocoalition/OpenStudioApplication/actions/runs/9923938518/job/27414679234#step:17:5403

Possible Solution

Upgrade to a more recent boost, 1.85.0 right now

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version): all, but especially mac
  • Version of OpenStudio (if using an intermediate build, include SHA): ba1b94b

Context

Found after upgrading compiler on an arm mac.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions