Opened 12 months ago
Closed 10 months ago
#73093 closed defect (fixed)
geos @3.14.0 build failure: no template named 'unordered_map' in namespace 'std'
| Reported by: | dbl001 (dbl) | Owned by: | stromnov (Andrey Stromnov) |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 2.11.5 |
| Keywords: | Cc: | Dave-Allured (Dave Allured) | |
| Port: | geos |
Description
:info:build [ 7%] Building CXX object CMakeFiles/geos.dir/src/coverage/CoverageSimplifier.cpp.o :info:build /usr/bin/clang++ -DNDEBUG -DUSE_UNSTABLE_GEOS_CPP_API -Dgeos_EXPORTS -I/opt/local/var/macports/build/geos-26b79596/work/geos-3.14.0/include -I/opt/local/var/macports/build/geos-26b79596/work/build/include -I/opt/local/var/macports/build/geos-26b79596/work/geos-3.14.0/src/deps -I/opt/local/var/macports/build/geos-26b79596/work/build/src/deps -pipe -Os -DNDEBUG -I/opt/local/include -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -std=c++17 -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.15 -fPIC -ffp-contract=off -MD -MT CMakeFiles/geos.dir/src/coverage/CoverageSimplifier.cpp.o -MF CMakeFiles/geos.dir/src/coverage/CoverageSimplifier.cpp.o.d -o CMakeFiles/geos.dir/src/coverage/CoverageSimplifier.cpp.o -c /opt/local/var/macports/build/geos-26b79596/work/geos-3.14.0/src/coverage/CoverageSimplifier.cpp :info:build /opt/local/var/macports/build/geos-26b79596/work/geos-3.14.0/src/coverage/CoverageRingEdges.cpp:281:10: error: no template named 'unordered_map' in namespace 'std'; did you mean 'unordered_set'? :info:build std::unordered_map<Coordinate, std::size_t, Coordinate::HashCode> counter; :info:build ~~~~~^~~~~~~~~~~~~ :info:build unordered_set :info:build /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/unordered_set:382:28: note: 'unordered_set' declared here :info:build class _LIBCPP_TEMPLATE_VIS unordered_set :info:build ^ :info:build In file included from /opt/local/var/macports/build/geos-26b79596/work/geos-3.14.0/src/coverage/CoverageRingEdges.cpp:16: :info:build In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/map:479: :info:build In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__tree:15: :info:build /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:2276:3: error: static_assert failed due to requirement '!is_same<unsigned long, unsigned long>::value' "__compressed_pair cannot be instantated when T1 and T2 are the same type; The current implementation is NOT ABI-compatible with the previous implementation for this configuration" :info:build static_assert((!is_same<_T1, _T2>::value), :info:build ^ ~~~~~~~~~~~~~~~~~~~~~~~~~ :info:build /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__hash_table:958:59: note: in instantiation of template class 'std::__1::__compressed_pair<unsigned long, unsigned long>' requested here :info:build __compressed_pair<size_type, hasher> __p2_; :info:build ^ :info:build /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/unordered_set:399:13: note: in instantiation of template class 'std::__1::__hash_table<geos::geom::Coordinate, unsigned long, geos::geom::CoordinateXY::HashCode, std::__1::allocator<geos::geom::Coordinate> >' requested here :info:build __table __table_; :info:build ^ :info:build /opt/local/var/macports/build/geos-26b79596/work/geos-3.14.0/src/coverage/CoverageRingEdges.cpp:281:71: note: in instantiation of template class 'std::__1::unordered_set<geos::geom::Coordinate, unsigned long, geos::geom::CoordinateXY::HashCode, std::__1::allocator<geos::geom::Coordinate> >' requested here :info:build std::unordered_map<Coordinate, std::size_t, Coordinate::HashCode> counter; :info:build ^
Attachments (1)
Change History (18)
Changed 12 months ago by dbl001 (dbl)
comment:1 Changed 12 months ago by jmroot (Joshua Root)
| Owner: | set to stromnov |
|---|---|
| Port: | geos added; gets removed |
| Status: | new → assigned |
| Summary: | :2276:3: error: static_assert failed due to requirement '!is_same<unsigned long, unsigned long>::value' "__compressed_pair cannot be instantated when T1 and T2 → geos @3.14.0 build failure: no template named 'unordered_map' in namespace 'std' |
comment:2 Changed 11 months ago by ryandesign (Ryan Carsten Schmidt)
comment:3 follow-up: 7 Changed 11 months ago by Dave-Allured (Dave Allured)
I would guess the developers forgot to
#include <unordered_map>in this file.
I think not, although I could be wrong. geos builds fine on macOS 13-26, fails only on 12 and earlier. This looks like another one of those C++ advanced templating issues.
Release notes say that the compiler standard was increased to C++17 for this 3.14.0 version. However, compiler.cxx_standard in Portfile was not increased and remains at 2014. I will try increasing this to 2017, but will need an experimental merge, because I can not test locally on macOS 12 or earlier.
comment:4 Changed 11 months ago by Dave-Allured (Dave Allured)
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:5 Changed 11 months ago by dbl001 (dbl)
Still fails here:
info:build /usr/bin/clang++ -DNDEBUG -DUSE_UNSTABLE_GEOS_CPP_API -Dgeos_EXPORTS -I/opt/local/var/macports/build/geos-26b79596/work/geos-3.14.0/include -I/opt/local/var/macports/build/geos-26b79596/work/build/include -I/opt/local/var/macports/build/geos-26b79596/work/geos-3.14.0/src/deps -I/opt/local/var/macports/build/geos-26b79596/work/build/src/deps -pipe -Os -DNDEBUG -I/opt/local/include -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -std=c++17 -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.15 -fPIC -ffp-contract=off -MD -MT CMakeFiles/geos.dir/src/coverage/CoverageSimplifier.cpp.o -MF CMakeFiles/geos.dir/src/coverage/CoverageSimplifier.cpp.o.d -o CMakeFiles/geos.dir/src/coverage/CoverageSimplifier.cpp.o -c /opt/local/var/macports/build/geos-26b79596/work/geos-3.14.0/src/coverage/CoverageSimplifier.cpp :info:build /opt/local/var/macports/build/geos-26b79596/work/geos-3.14.0/src/coverage/CoverageRingEdges.cpp:281:10: error: no template named 'unordered_map' in namespace 'std'; did you mean 'unordered_set'? :info:build std::unordered_map<Coordinate, std::size_t, Coordinate::HashCode> counter; :info:build ~~~~~^~~~~~~~~~~~~ :info:build unordered_set :info:build /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/unordered_set:382:28: note: 'unordered_set' declared here :info:build class _LIBCPP_TEMPLATE_VIS unordered_set :info:build ^ :info:build In file included from /opt/local/var/macports/build/geos-26b79596/work/geos-3.14.0/src/coverage/CoverageRingEdges.cpp:16: :info:build In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/map:479: :info:build In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__tree:15: :info:build /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:2276:3: error: static_assert failed due to requirement '!is_same<unsigned long, unsigned long>::value' "__compressed_pair cannot be instantated when T1 and T2 are the same type; The current implementation is NOT ABI-compatible with the previous implementation for this configuration" :info:build static_assert((!is_same<_T1, _T2>::value), :info:build ^ ~~~~~~~~~~~~~~~~~~~~~~~~~ :info:build /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__hash_table:958:59: note: in instantiation of template class 'std::__1::__compressed_pair<unsigned long, unsigned long>' requested here :info:build __compressed_pair<size_type, hasher> __p2_; :info:build ^ :info:build /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/unordered_set:399:13: note: in instantiation of template class 'std::__1::__hash_table<geos::geom::Coordinate, unsigned long, geos::geom::CoordinateXY::HashCode, std::__1::allocator<geos::geom::Coordinate> >' requested here :info:build __table __table_; :info:build ^ :info:build /opt/local/var/macports/build/geos-26b79596/work/geos-3.14.0/src/coverage/CoverageRingEdges.cpp:281:71: note: in instantiation of template class 'std::__1::unordered_set<geos::geom::Coordinate, unsigned long, geos::geom::CoordinateXY::HashCode, std::__1::allocator<geos::geom::Coordinate> >' requested here :info:build std::unordered_map<Coordinate, std::size_t, Coordinate::HashCode> counter; :info:build ^ :info:build 2 errors generated. :info:build make[2]: *** [CMakeFiles/geos.dir/src/coverage/CoverageRingEdges.cpp.o] Error 1 :info:build make[2]: *** Waiting for unfinished jobs....
comment:6 Changed 11 months ago by dbl001 (dbl)
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
comment:7 follow-up: 9 Changed 11 months ago by ryandesign (Ryan Carsten Schmidt)
Replying to Dave-Allured:
I would guess the developers forgot to
#include <unordered_map>in this file.I think not, although I could be wrong.
geosbuilds fine on macOS 13-26, fails only on 12 and earlier.
It could be explained by a system header on macOS 13–26 including <unordered_map> but that not being the case on macOS 12 and earlier. This kind of thing happens all the time, where code inadvertently doesn't include a needed header because it was coincidentally already included in some but not all toolchains.
comment:8 Changed 11 months ago by Dave-Allured (Dave Allured)
@dbl001 Thanks for reopening. Yes, updating compiler.cxx_standard seems to have changed nothing. I was waiting for one of the OS 12 builds to complete before posting, but you beat me to it.
comment:9 Changed 11 months ago by Dave-Allured (Dave Allured)
Replying to ryandesign:
Replying to Dave-Allured:
I would guess the developers forgot to
#include <unordered_map>in this file.I think not, although I could be wrong.
geosbuilds fine on macOS 13-26, fails only on 12 and earlier.It could be explained by a system header on macOS 13–26 including <unordered_map> but that not being the case on macOS 12 and earlier. This kind of thing happens all the time, where code inadvertently doesn't include a needed header because it was coincidentally already included in some but not all toolchains.
Okay, I stand corrected. Thanks! I assumed unordered_map came from geos source, but it is actually a standard C++ header. I will take another look at geos source, see where else this header might have been forgotten.
comment:10 Changed 11 months ago by Dave-Allured (Dave Allured)
CoverageRingEdges.cpp seems to be the only file affected. Yes indeed, this file was updated in the last upstream version, and that include was forgotten. I will work up a patch, also notify upstream.
comment:11 Changed 11 months ago by Dave-Allured (Dave Allured)
Was already reported upstream: https://github.com/libgeos/geos/issues/1302
comment:12 Changed 11 months ago by Dave-Allured (Dave Allured)
| Cc: | Dave-Allured added |
|---|
comment:13 Changed 11 months ago by Dave-Allured (Dave Allured)
Was fixed by https://github.com/macports/macports-ports/pull/29590.
Please close this ticket.
comment:14 Changed 11 months ago by Dave-Allured (Dave Allured)
10.15 build now fails on GridIntersection.cpp: Matrix.h: subscript of pointer to incomplete type std::__1::shared_ptr ...
Last working build on 10.15 was on 2025-03-26, before update to geos 3.14.0. Any ideas? New ticket, I suppose?
comment:15 Changed 11 months ago by Dave-Allured (Dave Allured)
operation/grid/GridIntersection.cpp and operation/grid/Matrix.h were new files, part of a large code addition in geos 3.14.0. It looks like more debugging is ahead for macOS 10.15 and earlier. For example, builder 10.10 compiles operation/grid/GridIntersection.cpp correctly, then fails elsewhere.
comment:16 Changed 10 months ago by Dave-Allured (Dave Allured)
GridIntersection.cpp and other recent C++ errors were fixed in commit df2a7fe. GEOS is now building fine for all modern macOS versions. Please close this ticket.
comment:17 Changed 10 months ago by reneeotten (Renee Otten)
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |

I would guess the developers forgot to
#include <unordered_map>in this file.Please report the bug to the developers so they can fix it.