Opened 16 months ago
Closed 16 months ago
#67808 closed defect (fixed)
graph-tool 2.46 build fails on Apple Silicon
Reported by: | essandess (Steve Smith) | Owned by: | essandess (Steve Smith) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | arm64 | Cc: | essandess (Steve Smith) |
Port: | py-graph-tool |
Description
I'm reposting this issue here in case someone knows how to fix this issue on the MacPorts side:
https://git.skewed.de/count0/graph-tool/-/issues/761
graph-tool
builds fail for Apple Silicon arm64
. I've tested separately on a Mac Studio with an M2 Ultra and a MBA with an M1, and see the same issue. The exact same build procedure works on macOS x86_64
.
The build errors are:
:info:build In file included from ./src/graph/graph.hh:42: :info:build ./src/graph/graph_properties.hh:466:19: error: no template named 'unary_function' in namespace 'std'; did you mean '__unary_function'? :info:build : public std::unary_function<typename IndexMap::key_type, size_t> :info:build ~~~~~^~~~~~~~~~~~~~ :info:build __unary_function
A full log file is attached with ./configure and other outputs.
Build environment:
macOS 13.4.1 22F770820d arm64 Xcode 14.3.1 14E300c Python 3.10
Attachments (1)
Change History (9)
Changed 16 months ago by essandess (Steve Smith)
Attachment: | main_py310-graph-tool.log.gz added |
---|
comment:1 Changed 16 months ago by essandess (Steve Smith)
I also see that the latest version graph-tool
2.57 fails with the same error on all architectures.
comment:2 Changed 16 months ago by ryandesign (Ryan Carsten Schmidt)
Looks like it's trying to use std::unary_function
which was removed from the C++ standard as of C++17. gcc has not yet removed unary_function
even when requesting C++17 mode but clang has.
I also see references to boost 1.76 in the log. boost 1.76 uses unary_function
. Use a newer version of boost that no longer attempts to use unary_function
.
comment:3 Changed 16 months ago by essandess (Steve Smith)
Thanks! I tried adding an explicit
boost.version 1.81
to the py-graph-tool
and its dependent cgal5
ports, but these unary_function
errors still appear because they're in the graph-tool code.
Is there a way of specifying another compiler that uses unary_function
?
comment:4 Changed 16 months ago by ryandesign (Ryan Carsten Schmidt)
Sure. I see in the log it's using clang 16. I believe clang 15 and later have removed unary_function
so you could try:
PortGroup compiler_blacklist_versions 1.0 compiler.blacklist-append {macports-clang-1[5-9]} {macports-clang-[2-9][0-9]} {clang >= 1403}
comment:5 Changed 16 months ago by jmroot (Joshua Root)
The newer compilers should still support older C++ standards, so it's probably worth trying -std=c++14
or whatever before you go blacklisting current compilers.
comment:6 Changed 16 months ago by jmroot (Joshua Root)
Oh I see, the code actually requires other C++17 features despite using this feature that has been removed as of C++17. What a mess.
comment:7 Changed 16 months ago by essandess (Steve Smith)
Good news: Simply removing unary_function
per, e.g. https://stackoverflow.com/questions/63577103/what-is-an-equivalent-replacement-for-stdunary-function-in-c17, creates a working, compilable project.
Please see https://github.com/macports/macports-ports/pull/19570
And this code is fast on a Mac Studio M2 Ultra!
comment:8 Changed 16 months ago by essandess (Steve Smith)
Owner: | set to essandess |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Log file of the failed build.