Opened 4 years ago

Closed 2 years ago

#61329 closed defect (fixed)

minizinc @2.5.0_0: error: chosen constructor is explicit in copy-initialization

Reported by: chrstphrchvz (Christopher Chavez) Owned by: herbygillot (Herby Gillot)
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: Cc:
Port: minizinc

Description

On macOS 10.7-10.9 (but not 10.6), the builds fail:

/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_minizinc/minizinc/work/libminizinc-2.5.0/include/minizinc/solvers/nl/nl_file.hh:74:44: error: chosen constructor is explicit in copy-initialization
  std::map<std::string, NLVar> variables = {};
                                           ^~
/usr/bin/../lib/c++/v1/map:727:14: note: constructor declared here
    explicit map(const key_compare& __comp = key_compare())
             ^

From searching online, this is because of a C++ standard library issue (LWG 2193), fixed in C++14 and apparently by libc++ in macOS 10.10.

Does MacPorts already have of a workaround for this sort of problem?

Change History (4)

comment:1 Changed 4 years ago by jmroot (Joshua Root)

If minizinc requires C++14, it should say so with compiler.cxx_standard. The error is of course correct according to the C++11 spec. This particular error would be pretty easy to work around in the code, see e.g. https://github.com/squid-cache/squid/commit/84011c4813ca9949f949ecd90524fc468b5c1683

The project's CMakeLists.txt does not appear to be specifying that it needs C++14, but it does set CMAKE_OSX_DEPLOYMENT_TARGET to 10.9 (no indication why, but quite likely because that's when libc++ became the default). There's probably a conversation to be had with upstream about whether they actually want to require C++14, and if older OS versions can be allowed if a new enough C++ compiler is available.

comment:2 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

Is legacysupport.use_mp_libcxx yes a possible solution for this issue?

comment:3 Changed 2 years ago by herbygillot (Herby Gillot)

In df7df231915022fda16d9c889d3e2daaece8c3dd/macports-ports (master):

minizinc: update to 2.6.4

See: #61329

comment:4 Changed 2 years ago by herbygillot (Herby Gillot)

Resolution: fixed
Status: assignedclosed

minizinc seems to be building on 10.7 - 10.9 now.

Note: See TracTickets for help on using tickets.