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 fails with Apple clang with numerous errors: expr.hpp: error: redefinition of 'L2Norm2' etc. #69

Open
barracuda156 opened this issue Jan 3, 2024 · 1 comment

Comments

@barracuda156
Copy link

:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/basiclinalg/bandmatrix.cpp:1:
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/basiclinalg/bla.hpp:76:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/basiclinalg/expr.hpp:1791:15: error: redefinition of 'L2Norm2'
:info:build   inline auto L2Norm2 (const AutoDiff<D,SCAL> & x) 
:info:build               ^
:info:build /opt/local/include/core/autodiff.hpp:1100:15: note: previous definition is here
:info:build   inline auto L2Norm2 (const ngcore::AutoDiff<D,SCAL> & x) 
:info:build               ^
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/basiclinalg/bandmatrix.cpp:1:
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/basiclinalg/bla.hpp:76:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/basiclinalg/expr.hpp:1797:15: error: redefinition of 'L2Norm2'
:info:build   inline auto L2Norm2 (const AutoDiffDiff<D,SCAL> & x) 
:info:build               ^
:info:build /opt/local/include/core/autodiffdiff.hpp:724:15: note: previous definition is here
:info:build   inline auto L2Norm2 (const ngcore::AutoDiffDiff<D,SCAL> & x) 
:info:build               ^
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/basiclinalg/triangular.cpp:1:
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/basiclinalg/bla.hpp:76:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/basiclinalg/expr.hpp:1791:15: error: redefinition of 'L2Norm2'
:info:build   inline auto L2Norm2 (const AutoDiff<D,SCAL> & x) 
:info:build               ^
:info:build /opt/local/include/core/autodiff.hpp:1100:15: note: previous definition is here
:info:build   inline auto L2Norm2 (const ngcore::AutoDiff<D,SCAL> & x) 
:info:build               ^
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/basiclinalg/triangular.cpp:1:
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/basiclinalg/bla.hpp:76:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/basiclinalg/expr.hpp:1797:15: error: redefinition of 'L2Norm2'
:info:build   inline auto L2Norm2 (const AutoDiffDiff<D,SCAL> & x) 
:info:build               ^
:info:build /opt/local/include/core/autodiffdiff.hpp:724:15: note: previous definition is here
:info:build   inline auto L2Norm2 (const ngcore::AutoDiffDiff<D,SCAL> & x) 
:info:build               ^
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/basiclinalg/triangular.cpp:1:
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/basiclinalg/bla.hpp:78:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/basiclinalg/matrix.hpp:521:13: error: call to 'max2' is ambiguous
:info:build         w = max2(w, int(row.size()));
:info:build             ^~~~
:info:build /opt/local/include/core/utils.hpp:152:19: note: candidate function [with T = int]
:info:build   NETGEN_INLINE T max2 (T a, T b)
:info:build                   ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_ngsolve/ngsolve/work/ngsolve-6.2.2301/include/../ngstd/templates.hpp:22:10: note: candidate function [with T = int]
:info:build INLINE T max2 (T a, T b)
:info:build          ^

While gcc-13 failed here #68 on ambiguous call, clang build fails much earlier.

Complete log:
ngsolve_Sonoma_clang.log

@barracuda156 barracuda156 changed the title Build fails with clang with numerous errors: expr.hpp: error: redefinition of 'L2Norm2' etc. Build fails with Apple clang with numerous errors: expr.hpp: error: redefinition of 'L2Norm2' etc. Jan 3, 2024
@barracuda156
Copy link
Author

UPD. On the same system LLVM clang-17 builds this with no errors. So somehow the codebase is very compiler-sensitive.

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

1 participant