Skip to content

[Bug]: Compilation Errors Due to Namespace Conflicts and Missing Type Definitions #13

@beatlesforever

Description

@beatlesforever

What happened?

When compiling the TACOS project, I encountered multiple compilation errors related to namespace conflicts and missing type definitions. The errors primarily indicate that the compiler cannot recognize types such as std::string, std::shared_ptr, and std::vector within the tacos::std namespace. Additionally, there are issues with ambiguous references to the std namespace.

Image

Project Version

  • Operating System: Ubuntu 24.04.1 LTS (Noble Numbat)

  • Docker Version: Docker version 24.0.7, build 24.0.7-0ubuntu2~22.04.1

  • TACOS Version: Commit 00f3873 (Merge pull request Develop #11 from astra-sim/develop)

  • Protobuf Version: libprotoc 3.6.1

  • Boost Version:

    • libboost-dev: 1.74.0.3ubuntu7
    • libboost-filesystem1.74.0: 1.74.0-14ubuntu3
    • libboost-iostreams1.74.0: 1.74.0-14ubuntu3
    • libboost-locale1.74.0: 1.74.0-14ubuntu3
    • libboost-program-options1.74.0: 1.74.0-14ubuntu3
    • libboost-regex1.74.0: 1.74.0-14ubuntu3
    • libboost-thread1.74.0: 1.74.0-14ubuntu3
    • libboost1.74-dev: 1.74.0-14ubuntu3

Operating System

Linux - Debian-based (e.g., Ubuntu)

How to reproduce the bug

  1. Clone the TACOS repository:
    git clone --recurse-submodules https://github.com/astra-sim/tacos.git
  2. Pull the TACOS Docker Image:
    docker pull astrasim/tacos:latest
  3. Start the Docker Container:
    ./utils/start_docker_container.sh
  4. Run TACOS with the provided script:
    [docker] ./tacos.sh

Relevant log output

/app/tacos/include/tacos/writer/xml_writer.h:33:10: error: 'string' in namespace 'tacos::std' does not name a type
   33 |     std::string path;
      |          ^~~~~~
/app/tacos/include/tacos/writer/xml_writer.h:35:10: error: 'shared_ptr' in namespace 'tacos::std' does not name a template type
   35 |     std::shared_ptr<Topology> topology_;
      |          ^~~~~~~~~~
/app/tacos/include/tacos/writer/xml_writer.h:36:10: error: 'shared_ptr' in namespace 'tacos::std' does not name a template type
   36 |     std::shared_ptr<Collective> collective_;
      |          ^~~~~~~~~~
/app/tacos/src/main.cpp: In function 'int main()':
/app/tacos/src/main.cpp:29:9: error: reference to 'std' is ambiguous
   29 |         std::make_shared<Mesh2D>(width, height, latency, bandwidth);
      |         ^~~
/usr/include/c++/13/istream:43:15: note: candidates are: 'namespace tacos::std { }'
   43 | namespace std _GLIBCXX_VISIBILITY(default)
      |               ^~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/13/bits/c++config.h:306:11: note:                 'namespace std { }'
  306 | namespace std
      |           ^~~
/app/tacos/src/main.cpp:29:32: error: expected primary-expression before '>' token
   29 |         std::make_shared<Mesh2D>(width, height, latency, bandwidth);
      |                                ^
/app/tacos/src/main.cpp:41:9: error: reference to 'std' is ambiguous
   41 |         std::make_shared<AllGather>(npusCount, chunkSize, initChunksPerNpu);
      |         ^~~
/usr/include/c++/13/istream:43:15: note: candidates are: 'namespace tacos::std { }'
   43 | namespace std _GLIBCXX_VISIBILITY(default)
      |               ^~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/13/bits/c++config.h:306:11: note:                 'namespace std { }'
  306 | namespace std
      |           ^~~
/app/tacos/src/main.cpp:41:35: error: expected primary-expression before '>' token
   41 |         std::make_shared<AllGather>(npusCount, chunkSize, initChunksPerNpu);
      |                                   ^
/app/tacos/src/writer/xml_writer.cpp: In member function 'void tacos::XmlWriter::writeNpu(NpuID)':
/app/tacos/src/writer/xml_writer.cpp:54:40: error: 'collective_' was not declared in this scope
   54 |     npu.append_attribute("o_chunks") = collective_->chunksPerNpu();
      |                                        ^~~~~~~~~~~
/app/tacos/src/writer/xml_writer.cpp:58:64: error: 'class tacos::NpuResult' has no member named 'ingressLinks'
   58 |     for (const auto& [src, link] : synthesisResult_.npu(npuID).ingressLinks()) {
      |                                                                ^~~~~~~~~~~~
/app/tacos/src/writer/xml_writer.cpp:63:65: error: 'class tacos::NpuResult' has no member named 'egressLinks'
   63 |     for (const auto& [dest, link] : synthesisResult_.npu(npuID).egressLinks()) {
      |                                                                 ^~~~~~~~~~~
/app/tacos/src/writer/xml_writer.cpp: In member function 'void tacos::XmlWriter::save()':
/app/tacos/src/writer/xml_writer.cpp:69:23: error: 'path' was not declared in this scope; did you mean 'boost::filesystem::path'?
   69 |     if (xml.save_file(path.c_str(), PUGIXML_TEXT("\t"),
      |                       ^~~~
      |                       boost::filesystem::path
/usr/include/boost/filesystem/path.hpp:155:7: note: 'boost::filesystem::path' declared here
  155 | class path :
      |       ^~~~
/app/tacos/src/writer/xml_writer.cpp: In member function 'void tacos::XmlWriter::writeIngressLink(pugi::xml_node&, NpuID, NpuID, const tacos::LinkResult&)':
/app/tacos/src/writer/xml_writer.cpp:88:40: error: 'const class tacos::LinkResult' has no member named 'ops'
   88 |     for (const auto& [opID, op] : link.ops()) {
      |                                        ^~~
/app/tacos/src/writer/xml_writer.cpp: In member function 'void tacos::XmlWriter::writeEgressLink(pugi::xml_node&, NpuID, NpuID, const tacos::LinkResult&)':
/app/tacos/src/writer/xml_writer.cpp:117:40: error: 'const class tacos::LinkResult' has no member named 'ops'
  117 |     for (const auto& [opID, op] : link.ops()) {
      |                                        ^~~
gmake[2]: *** [CMakeFiles/tacos.dir/build.make:300: CMakeFiles/tacos.dir/src/writer/xml_writer.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/tacos.dir/build.make:314: CMakeFiles/tacos.dir/src/main.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:189: CMakeFiles/tacos.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

Miscellaneous

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinguntriagedNot labeled by the repository maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions