Skip to content

[bug] [misc] [mac] Fix cannot name an alias template, https://github.com/taichi-dev/taic…#8684

Merged
feisuzhu merged 8 commits into
taichi-dev:masterfrom
hughperkins:hp/fix-cannot-name-an-alias-template
Apr 28, 2025
Merged

[bug] [misc] [mac] Fix cannot name an alias template, https://github.com/taichi-dev/taic…#8684
feisuzhu merged 8 commits into
taichi-dev:masterfrom
hughperkins:hp/fix-cannot-name-an-alias-template

Conversation

@hughperkins
Copy link
Copy Markdown
Contributor

@hughperkins hughperkins commented Apr 26, 2025

…hi/issues/8683

Issue: #8683

Brief Summary

Compile error, on mac M4 Sequoia:

FAILED: taichi/util/CMakeFiles/taichi_util.dir/image_buffer.cpp.o
/Users/hugh/.cache/ti-build-cache/sccache-v041/bin/sccache /usr/bin/clang++  -I/Users/hugh/.cache/ti-build-cache/mambaforge/envs/3.10/lib/python3.10/site-packages/numpy/_core/include -I/Users/hugh/git/taichi -I/Users/hugh/git/taichi/external/include -I/Users/hugh/git/taichi/external/eigen -I/Users/hugh/.cache/ti-build-cache/llvm15-m1-nozstd/include -I/Users/hugh/git/taichi/external/spdlog/include -ffunction-sections -fdata-sections -DTI_ISE_NONE -std=c++17 -fsized-deallocatio
n -Wno-deprecated-declarations -Wno-shorten-64-to-32 -Wall  -Werror  -Wno-ignored-attributes  -Wno-nullability-completeness  -Wno-unused-private-field  -Wno-unneeded-internal-declaration  -Wno-unqualified-std-cast-call  -Wno-unused-but-set-variable  -DTI_ARCH_ARM -DTI_PASS_EXCEPTION_TO_PYTHON -DTI_INCLUDED -fno-objc-arc -DTI_WITH_LLVM -DTI_WITH_METAL -O3 -DNDEBUG -std=gnu++17 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.4.sdk -mmacosx-version-min=15
.0 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden   -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -MD -MT taichi/util/CM


akeFiles/taichi_util.dir/image_buffer.cpp.o -MF taichi/util/CMakeFiles/taichi_util.dir/image_buffer.cpp.o.d -o taichi/util/CMakeFiles/taichi_util.dir/image_buffer.cpp.o -c /Users/hugh/git/taichi/taichi/util/image_buffer.cpp
/Users/hugh/git/taichi/taichi/util/image_buffer.cpp:21:18: error: a declarative nested name specifier cannot name an alias template [-Werror,-Walias-template-in

-declaration-name]
   21 | void Array2D<T>::load_image(const std::string &filename, bool linearize) {
      |      ~~~~~~~~~~~~^
/Users/hugh/git/taichi/taichi/util/image_buffer.cpp:60:18: error: a declarative nested name specifier cannot name an alias template [-Werror,-Walias-template-in-declaration-name]
   60 | void Array2D<T>::write_as_image(const std::string &filename) {
      |      ~~~~~~~~~~~~^
/Users/hugh/git/taichi/taichi/util/image_buffer.cpp:100:18: error: a declarative nested name specifier cannot name an alias template [-Werror,-Walias-template-in-declaration-name]
  100 | void Array2D<T>::write_text(const std::string &font_fn,
      |      ~~~~~~~~~~~~^
3 errors generated.

Fix:

  • use the NDArray<2, N> directly, instead of the alias

copilot:summary

Walkthrough

copilot:walkthrough

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 26, 2025

CLA assistant check
All committers have signed the CLA.

@hughperkins hughperkins marked this pull request as ready for review April 26, 2025 13:38
@hughperkins hughperkins changed the title fix cannot name an alias template, https://github.com/taichi-dev/taic… [bug] [misc] fix cannot name an alias template, https://github.com/taichi-dev/taic… Apr 26, 2025
@hughperkins hughperkins changed the title [bug] [misc] fix cannot name an alias template, https://github.com/taichi-dev/taic… [bug] [misc] Fix cannot name an alias template, https://github.com/taichi-dev/taic… Apr 26, 2025
@hughperkins hughperkins changed the title [bug] [misc] Fix cannot name an alias template, https://github.com/taichi-dev/taic… [bug] [misc] [mac] Fix cannot name an alias template, https://github.com/taichi-dev/taic… Apr 26, 2025
…an-alias-template' into hp/fix-cannot-name-an-alias-template
Copy link
Copy Markdown
Collaborator

@bobcao3 bobcao3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

ps: I have no idea why this piece of code is in there. Perhaps it's from the "old GUI"

@hughperkins
Copy link
Copy Markdown
Contributor Author

Ironically failing on the Mac build 🤔

@hughperkins
Copy link
Copy Markdown
Contributor Author

Looks like it's all passing, but I don't see a 'merge' button?

@feisuzhu feisuzhu merged commit 96a5c46 into taichi-dev:master Apr 28, 2025
15 checks passed
@hughperkins
Copy link
Copy Markdown
Contributor Author

Thank you!

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

Successfully merging this pull request may close these issues.

4 participants