Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error: vector.hpp: error: call of overloaded 'Vec(<brace-enclosed initializer list>)' is ambiguous #68

Open
barracuda156 opened this issue Jan 3, 2024 · 2 comments

Comments

@barracuda156
Copy link

:info:build In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/bla.hpp:11,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem/fem.hpp:14,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem/maxwellintegrator.cpp:14:
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp: In instantiation of 'auto ngbla::Cross(const TA&, const TB&) [with TA = Vec<3, ngcore::SIMD<double, 2> >; TB = Vec<3, ngcore::SIMD<double, 2> >; typename std::enable_if<(ConstVecSize<T>::VSIZE == 3), bool>::type <anonymous> = true; typename std::enable_if<(ConstVecSize<TB>::VSIZE == 3), bool>::type <anonymous> = true]':
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem/intrule.hpp:1861:37:   required from here
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp:874:12: error: call of overloaded 'Vec(<brace-enclosed initializer list>)' is ambiguous
:info:build   874 |     return Vec<3,T>({ a(1)*b(2)-a(2)*b(1), a(2)*b(0)-a(0)*b(2), a(0)*b(1)-a(1)*b(0) });
:info:build       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp:661:12: note: candidate: 'ngbla::Vec<S, T>::Vec(const TELEM&) [with int S = 3; T = ngcore::SIMD<double, 2>; TELEM = ngcore::SIMD<double, 2>]'
:info:build   661 |     INLINE Vec (const TELEM & scal)
:info:build       |            ^~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp:654:5: note: candidate: 'constexpr ngbla::Vec<S, T>::Vec(const ngbla::Vec<S, T>&) [with int S = 3; T = ngcore::SIMD<double, 2>]'
:info:build   654 |     Vec (const Vec &) = default;
:info:build       |     ^~~
:info:build In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/bla.hpp:11,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem/fem.hpp:14,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem/diffop_grad.cpp:1:
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp: In instantiation of 'auto ngbla::Cross(const TA&, const TB&) [with TA = Vec<3, ngcore::SIMD<double, 2> >; TB = Vec<3, ngcore::SIMD<double, 2> >; typename std::enable_if<(ConstVecSize<T>::VSIZE == 3), bool>::type <anonymous> = true; typename std::enable_if<(ConstVecSize<TB>::VSIZE == 3), bool>::type <anonymous> = true]':
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem/intrule.hpp:1861:37:   required from here
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp:874:12: error: call of overloaded 'Vec(<brace-enclosed initializer list>)' is ambiguous
:info:build   874 |     return Vec<3,T>({ a(1)*b(2)-a(2)*b(1), a(2)*b(0)-a(0)*b(2), a(0)*b(1)-a(1)*b(0) });
:info:build       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp:661:12: note: candidate: 'ngbla::Vec<S, T>::Vec(const TELEM&) [with int S = 3; T = ngcore::SIMD<double, 2>; TELEM = ngcore::SIMD<double, 2>]'
:info:build   661 |     INLINE Vec (const TELEM & scal)
:info:build       |            ^~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp:654:5: note: candidate: 'constexpr ngbla::Vec<S, T>::Vec(const ngbla::Vec<S, T>&) [with int S = 3; T = ngcore::SIMD<double, 2>]'
:info:build   654 |     Vec (const Vec &) = default;
:info:build       |     ^~~
:info:build In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/bla.hpp:11,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem/fem.hpp:14,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem/diffop_id.cpp:1:
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp: In instantiation of 'auto ngbla::Cross(const TA&, const TB&) [with TA = Vec<3, ngcore::SIMD<double, 2> >; TB = Vec<3, ngcore::SIMD<double, 2> >; typename std::enable_if<(ConstVecSize<T>::VSIZE == 3), bool>::type <anonymous> = true; typename std::enable_if<(ConstVecSize<TB>::VSIZE == 3), bool>::type <anonymous> = true]':
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem/intrule.hpp:1861:37:   required from here
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp:874:12: error: call of overloaded 'Vec(<brace-enclosed initializer list>)' is ambiguous
:info:build   874 |     return Vec<3,T>({ a(1)*b(2)-a(2)*b(1), a(2)*b(0)-a(0)*b(2), a(0)*b(1)-a(1)*b(0) });
:info:build       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp:661:12: note: candidate: 'ngbla::Vec<S, T>::Vec(const TELEM&) [with int S = 3; T = ngcore::SIMD<double, 2>; TELEM = ngcore::SIMD<double, 2>]'
:info:build   661 |     INLINE Vec (const TELEM & scal)
:info:build       |            ^~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp:654:5: note: candidate: 'constexpr ngbla::Vec<S, T>::Vec(const ngbla::Vec<S, T>&) [with int S = 3; T = ngcore::SIMD<double, 2>]'
:info:build   654 |     Vec (const Vec &) = default;
:info:build       |     ^~~
:info:build In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/bla.hpp:11,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem/fem.hpp:14,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem/bdbequations.cpp:14:
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp: In instantiation of 'auto ngbla::Cross(const TA&, const TB&) [with TA = Vec<3, ngcore::SIMD<double, 2> >; TB = Vec<3, ngcore::SIMD<double, 2> >; typename std::enable_if<(ConstVecSize<T>::VSIZE == 3), bool>::type <anonymous> = true; typename std::enable_if<(ConstVecSize<TB>::VSIZE == 3), bool>::type <anonymous> = true]':
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem/intrule.hpp:1861:37:   required from here
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp:874:12: error: call of overloaded 'Vec(<brace-enclosed initializer list>)' is ambiguous
:info:build   874 |     return Vec<3,T>({ a(1)*b(2)-a(2)*b(1), a(2)*b(0)-a(0)*b(2), a(0)*b(1)-a(1)*b(0) });
:info:build       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp:661:12: note: candidate: 'ngbla::Vec<S, T>::Vec(const TELEM&) [with int S = 3; T = ngcore::SIMD<double, 2>; TELEM = ngcore::SIMD<double, 2>]'
:info:build   661 |     INLINE Vec (const TELEM & scal)
:info:build       |            ^~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp:654:5: note: candidate: 'constexpr ngbla::Vec<S, T>::Vec(const ngbla::Vec<S, T>&) [with int S = 3; T = ngcore::SIMD<double, 2>]'
:info:build   654 |     Vec (const Vec &) = default;
:info:build       |     ^~~
:info:build In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/bla.hpp:11,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem/fem.hpp:14,
:info:build                  from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem/diffop_hesse.cpp:1:
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp: In instantiation of 'auto ngbla::Cross(const TA&, const TB&) [with TA = Vec<3, ngcore::SIMD<double, 2> >; TB = Vec<3, ngcore::SIMD<double, 2> >; typename std::enable_if<(ConstVecSize<T>::VSIZE == 3), bool>::type <anonymous> = true; typename std::enable_if<(ConstVecSize<TB>::VSIZE == 3), bool>::type <anonymous> = true]':
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem/intrule.hpp:1861:37:   required from here
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp:874:12: error: call of overloaded 'Vec(<brace-enclosed initializer list>)' is ambiguous
:info:build   874 |     return Vec<3,T>({ a(1)*b(2)-a(2)*b(1), a(2)*b(0)-a(0)*b(2), a(0)*b(1)-a(1)*b(0) });
:info:build       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp:661:12: note: candidate: 'ngbla::Vec<S, T>::Vec(const TELEM&) [with int S = 3; T = ngcore::SIMD<double, 2>; TELEM = ngcore::SIMD<double, 2>]'
:info:build   661 |     INLINE Vec (const TELEM & scal)
:info:build       |            ^~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg/vector.hpp:654:5: note: candidate: 'constexpr ngbla::Vec<S, T>::Vec(const ngbla::Vec<S, T>&) [with int S = 3; T = ngcore::SIMD<double, 2>]'
:info:build   654 |     Vec (const Vec &) = default;
:info:build       |     ^~~
:info:build [ 20%] Building CXX object linalg/CMakeFiles/ngla.dir/basevector.cpp.o
:info:build cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/build/linalg && /opt/local/bin/g++-mp-13 -DHAVE_CXA_DEMANGLE -DHAVE_DLFCN_H -DHAVE_NETGEN_SOURCES -DLAPACK -DMSG_NOSIGNAL=0 -DNETGEN_PYTHON -DNGS_PYTHON -DNG_PYTHON -DPYBIND11_SIMPLE_GIL_MANAGEMENT -DTCL -DUSE_TIMEOFDAY -DUSE_UMFPACK -Dngla_EXPORTS -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/linalg -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/ngscuda -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/solve -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/parallel -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/comp -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/fem -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/basiclinalg -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/ngstd -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/include -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/build -I/opt/local/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -isystem /opt/local/include/include -isystem /opt/local/include -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -fPIC -std=c++17 -DMAX_SYS_DIM=3 -std=gnu++17 -MD -MT linalg/CMakeFiles/ngla.dir/basevector.cpp.o -MF CMakeFiles/ngla.dir/basevector.cpp.o.d -o CMakeFiles/ngla.dir/basevector.cpp.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ngsolve/ngsolve/work/ngsolve-6.2.2307/linalg/basevector.cpp
:info:build make[2]: *** [fem/CMakeFiles/ngfem.dir/diffop_hesse.cpp.o] Error 1
@pinskia
Copy link

pinskia commented Jan 3, 2024

This might not be a GCC issue. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60027 and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109247 . The C++ standard has defect reports in this area even.

@barracuda156
Copy link
Author

barracuda156 commented Jan 3, 2024

@pinskia Indeed, and with Clang it fails earlier, but with similar errors: #69

UPD. But no error with gcc-12. Build is still running, but it is well past the point where gcc-13 erred out.

UPD2. Clang-17 builds it fine too. So Xcode clang-15 fails, gcc-13 fails, LLVM clang-17 works, gcc-12 provisionally works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants